MutableNetwork that supports both directed and undirected
graphs. Instances of this class should be constructed with NetworkBuilder.
Time complexities for mutation methods are all O(1) except for removeNode(N node),
which is in O(d_node) where d_node is the degree of node.
| Access | Constructor and Description |
|---|---|
| pack-priv | StandardMutableNetwork(NetworkBuilder<? super N, ? super E> builder)
Constructs a mutable graph with the properties specified in |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addEdge(N nodeU, N nodeV, E edge)
Implements com. edge connecting nodeU to nodeV.
|
| public boolean | addEdge(EndpointPair<N> endpoints, E edge)
Implements com. edge connecting endpoints.
|
| public boolean | addNode(N node)
Implements com. node if it is not already present.
|
| private NetworkConnections | |
| private NetworkConnections | |
| public boolean | removeEdge(E edge)
Implements com. edge from this network, if it is present.
|
| public boolean | removeNode(N node)
Implements com. node if it is present; all edges incident to node will also be removed.
|
| StandardMutableNetwork | back to summary |
|---|---|
| pack-priv StandardMutableNetwork(NetworkBuilder<? super N, ? super E> builder) Constructs a mutable graph with the properties specified in | |
| addEdge | back to summary |
|---|---|
| public boolean addEdge(N nodeU, N nodeV, E edge) Implements com. Doc from com. Adds If the graph is directed,
If If
| |
| addEdge | back to summary |
|---|---|
| public boolean addEdge(EndpointPair<N> endpoints, E edge) Implements com. Doc from com. Adds If this graph is directed, If this graph is directed,
If either or both endpoints are not already present in this graph, this method will silently
If
| |
| addNode | back to summary |
|---|---|
| public boolean addNode(N node) Implements com. Doc from com. Adds Nodes must be unique, just as
| |
| addNodeInternal | back to summary |
|---|---|
| private NetworkConnections Adds
| |
| newConnections | back to summary |
|---|---|
| private NetworkConnections | |
| removeEdge | back to summary |
|---|---|
| public boolean removeEdge(E edge) Implements com. Doc from com. Removes
| |
| removeNode | back to summary |
|---|---|
| public boolean removeNode(N node) Implements com. Doc from com. Removes
| |