I am implementing Kosaraju's algorithm using Google Guava Graph API but currently stuck to obtain a transpose of a MutableValueGraph
using standard guava APIs.
Below is my code:
MutableValueGraph<GraphNode,Integer> graph = ValueGraphBuilder.directed()
.allowsSelfLoops(true)
.build();
Can someone suggest a good way to convert the graph to its transpose keeping the underlying interface same (MutableValueGraph
)? Is there any way to do that? If not, I am happy to change the underlying interface.