private static class Graphs.TransposedNetwork<N,E> extends AbstractNetwork<N,E>
Constructor and Description |
---|
TransposedNetwork(Network<N,E> network) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<E> |
adjacentEdges(java.lang.Object edge)
Returns the edges which have an
incident node in common with
edge . |
java.util.Set<N> |
adjacentNodes(java.lang.Object node)
Returns the nodes which have an incident edge in common with
node in this network. |
boolean |
allowsParallelEdges()
Returns true if this network allows parallel edges.
|
boolean |
allowsSelfLoops()
Returns true if this network allows self-loops (edges that connect a node to itself).
|
ElementOrder<E> |
edgeOrder()
Returns the order of iteration for the elements of
Network.edges() . |
java.util.Set<E> |
edges()
Returns all edges in this network, in the order specified by
Network.edgeOrder() . |
java.util.Set<E> |
edgesConnecting(java.lang.Object nodeU,
java.lang.Object nodeV)
Returns the set of edges directly connecting
nodeU to nodeV . |
java.util.Set<E> |
incidentEdges(java.lang.Object node)
Returns the edges whose
incident nodes in this network include
node . |
EndpointPair<N> |
incidentNodes(java.lang.Object edge)
Returns the nodes which are the endpoints of
edge in this network. |
java.util.Set<E> |
inEdges(java.lang.Object node)
Returns all edges in this network which can be traversed in the direction (if any) of the edge
to end at
node . |
boolean |
isDirected()
Returns true if the edges in this network are directed.
|
ElementOrder<N> |
nodeOrder()
Returns the order of iteration for the elements of
Network.nodes() . |
java.util.Set<N> |
nodes()
Returns all nodes in this network, in the order specified by
Network.nodeOrder() . |
java.util.Set<E> |
outEdges(java.lang.Object node)
Returns all edges in this network which can be traversed in the direction (if any) of the edge
starting from
node . |
java.util.Set<N> |
predecessors(java.lang.Object node)
Returns all nodes in this network adjacent to
node which can be reached by traversing
node 's incoming edges against the direction (if any) of the edge. |
java.util.Set<N> |
successors(java.lang.Object node)
Returns all nodes in this network adjacent to
node which can be reached by traversing
node 's outgoing edges in the direction (if any) of the edge. |
asGraph, degree, inDegree, outDegree, toString
public java.util.Set<N> nodes()
Network
Network.nodeOrder()
.public java.util.Set<E> edges()
Network
Network.edgeOrder()
.public boolean isDirected()
Network
source node
to a target node
, while
undirected edges connect a pair of nodes to each other.public boolean allowsParallelEdges()
Network
UnsupportedOperationException
.public boolean allowsSelfLoops()
Network
UnsupportedOperationException
.public ElementOrder<N> nodeOrder()
Network
Network.nodes()
.public ElementOrder<E> edgeOrder()
Network
Network.edges()
.public java.util.Set<N> adjacentNodes(java.lang.Object node)
Network
node
in this network.public java.util.Set<N> predecessors(java.lang.Object node)
Network
node
which can be reached by traversing
node
's incoming edges against the direction (if any) of the edge.
In an undirected network, this is equivalent to Network.adjacentNodes(Object)
.
public java.util.Set<N> successors(java.lang.Object node)
Network
node
which can be reached by traversing
node
's outgoing edges in the direction (if any) of the edge.
In an undirected network, this is equivalent to Network.adjacentNodes(Object)
.
This is not the same as "all nodes reachable from node
by following outgoing
edges". For that functionality, see Graphs.reachableNodes(Graph, Object)
.
public java.util.Set<E> incidentEdges(java.lang.Object node)
Network
incident nodes
in this network include
node
.public java.util.Set<E> inEdges(java.lang.Object node)
Network
node
.
In a directed network, an incoming edge's EndpointPair.target()
equals node
.
In an undirected network, this is equivalent to Network.incidentEdges(Object)
.
public java.util.Set<E> outEdges(java.lang.Object node)
Network
node
.
In a directed network, an outgoing edge's EndpointPair.source()
equals node
.
In an undirected network, this is equivalent to Network.incidentEdges(Object)
.
public EndpointPair<N> incidentNodes(java.lang.Object edge)
Network
edge
in this network.public java.util.Set<E> adjacentEdges(java.lang.Object edge)
Network
incident node
in common with
edge
. An edge is not considered adjacent to itself.adjacentEdges
in interface Network<N,E>
adjacentEdges
in class AbstractNetwork<N,E>
public java.util.Set<E> edgesConnecting(java.lang.Object nodeU, java.lang.Object nodeV)
Network
nodeU
to nodeV
.
In an undirected network, this is equal to edgesConnecting(nodeV, nodeU)
.
The resulting set of edges will be parallel (i.e. have equal Network.incidentNodes(Object)
.
If this network does not allow parallel edges
, the resulting set
will contain at most one edge.