Multigraph
This is an implementation of a directed multigraph. A graph consists of a collection of vertices connected by (directed) edges. A vertex v1 may be connected to another vertex v2 by more than one edge, which makes this a multigraph implementation. However, note that v1 and v2 can not be multiply connected by the same edge (i.e., two edges connecting v1 and v2 must not be equal to each other).
Multigraphs are not thread-safe, so they should be protected by some form of explicit synchronization if they are to be accessed by multiple threads.
Author
Mark van Gulik
Parameters
Constructors
Types
Properties
Functions
Answer whether the specified edge is present in the graph. The source and destination vertices of the edge do not have to be present in the graph; if not, the answer is simply false.
Answer whether the specified vertex is in the graph.
Answer an unmodifiable set of edges (if any) between the specified vertices. Note that subsequent changes to the graph may affect this set.
Remove an edge from the graph, doing nothing if it's not present. Answer whether the graph was changed (i.e., if the edge was present).
Remove a vertex from the graph if it was present. If it was not present then do nothing. Answer whether the graph was changed (i.e., whether the vertex was present).
Include an edge in the graph. If the edge (or an equal one) is already present, do nothing. The edge's source and destination vertices must already be present in the graph. Answer whether the graph changed (i.e., if this edge was not already present in the graph).
Add a vertex to the graph. Do nothing if the vertex is already present. Answer whether the graph was changed (i.e., whether the vertex was not already present).
Remove an edge from the graph. The edge must be present in the graph.
Remove a vertex from the graph. The vertex must be present. Remove all edges connected to or from this vertex.