G | The type of the underlying graph. |
#include <lemon/graph_utils.h>
Public Member Functions | |
AllEdgeLookUp (const Graph &g) | |
Constructor. | |
void | refresh (Node n) |
Refresh the data structure at a node. | |
void | refresh () |
Refresh the full data structure. | |
Edge | operator() (Node s, Node t, Edge prev=INVALID) const |
Find an edge between two nodes. |
AllEdgeLookUp | ( | const Graph & | g | ) | [inline] |
Constructor.
It builds up the search database, which remains valid until the graph changes.
void refresh | ( | Node | n | ) | [inline] |
Build up the search database of node n
.
It runs in time O(dlogd), where d is the number of the outgoing edges of n
.
Reimplemented from EdgeLookUp< G >.
void refresh | ( | ) | [inline] |
Build up the full search database. In fact, it simply calls refresh(n) for each node n
.
It runs in time O(mlogD), where m is the number of the edges of n
and D is the maximum out-degree of the graph.
Reimplemented from EdgeLookUp< G >.
Edge operator() | ( | Node | s, | |
Node | t, | |||
Edge | prev = INVALID | |||
) | const [inline] |
Find an edge between two nodes.
s | The source node | |
t | The target node | |
prev | The previous edge between s and t . It it is INVALID or not given, the operator finds the first appropriate edge. |
s
to t
after prev
or INVALID if there is no more.u
to v
in the following way. AllEdgeLookUp<ListGraph> ae(g); ... int n=0; for(Edge e=ae(u,v);e!=INVALID;e=ae(u,v,e)) n++;
Finding the first edge take O(logd) time, where d is the number of outgoing edges of s
. Then, the consecutive edges are found in constant time.
n
, then refresh(n) is enough.