net.sf.jsort.graph
Class TopologicalSort

java.lang.Object
  extended by net.sf.jsort.graph.TopologicalSort

public class TopologicalSort
extends java.lang.Object

This class implements a topological sort of vertices of a directed acyclic graph (DAG), based on the direction of the edges connecting them.

Author:
Domingos Creado

Constructor Summary
TopologicalSort()
           
 
Method Summary
 java.util.List sort(edu.uci.ics.jung.graph.DirectedGraph graph)
          Equivalent as sort(graph,true).
 java.util.List sort(edu.uci.ics.jung.graph.DirectedGraph graph, boolean useDirectionAsPrecedence)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologicalSort

public TopologicalSort()
Method Detail

sort

public java.util.List sort(edu.uci.ics.jung.graph.DirectedGraph graph)
Equivalent as sort(graph,true).

Parameters:
graph -
Returns:

sort

public java.util.List sort(edu.uci.ics.jung.graph.DirectedGraph graph,
                           boolean useDirectionAsPrecedence)
Parameters:
graph - the graph to be sorted
useDirectionAsPrecedence - if the vertex that point to other must come first
Returns:


Copyright © 2005-2008 Domingos Creado. All Rights Reserved.