Given the directed graph below:
The condensation of a directed graph , or condensed graph is a directed acyclic graph in which each node represents a strongly connected component in the original graph . For instance, if nodes , and form a strongly connected component in , this component will be represented as a single node in the condensed graph.
All edges of that do not belong to a strongly connected component remain unchanged in the condensed graph. For example, if the graph contains two strongly connected components and a directed edge from the first component (comprising of nodes nodes , , and ) to the second (comprising of nodes , , , and ), then the condensed graph will have two nodes and , with a directed edge from to . If two strongly connected components in a graph are connected by more than one edge, the resulting condensed graph will still have only one edge between the corresponding nodes.
Use Kosaraju's algorithm to identify the strongly connected components in the graph and construct its condensation. The expected output format is the following:
13 59
59 78
In the provided format, each line corresponds to an edge in the condensed graph. The digits represent the nodes within a strongly connected component, and these node labels are sorted in an ascending order.