public class UndirectedSimpleGraph<V> extends java.lang.Object implements UndirectedGraph<V>
Constructor and Description |
---|
UndirectedSimpleGraph(java.lang.Class<?> clazz,
java.util.Collection<V> vertices) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int a,
int b) |
V |
getEdgeNodeA(long edgeIndex) |
V |
getEdgeNodeB(long edgeIndex) |
int |
getEdgeNodeIndexA(long edgeIndex) |
int |
getEdgeNodeIndexB(long edgeIndex) |
int |
getEdgeNumber(int a,
int b) |
java.lang.Iterable<java.lang.Long> |
getEdges() |
V[] |
getVertices() |
boolean |
hasEdge(int a,
int b) |
void |
invert()
Invert all edges.
|
public UndirectedSimpleGraph(java.lang.Class<?> clazz, java.util.Collection<V> vertices)
public void addEdge(int a, int b)
addEdge
in interface UndirectedGraph<V>
public boolean hasEdge(int a, int b)
hasEdge
in interface UndirectedGraph<V>
public int getEdgeNumber(int a, int b)
public void invert()
public java.lang.Iterable<java.lang.Long> getEdges()
getEdges
in interface UndirectedGraph<V>
public V getEdgeNodeA(long edgeIndex)
getEdgeNodeA
in interface UndirectedGraph<V>
public int getEdgeNodeIndexA(long edgeIndex)
getEdgeNodeIndexA
in interface UndirectedGraph<V>
public V getEdgeNodeB(long edgeIndex)
getEdgeNodeB
in interface UndirectedGraph<V>
public int getEdgeNodeIndexB(long edgeIndex)
getEdgeNodeIndexB
in interface UndirectedGraph<V>
public V[] getVertices()
getVertices
in interface UndirectedGraph<V>