public class TopologicalSort<T extends ColoredVertex>
extends java.lang.Object
Constructor and Description |
---|
TopologicalSort(AbstractGraph<T> graph)
This constructor modifies the colors of the vertices in the graph.
|
Modifier and Type | Method and Description |
---|---|
java.util.LinkedList<ColoredVertex> |
getSortedVertices()
Returns a linked list of vertices in topologically sorted order.
|
boolean |
precedes(ColoredVertex earlier,
ColoredVertex later)
Returns true if earlier precedes later in the topologically sorted list.
|
public TopologicalSort(AbstractGraph<T> graph)
graph
- graph whose vertices are to be topologically sortedpublic java.util.LinkedList<ColoredVertex> getSortedVertices()
public boolean precedes(ColoredVertex earlier, ColoredVertex later)
earlier
- vertex tested for being earlierlater
- vertex tested for being later