org.apache.commons.graph.visit
Class Visit

java.lang.Object
  extended by org.apache.commons.graph.visit.Visit

public final class Visit
extends Object

Contains different implementations of Graph visitor algorithms.


Method Summary
<V extends Vertex,E extends Edge<V>>
void
breadthFirstSearch(Graph<V,E> graph, V source)
          Breadth-first search algorithm implementation.
<V extends Vertex,E extends Edge<V>>
void
breadthFirstSearch(Graph<V,E> graph, V source, GraphVisitHandler<V,E> handler)
          Breadth-first search algorithm implementation.
<V extends Vertex,E extends Edge<V>>
void
depthFirstSearch(Graph<V,E> graph, V source)
          Depth-first search algorithm implementation.
<V extends Vertex,E extends Edge<V>>
void
depthFirstSearch(Graph<V,E> graph, V source, GraphVisitHandler<V,E> handler)
          Depth-first search algorithm implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

breadthFirstSearch

public final <V extends Vertex,E extends Edge<V>> void breadthFirstSearch(Graph<V,E> graph,
                                                                          V source)
Breadth-first search algorithm implementation.

Type Parameters:
V - the Graph vertices type
E - the Graph edges type
Parameters:
graph - the Graph instance has to be visited
source - the root node the search begins from

breadthFirstSearch

public final <V extends Vertex,E extends Edge<V>> void breadthFirstSearch(Graph<V,E> graph,
                                                                          V source,
                                                                          GraphVisitHandler<V,E> handler)
Breadth-first search algorithm implementation.

Type Parameters:
V - the Graph vertices type
E - the Graph edges type
Parameters:
graph - the Graph instance has to be visited
source - the root node the search begins from
handler - the handler intercepts visit actions

depthFirstSearch

public final <V extends Vertex,E extends Edge<V>> void depthFirstSearch(Graph<V,E> graph,
                                                                        V source)
Depth-first search algorithm implementation.

Type Parameters:
V - the Graph vertices type
E - the Graph edges type
Parameters:
graph - the Graph instance has to be visited
source - the root node the search begins from

depthFirstSearch

public final <V extends Vertex,E extends Edge<V>> void depthFirstSearch(Graph<V,E> graph,
                                                                        V source,
                                                                        GraphVisitHandler<V,E> handler)
Depth-first search algorithm implementation.

Type Parameters:
V - the Graph vertices type
E - the Graph edges type
Parameters:
graph - the Graph instance has to be visited
source - the root node the search begins from
handler - the handler intercepts visit actions


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.