graph
Class Graph
java.lang.Object
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 |
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 graphp
- the probability for each edge to be present
areAdjacent
public abstract boolean areAdjacent(int u,
int v)
- Tests whether two vertices are adjacent
- Parameters:
u
- the first vertexv
- the second vertex
vertexNum
public abstract int vertexNum()
edgeNum
public abstract int edgeNum()