fi.joensuu.cs.tra
Class DiGraph
java.lang.Object
fi.joensuu.cs.tra.AbstractGraph
fi.joensuu.cs.tra.DiGraph
- All Implemented Interfaces:
- Iterable
public class DiGraph
- extends AbstractGraph
- implements Iterable
A DiGraph or a directed graph is an ordered
pair G := (V, A) with
An edge e = (x, y) is considered to be directed from
x to y.
DiGraph is simply a subclass of the abstract class
AbstractGraph
that sets it up in directed mode.
Example:
void dfsColor(Vertex vertex, int color) {
vertex.setColor(color);
for (Vertex neighborVertex : vertex.neighbours())
if (neighborVertex.getColor() != color)
dfsColor(neighborVertex, color);
}
- See Also:
Vertex
,
Edge
,
Graph
,
AbstractGraph
Methods inherited from class fi.joensuu.cs.tra.AbstractGraph |
addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, addVertex, edgeIterator, edges, firstVertex, isDiGraph, iterator, removeVertex, size, toString, vertexCount, vertexIterator, vertices |
DiGraph
public DiGraph()