|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.algorithm.BFS
This class implements the Breadth-First-Search algorithm with a cost of
O(|V| + |E|).The algorithm can be customized by implementing a specialized
BFSVisitor.
| Constructor Summary | |
BFS()
Constructs an empty BFS search context. |
|
| Method Summary | |
void |
apply(Graph graph,
BFSVisitor visitor)
This starts a visit with the node at index 0 as the rootnode. |
void |
apply(Graph graph,
BFSVisitor visitor,
boolean allcomponents)
This starts a visit with the node at index 0 as the rootnode. |
void |
apply(Graph graph,
BFSVisitor visitor,
Node startnode)
This starts a visit with the node startnode
as the rootnode.
|
void |
apply(Graph graph,
BFSVisitor visitor,
Node startnode,
boolean allcomponents)
This starts a visit with the node startnode
as the rootnode.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BFS()
| Method Detail |
public void apply(Graph graph,
BFSVisitor visitor)
throws GraphException
graph - the graph to visit.visitor - a bfs visitor instance to handle the callbacks
that occur during the visiting.
GraphException - thrown if the operation failed.
public void apply(Graph graph,
BFSVisitor visitor,
Node startnode)
throws GraphException
startnode
as the rootnode.
If allcomponents is false, unvisited unconnected components
are excluded from the search
All components of the graph are visited by default.
graph - the graph to visit.visitor - a bfs visitor instance to handle the callbacks
that occur during the visiting.startnode - a node that specifies the staring point for the BFS.
GraphException - thrown if the operation failed.
public void apply(Graph graph,
BFSVisitor visitor,
boolean allcomponents)
throws GraphException
allcomponents is false, unvisited unconnected components
are excluded from the search
graph - the graph to visit.visitor - a bfs visitor instance to handle the callbacks
that occur during the visiting.allcomponents - a flag that determines whether to visit all
components of the graph consecutively.
GraphException - thrown if the operation failed.
public void apply(Graph graph,
BFSVisitor visitor,
Node startnode,
boolean allcomponents)
throws GraphException
startnode
as the rootnode.
If allcomponents is false, unvisited unconnected components
are excluded from the search
graph - the graph to visit.visitor - a bfs visitor instance to handle the callbacks
that occur during the visiting.startnode - a node that specifies the staring point for the BFS.allcomponents - a flag that determines whether to visit all
components of the graph consecutively.
GraphException - thrown if the operation failed.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||