public class Graph
extends java.lang.Object
Constructor and Description |
---|
Graph()
Creates an empty graph.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Edge edge)
Adds an edge to the graph.
|
void |
addVertex(Vertex vertex)
Adds a vertex to the graph.
|
Edge |
getEdge(Vertex start,
Vertex end)
Returns the edge between the start and the end vertex.
|
Edge[] |
getEdges(Vertex vertex)
Returns the outgoing edges for a vertex.
|
Vertex |
getRoot()
Returns the root vertex of the graph.
|