Class EdgeMap
An "EdgeMap" is actually a simple representation of a graph, which consists
of a set of vertices, identified by their integer-id, and edges between these
vertices. The edges are undirected.
The graph is implemented as a subclass of HashMap.
The method vertices() gives the set of all vertices stored in this data
structure. The method neighbors(i) returns the set of all neighbors of i;
these are vertices that are directly connected to i.
- Author:
- Naraenda
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
EdgeMap
public EdgeMap()
-
-
Method Details
-
put
Add the two vertices of an edge, along with its connectivity. -
remove
Remove an edge from this data structure. -
vertices
-
neighbours
-