13
13
def get_longest_matching_traffic_matrix (topology , tor_list , demand_dict ):
14
14
""" Generates maximal permutation traffic matrix that results in near worst-case throughput
15
15
16
- This is a generalization to: Measuring and Understanding Throughput of Network Topologies
17
- (Sangeetha Abdu Jyothi, Ankit Singla, P. Brighten Godfrey, Alexandra Kolla), 2016
16
+ This is a generalization to: Measuring and Understanding Throughput of Network Topologies
17
+ (Sangeetha Abdu Jyothi, Ankit Singla, P. Brighten Godfrey, Alexandra Kolla), 2016
18
18
19
- Args:
20
- topology: a networkx graph representing switch connections
21
- tor_list: contains list of switches with directly connected servers
22
- demand_dict: a mapping from each ToR to its number of directly connected servers
23
- Returns:
24
- traffic_matrix: a dictionary (src, dst) --> amount of traffic
25
- sum_weight_matching: sum shortest_path_length(src, dst) * traffic_matrix(src, dst) over all pairs
26
- traffic_matrix
19
+ Args:
20
+ topology: a networkx graph representing switch connections
21
+ tor_list: contains list of switches with directly connected servers
22
+ demand_dict: a mapping from each ToR to its number of directly connected servers
23
+ Returns:
24
+ traffic_matrix: a dictionary (src, dst) --> amount of traffic
25
+ sum_weight_matching: sum shortest_path_length(src, dst) * traffic_matrix(src, dst) over all pairs
26
+ traffic_matrix
27
27
"""
28
28
29
+ # Line 30-36 makes sure the order of ToRs in the tor_list is the same as their order in the topology.nodes().
29
30
initial_tor_list = list (tor_list )
30
31
num_nodes = len (tor_list )
31
32
tor_list = list ()
@@ -49,7 +50,6 @@ def get_longest_matching_traffic_matrix(topology, tor_list, demand_dict):
49
50
del coefficient
50
51
del minimum
51
52
gc .collect ()
52
- # bi_graph.es["weights"] = weights
53
53
54
54
print ("**** Computing maximum weighted matching..." )
55
55
maximal_matching = bi_graph .maximum_bipartite_matching (weights = weights , eps = 0.001 )
0 commit comments