public class GraphUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
GraphUtil.Graph
Directed graph API
|
Constructor and Description |
---|
GraphUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
pathExists(GraphUtil.Graph graph,
int start,
int end)
Checks if a path exists between start and end
|
static int[] |
stronglyConnectedComponents(GraphUtil.Graph graph)
Computes the strongly connected components of the graph
|
static GraphUtil.Graph |
transpose(GraphUtil.Graph graph)
Transpose the graph i.e.
|
public static GraphUtil.Graph transpose(GraphUtil.Graph graph)
graph
- a Graphpublic static int[] stronglyConnectedComponents(GraphUtil.Graph graph)
graph
- the input graph on which to compute the strongly
connected componentspublic static boolean pathExists(GraphUtil.Graph graph, int start, int end)
graph
- start
- a node id from the graphend
- a node id from the graph