fi.joensuu.cs.tra
Class Graph

java.lang.Object
  extended by fi.joensuu.cs.tra.AbstractGraph
      extended by fi.joensuu.cs.tra.Graph
All Implemented Interfaces:
Iterable

public class Graph
extends AbstractGraph
implements Iterable

A Graph or an undirected graph is an ordered pair G := (V, E) with

Graph is simply a subclass of the abstract class AbstractGraph that sets it up in undirected mode.

Example:
     boolean isConnected(Graph graph) {

       colorAllVertices(graph, Graph.WHITE);
       dfsColor(graph.firstVertex, Graph.BLACK);

       for (Vertex vertex : graph.vertices())
         if (vertex.getColor() == Graph.WHITE) 
           return false;
       return true;
     }
 
See DiGraph documentation for dfsColor(...)

See Also:
Vertex, Edge, DiGraph, AbstractGraph

Nested Class Summary
 
Nested classes/interfaces inherited from class fi.joensuu.cs.tra.AbstractGraph
AbstractGraph.EdgeIteratorWrapper, AbstractGraph.VertexIteratorWrapper
 
Field Summary
 
Fields inherited from class fi.joensuu.cs.tra.AbstractGraph
BLACK, BLUE, GRAY, GREEN, GREY, NaN, RED, WHITE
 
Constructor Summary
Graph()
           
 
Method Summary
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

Graph

public Graph()