This class is the same as ArcLookUp, with the addition that it makes it possible to find all parallel arcs between given endpoints.
GR | The type of the underlying digraph. |
#include <lemon/core.h>
Public Types | |
typedef GR | Digraph |
The Digraph type. | |
Public Types inherited from ArcLookUp< GR > | |
typedef GR | Digraph |
The Digraph type. | |
Public Member Functions | |
AllArcLookUp (const Digraph &g) | |
Constructor. More... | |
void | refresh (Node n) |
Refresh the data structure at a node. More... | |
void | refresh () |
Refresh the full data structure. More... | |
Arc | operator() (Node s, Node t, Arc prev=INVALID) const |
Find an arc between two nodes. More... | |
Public Member Functions inherited from ArcLookUp< GR > | |
ArcLookUp (const Digraph &g) | |
Constructor. More... | |
void | refresh (Node n) |
Refresh the search data structure at a node. More... | |
void | refresh () |
Refresh the full data structure. More... | |
Arc | operator() (Node s, Node t) const |
Find an arc between two nodes. More... | |
|
inline |
Constructor.
It builds up the search database, which remains valid until the digraph changes.
|
inline |
Build up the search database of node n
.
It runs in time O(d logd), where d is the number of the outgoing arcs of n
.
|
inline |
Build up the full search database. In fact, it simply calls refresh(n) for each node n
.
It runs in time O(m logD), where m is the number of the arcs in the digraph and D is the maximum out-degree of the digraph.
|
inline |
Find an arc between two nodes.
s | The source node. |
t | The target node. |
prev | The previous arc between s and t . It it is INVALID or not given, the operator finds the first appropriate arc. |
s
to t
after prev
or INVALID if there is no more.For example, you can count the number of arcs from u
to v
in the following way.
Finding the first arc take O(logd) time, where d is the number of outgoing arcs of s
. Then the consecutive arcs are found in constant time.
n
, then refresh(n) is enough.