def test_generated_TCP(): graph, existence_for_node_time, connectivity_demand = generate_graph( num_nodes=100, edge_connectivity=.1, max_time=3, active_time_percent=1) model, edge_variables = generate_TCP_model(graph, existence_for_node_time, connectivity_demand) subgraph = solve_TCP_instance(model, graph, edge_variables) return subgraph
def modulate_num_nodes(): num_nodes = [25*i for i in range(1,9)] times = [] for node_count in num_nodes: graph, existence_for_node_time, connectivity_demand = generate_graph(num_nodes=node_count) times.append(solve_TCP_instance(graph, existence_for_node_time, connectivity_demand, time_output=True)) print num_nodes, times plot(num_nodes, times, "Number of Nodes", "Time (Seconds)", "TCP Runtime for Nodes vs Time ")
def modulate_node_percentage_active(): percentage_nodes_active = [0.05*i for i in range(1,21)] times = [] for percentage in percentage_nodes_active: graph, existence_for_node_time, connectivity_demand = generate_graph(active_time_percent=percentage) times.append(solve_TCP_instance(graph, existence_for_node_time, connectivity_demand, time_output=True)) print percentage_nodes_active, times plot(percentage_nodes_active, times, "Percentage of Edges Active", "Time (Seconds)", "TCP Runtime for Percentage of Edge Active vs Time ")
def test_generated_TCP(): graph, existence_for_node_time, connectivity_demand = generate_graph( num_nodes=10000, edge_connectivity=.001, max_time=3, active_time_percent=0.1) solve_TCP_instance(graph, existence_for_node_time, connectivity_demand) print "Connectivity Demand: " + str(connectivity_demand) return existence_for_node_time, graph
def modulate_num_nodes(): num_nodes = [25 * i for i in range(1, 9)] times = [] for node_count in num_nodes: graph, existence_for_node_time, connectivity_demand = generate_graph( num_nodes=node_count) times.append( solve_TCP_instance(graph, existence_for_node_time, connectivity_demand, time_output=True)) print num_nodes, times plot(num_nodes, times, "Number of Nodes", "Time (Seconds)", "TCP Runtime for Nodes vs Time ")
def modulate_node_percentage_active(): percentage_nodes_active = [0.05 * i for i in range(1, 21)] times = [] for percentage in percentage_nodes_active: graph, existence_for_node_time, connectivity_demand = generate_graph( active_time_percent=percentage) times.append( solve_TCP_instance(graph, existence_for_node_time, connectivity_demand, time_output=True)) print percentage_nodes_active, times plot(percentage_nodes_active, times, "Percentage of Edges Active", "Time (Seconds)", "TCP Runtime for Percentage of Edge Active vs Time ")
def test_generated_TCP(): graph, existence_for_node_time, connectivity_demand = generate_graph(num_nodes=10000, edge_connectivity=.001, max_time=3, active_time_percent=0.1) solve_TCP_instance(graph, existence_for_node_time, connectivity_demand) print "Connectivity Demand: " + str(connectivity_demand) return existence_for_node_time, graph