infovis.graph.algorithm
Class DFSVisitor

java.lang.Object
  extended by infovis.graph.algorithm.DFSVisitor
All Implemented Interfaces:
DepthFirst.Visitor

public class DFSVisitor
extends Object
implements DepthFirst.Visitor

Basic implementation of the DepthFirst.Visitor interface

Version:
$Revision: 1.1 $
Author:
Jean-Daniel Fekete

Constructor Summary
DFSVisitor()
           
 
Method Summary
 void backEdge(int edge)
          Invoked on the back edges in the graph.
 void discoverVertex(int vertex)
          Invoked when a vertex is encountered for the first time.
 void examineEdge(int edge)
          Invoked on every out-edge of each vertex after it is discovered.
 void finishVertex(int vertex)
          Invoked on a vertex after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined).
 void forwardOrCrossEdge(int edge)
          Invoked on forward or cross edges in the graph.
 void initializeVertex(int vertex)
          invoked on every vertex of the graph before the start of the graph search.
 void startVertex(int vertex)
          invoked on the source vertex once before the start of the search.
 void treeEdge(int edge)
          Invoked on each edge as it becomes a member of the edges that form the search tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFSVisitor

public DFSVisitor()
Method Detail

backEdge

public void backEdge(int edge)
Description copied from interface: DepthFirst.Visitor
Invoked on the back edges in the graph.

Specified by:
backEdge in interface DepthFirst.Visitor
Parameters:
edge - the Edge

discoverVertex

public void discoverVertex(int vertex)
Description copied from interface: DepthFirst.Visitor
Invoked when a vertex is encountered for the first time.

Specified by:
discoverVertex in interface DepthFirst.Visitor
Parameters:
vertex - the Vertex

examineEdge

public void examineEdge(int edge)
Description copied from interface: DepthFirst.Visitor
Invoked on every out-edge of each vertex after it is discovered.

Specified by:
examineEdge in interface DepthFirst.Visitor
Parameters:
edge - the Edge

finishVertex

public void finishVertex(int vertex)
Description copied from interface: DepthFirst.Visitor
Invoked on a vertex after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined).

Specified by:
finishVertex in interface DepthFirst.Visitor
Parameters:
vertex - the Vertex

forwardOrCrossEdge

public void forwardOrCrossEdge(int edge)
Description copied from interface: DepthFirst.Visitor
Invoked on forward or cross edges in the graph. In an undirected graph this method is never called.

Specified by:
forwardOrCrossEdge in interface DepthFirst.Visitor
Parameters:
edge - the Edge

initializeVertex

public void initializeVertex(int vertex)
Description copied from interface: DepthFirst.Visitor
invoked on every vertex of the graph before the start of the graph search.

Specified by:
initializeVertex in interface DepthFirst.Visitor
Parameters:
vertex - the Vertex

startVertex

public void startVertex(int vertex)
Description copied from interface: DepthFirst.Visitor
invoked on the source vertex once before the start of the search.

Specified by:
startVertex in interface DepthFirst.Visitor
Parameters:
vertex - the Vertex

treeEdge

public void treeEdge(int edge)
Description copied from interface: DepthFirst.Visitor
Invoked on each edge as it becomes a member of the edges that form the search tree. If you wish to record predecessors, do so at this event point.

Specified by:
treeEdge in interface DepthFirst.Visitor
Parameters:
edge - the Edge


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.