de.aitools.iv.graphdrawing.datastructures.graph.algorithms
Class DepthFirstSearch

java.lang.Object
  extended by de.aitools.iv.graphdrawing.datastructures.graph.algorithms.DepthFirstSearch

public class DepthFirstSearch
extends java.lang.Object

Author:
smze@upb.de See Cormen, chapter 23.3

Field Summary
static int black
           
static int grey
           
static int nil
           
static int white
           
 
Constructor Summary
DepthFirstSearch(Graph g)
          Creates a new instance of DepthFirstSearch
DepthFirstSearch(Graph g, Vertex root, TreeVertexVisitor visitor)
           
 
Method Summary
 int[] getConnectedComponents()
           
 int[] getDepth()
           
 java.util.Vector getRoots()
           
 java.util.LinkedList getTopologicalSort()
           
 void init(int vertexCount)
           
 boolean isTree()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nil

public static final int nil
See Also:
Constant Field Values

white

public static final int white
See Also:
Constant Field Values

grey

public static final int grey
See Also:
Constant Field Values

black

public static final int black
See Also:
Constant Field Values
Constructor Detail

DepthFirstSearch

public DepthFirstSearch(Graph g)
Creates a new instance of DepthFirstSearch


DepthFirstSearch

public DepthFirstSearch(Graph g,
                        Vertex root,
                        TreeVertexVisitor visitor)
Method Detail

getRoots

public java.util.Vector getRoots()

getTopologicalSort

public java.util.LinkedList getTopologicalSort()

getDepth

public int[] getDepth()

getConnectedComponents

public int[] getConnectedComponents()

isTree

public boolean isTree()

init

public void init(int vertexCount)