graph
Class Graph

java.lang.Object
  extended by graph.Graph
Direct Known Subclasses:
AdjacencyMatrixGraph

public abstract class Graph
extends java.lang.Object


Constructor Summary
Graph()
          Builds a fixed graph
Graph(int n, double p)
          Builds a random graph according to the G_n,p model.
 
Method Summary
abstract  boolean areAdjacent(int u, int v)
          Tests whether two vertices are adjacent
abstract  int edgeNum()
           
abstract  int vertexNum()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph

public Graph()
Builds a fixed graph


Graph

public Graph(int n,
             double p)
Builds a random graph according to the G_n,p model.

Parameters:
n - the number of vertices in the generated graph
p - the probability for each edge to be present
Method Detail

areAdjacent

public abstract boolean areAdjacent(int u,
                                    int v)
Tests whether two vertices are adjacent

Parameters:
u - the first vertex
v - the second vertex

vertexNum

public abstract int vertexNum()

edgeNum

public abstract int edgeNum()