|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--lu.cs.co.graph.Forest
A class for (undirected) forests whose vertex set coincides with the underlying graph. Provides methods for edges insertion and cycle detection.
| Field Summary | |
int |
len
The total edge length/weigth of all edges in the forest. |
| Constructor Summary | |
Forest(Graph G)
Constructs an empty forest over a given graph. |
|
| Method Summary | |
Object |
clone()
Returns a clone of this forest. |
boolean |
contains(Edge e)
Returns true iff a given edge is in the forest. |
boolean |
contains(Vertex v)
Always returns true. |
int |
degree(Vertex v)
Returns the degree of a given vertex in this forest, that is, the number of incident forest edges. |
Edges |
edges()
|
boolean |
inducesCycle(Edge e)
Returns true iff inserting the given edge would induce a cycle in this forest. |
void |
insert(Edge e)
Inserts an edge. |
int |
numEdges()
|
int |
numVertices()
Returns the number of forest vertices, which is always the number of vertices in the underlying graph. |
int |
size()
Returns the number of edges in the forest. |
String |
toString()
Returns a textual representation of the forest. |
Graph |
underlying()
|
Vertices |
vertices()
|
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public int len
| Constructor Detail |
public Forest(Graph G)
| Method Detail |
public Object clone()
public Edges edges()
public Vertices vertices()
public void insert(Edge e)
public int degree(Vertex v)
v - the given vertexpublic Graph underlying()
public boolean contains(Edge e)
e - the given edgepublic boolean contains(Vertex v)
public boolean inducesCycle(Edge e)
e - the given edgepublic int size()
public int numVertices()
public int numEdges()
public String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||