Modifier and Type | Field and Description |
---|---|
private Grafo.Vertex<T> |
Grafo.Edge.from |
private Grafo.Vertex<T> |
Grafo.Dirigido.rootVertex
The vertex identified as the root of the graph
|
private Grafo.Vertex<T> |
Grafo.Edge.to |
Modifier and Type | Field and Description |
---|---|
private java.util.List<Grafo.Vertex<T>> |
Grafo.Dirigido.verticies
Vector of graph verticies
|
Modifier and Type | Method and Description |
---|---|
Grafo.Vertex<T> |
Grafo.Dirigido.findVertexByData(T data,
java.util.Comparator<T> compare)
Search the verticies for one with data.
|
Grafo.Vertex<T> |
Grafo.Dirigido.findVertexByName(java.lang.String name)
Search the verticies for one with name.
|
Grafo.Vertex<T> |
Grafo.Edge.getFrom()
Get the starting vertex
|
Grafo.Vertex<T> |
Grafo.Dirigido.getRootVertex()
Get the root vertex
|
Grafo.Vertex<T> |
Grafo.Edge.getTo()
Get the ending vertex
|
Grafo.Vertex<T> |
Grafo.Dirigido.getVertex(int n)
Get the given Vertex.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Grafo.Vertex<T>> |
Grafo.Dirigido.getVerticies()
Get the graph verticies
|
Modifier and Type | Method and Description |
---|---|
boolean |
Grafo.Dirigido.addEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Insert a directed, weighted Edge into the graph.
|
boolean |
Grafo.Dirigido.addEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Insert a directed, weighted Edge into the graph.
|
void |
Grafo.Vertex.addIncomingEdge(Grafo.Vertex<T> from,
int cost)
Add an incoming edge starting at from
|
void |
Grafo.Vertex.addOutgoingEdge(Grafo.Vertex<T> to,
int cost)
Add an outgoing edge ending at to.
|
boolean |
Grafo.Dirigido.addVertex(Grafo.Vertex<T> v)
Add a vertex to the graph
|
void |
Grafo.Dirigido.breadthFirstSearch(Grafo.Vertex<T> v,
Grafo.Visitor<T> visitor)
Perform a breadth first search of this graph, starting at v.
|
<E extends java.lang.Exception> |
Grafo.Dirigido.breadthFirstSearch(Grafo.Vertex<T> v,
Grafo.VisitorEX<T,E> visitor)
Perform a breadth first search of this graph, starting at v.
|
int |
Grafo.Vertex.cost(Grafo.Vertex<T> dest)
What is the cost from this vertext to the dest vertex.
|
<E extends java.lang.Exception> |
Grafo.Dirigido.depthFirstSearch(Grafo.Vertex<T> v,
Grafo.VisitorEX<T,E> visitor)
Perform a depth first serach using recursion.
|
void |
Grafo.Dirigido.dfsSpanningTree(Grafo.Vertex<T> v,
Grafo.DFSVisitor<T> visitor)
Find the spanning tree using a DFS starting from v.
|
Grafo.Edge<T> |
Grafo.Vertex.findEdge(Grafo.Vertex<T> dest)
Search the outgoing edges looking for an edge whose's edge.to == dest.
|
boolean |
Grafo.Vertex.hasEdge(Grafo.Vertex<T> dest)
Is there an outgoing edge ending at dest.
|
boolean |
Grafo.Dirigido.insertBiEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Insert a bidirectional Edge in the graph
|
boolean |
Grafo.Dirigido.insertBiEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Insert a bidirectional Edge in the graph
|
boolean |
Grafo.Dirigido.removeEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to)
Remove an Edge from the graph
|
boolean |
Grafo.Dirigido.removeEdge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to)
Remove an Edge from the graph
|
boolean |
Grafo.Dirigido.removeVertex(Grafo.Vertex<T> v)
Remove a vertex from the graph
|
void |
Grafo.Dirigido.setRootVertex(Grafo.Vertex<T> root)
Set a root vertex.
|
void |
Grafo.Visitor.visit(Grafo.Dirigido<T> g,
Grafo.Vertex<T> v)
Called by the graph traversal methods when a vertex is first visited.
|
void |
Grafo.VisitorEX.visit(Grafo.Dirigido<T> g,
Grafo.Vertex<T> v)
Called by the graph traversal methods when a vertex is first visited.
|
void |
Grafo.DFSVisitor.visit(Grafo.Dirigido<T> g,
Grafo.Vertex<T> v)
Called by the graph traversal methods when a vertex is first visited.
|
void |
Grafo.DFSVisitor.visit(Grafo.Dirigido<T> g,
Grafo.Vertex<T> v,
Grafo.Edge<T> e)
Used dfsSpanningTree to notify the visitor of each outgoing edge to an
unvisited vertex.
|
private void |
Grafo.Dirigido.visit(Grafo.Vertex<T> v,
java.util.ArrayList<Grafo.Edge<T>> cycleEdges) |
Constructor and Description |
---|
Edge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to)
Create a zero cost edge between from and to
|
Edge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to)
Create a zero cost edge between from and to
|
Edge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Create an edge between from and to with the given cost.
|
Edge(Grafo.Vertex<T> from,
Grafo.Vertex<T> to,
int cost)
Create an edge between from and to with the given cost.
|