|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dishevelled.graph.impl.GraphUtils
public final class GraphUtils
Static utility methods on directed graphs.
| Method Summary | ||
|---|---|---|
static
|
breadthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
Breadth-first search. |
|
static
|
connectedComponents(Graph<N,E> graph)
Find the connected components of the specified graph. |
|
static
|
createGraph()
Create and return a new directed graph. |
|
static
|
createGraph(Graph<N,E> graph)
Create and return a new directed graph with the same structure and same node and edge values as the specified graph. |
|
static
|
createGraph(int nodeCapacity,
int edgeCapacity)
Create and return a new directed graph with the specified initial node and edge capacities. |
|
static
|
depthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
Depth-first search. |
|
static
|
undirectedBreadthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
Undirected breadth-first search. |
|
static
|
unmodifiableGraph(Graph<N,E> graph)
Create and return an unmodifiable graph decorator that decorates the specified graph. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <N,E> Graph<N,E> createGraph()
N - node value typeE - edge value type
public static <N,E> Graph<N,E> createGraph(int nodeCapacity,
int edgeCapacity)
N - node value typeE - edge value typenodeCapacity - initial node capacity, must be >= 0edgeCapacity - initial edge capacity, must be >= 0
public static <N,E> Graph<N,E> createGraph(Graph<N,E> graph)
N - node value typeE - edge value typegraph - graph to copy, must not be null
public static <N,E> Set<Set<Node<N,E>>> connectedComponents(Graph<N,E> graph)
N - node value typeE - edge value typegraph - graph, must not be null
public static <N,E> void depthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
N - node value typeE - edge value typegraph - graph to search, must not be nullnode - node to start from, must not be null and must be contained in
the specified graphprocedure - procedure to run when visiting each node, must not be null
public static <N,E> void breadthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
N - node value typeE - edge value typegraph - graph to search, must not be nullnode - node to start from, must not be null and must be contained in
the specified graphprocedure - procedure to run when visiting each node, must not be null
public static <N,E> void undirectedBreadthFirstSearch(Graph<N,E> graph,
Node<N,E> node,
UnaryProcedure<Node<N,E>> procedure)
N - node value typeE - edge value typegraph - graph to search, must not be nullnode - node to start from, must not be null and must be contained in
the specified graphprocedure - procedure to run when visiting each node, must not be nullpublic static <N,E> Graph<N,E> unmodifiableGraph(Graph<N,E> graph)
N - node value typeE - edge value typegraph - graph to decorate, must not be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||