fuzzydl.graph
Class Digraph

java.lang.Object
  extended by fuzzydl.graph.Digraph

public class Digraph
extends java.lang.Object


Constructor Summary
Digraph(int V)
          Constructor of an empty digraph with V vertices.
 
Method Summary
 void addEdge(int v, int w)
          Adds the directed edge v-w to the digraph.
 fuzzydl.graph.Bag<java.lang.Integer> getAdj(int v)
          Gets the array of elements adjacent to a node.
 int numVertices()
          Gets the number of vertices in the digraph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Digraph

public Digraph(int V)
Constructor of an empty digraph with V vertices.

Parameters:
V - Number of vertices.
Method Detail

numVertices

public int numVertices()
Gets the number of vertices in the digraph.

Returns:
Number of vertices in the digraph.

addEdge

public void addEdge(int v,
                    int w)
Adds the directed edge v-w to the digraph.

Parameters:
v - Source node.
w - Target node.

getAdj

public fuzzydl.graph.Bag<java.lang.Integer> getAdj(int v)
Gets the array of elements adjacent to a node.

Parameters:
v - A node of the graph.
Returns:
An array of adjacent elements.