Kosaraju's Algorithm for finding SCCs but keep track of edge between SCCs?
问题 I currently have a working implementation of Kosaraji's algorithm that, given a directed graph with no weights, will print the SCCs in a graph. I would like to adapt it so it will also state where the edges between the SCCs are. Here is the code: from collections import defaultdict #---- Definitions ----# #Graph Graph = {} #Transpose of Graph Transpose_Graph = {} #Visited Nodes for Graph Visited_Nodes_Graph = {} #Visited Nodes for Transpose Graph Visited_Nodes_Transpose_Graph = {} #Stack to