V - the vertex type; often Coordpublic class UndirectedGraph<V> extends Graph<V> implements java.io.Serializable
Graph where all connections between vertices are two-way and have equal cost for traveling A to B
or B to A.| Constructor and Description |
|---|
UndirectedGraph() |
UndirectedGraph(java.util.Collection<V> vertices) |
| Modifier and Type | Method and Description |
|---|---|
protected Connection<V> |
addConnection(Node<V> a,
Node<V> b,
float weight) |
UndirectedGraphAlgorithms<V> |
algorithms() |
protected Graph<V> |
createNew() |
protected Connection<V> |
getEdge(Node<V> a,
Node<V> b) |
boolean |
isDirected()
Check if the graph is directed, that is whether the edges form an ordered pair or a set.
|
protected Connection<V> |
obtainEdge() |
protected boolean |
removeConnection(Node<V> a,
Node<V> b) |
addConnection, addEdge, addEdge, addVertex, addVertices, connectionExists, contains, edgeExists, getEdge, getEdgeCount, getEdges, getEdges, getNode, getNodes, getVertices, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeNode, removeVertex, removeVertices, size, sortEdges, sortVerticespublic UndirectedGraph()
public UndirectedGraph(java.util.Collection<V> vertices)
protected Connection<V> obtainEdge()
obtainEdge in class Graph<V>protected Connection<V> addConnection(Node<V> a, Node<V> b, float weight)
addConnection in class Graph<V>protected boolean removeConnection(Node<V> a, Node<V> b)
removeConnection in class Graph<V>public boolean isDirected()
GraphisDirected in class Graph<V>public UndirectedGraphAlgorithms<V> algorithms()
algorithms in class Graph<V>Copyright © Eben Howard 2012–2022. All rights reserved.