for i in range(counter): path = [] current = src path.append(src) s.push(src) while (not(current == tgt)) and (not(s.isEmpty())): for edge in current.out_edges(): if g.ep.edge_flow[edge] == 1 and g.ep.residual_capacity[edge] == 1: s.push(edge.target()) current = s.pop() g.ep.residual_capacity[g.edge(path[-1], current)] = 0 g.ep.residual_capacity[g.edge(current, path[-1])] = 0 path.append(current) paths.append(path) s.allClear() temp_list = [] for each_path in paths: temp_list.append([int(x) for x in each_path]) frequency_n_paths[g.gp.layer_name] = temp_list paths = [] max_flow = sum(g.ep.edge_flow[e] for e in tgt.in_edges()) request_key = str(request[0]) + " -> " + str(request[1]) # print(request_key) all_requests_n_paths[request_key] = frequency_n_paths