|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uka.algo.GT3D.BreadthFirstSearchDemo
public class BreadthFirstSearchDemo
This class implements Breadth First Search.
Field Summary | |
---|---|
(package private) java.util.LinkedList<edu.uci.ics.jung.graph.Vertex> |
candidates
Waiting list for nodes |
(package private) boolean |
initialized
|
(package private) boolean |
ready
|
private edu.uci.ics.jung.graph.DirectedGraph |
theGraph
The graph we are dealing with, Read in init . |
(package private) java.util.Map<edu.uci.ics.jung.graph.Vertex,java.lang.Boolean> |
visited
Map of visited nodes |
Constructor Summary | |
---|---|
BreadthFirstSearchDemo()
|
Method Summary | |
---|---|
boolean |
atStart()
|
boolean |
finished()
|
javax.vecmath.Point3d |
getBoundingBox()
|
void |
init()
|
void |
init(edu.uci.ics.jung.graph.DirectedGraph aGraph)
|
void |
init(java.lang.String filename)
Initialize the graph, the map of visited nodes and put the first vertex into the queue. |
protected void |
markNode(edu.uci.ics.jung.graph.Vertex v)
Visualize a visited node. |
void |
nextStep()
Perform the next step of the search: Get the next vertex fromt the queue and mark. all its neighbours. |
void |
previousStep()
this method does nothing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private edu.uci.ics.jung.graph.DirectedGraph theGraph
init
.
java.util.LinkedList<edu.uci.ics.jung.graph.Vertex> candidates
java.util.Map<edu.uci.ics.jung.graph.Vertex,java.lang.Boolean> visited
boolean initialized
boolean ready
Constructor Detail |
---|
public BreadthFirstSearchDemo()
Method Detail |
---|
public javax.vecmath.Point3d getBoundingBox()
public void init(edu.uci.ics.jung.graph.DirectedGraph aGraph)
public void init()
public void init(java.lang.String filename) throws FileFormatException
init
in interface StepwiseAlgorithm
filename
- the name of the GraphML file to read from.
FileFormatException
StepwiseAlgorithm.init(java.lang.String)
public void nextStep()
nextStep
in interface StepwiseAlgorithm
StepwiseAlgorithm.nextStep()
protected void markNode(edu.uci.ics.jung.graph.Vertex v)
v
- the current node.public void previousStep()
previousStep
in interface StepwiseAlgorithm
StepwiseAlgorithm.previousStep()
public boolean finished()
finished
in interface StepwiseAlgorithm
true
iff the algorithm has terminated.public boolean atStart()
atStart
in interface StepwiseAlgorithm
true
iff the algorithm is in its starting state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |