This implementation is based on doubly-linked lists, from each node the outgoing and the incoming arcs make up lists, therefore one arc can be erased in constant time. It also makes possible, that node can be removed from the underlying graph, in this case all arcs incident to the given node is erased from the arc set.
This class fully conforms to the Digraph concept. It provides only linear time counting for nodes and arcs.
GR | The type of the graph which shares its node set with this class. Its interface must conform to the Digraph or Graph concept. |
#include <lemon/edge_set.h>
Inherits lemon::ArcSetExtender<ListArcSetBase<GR> >.
Public Member Functions | |
ListArcSet (const GR &graph) | |
Arc | addArc (const Node &s, const Node &t) |
Add a new arc to the digraph. | |
void | erase (const Arc &a) |
Erase an arc from the digraph. |
ListArcSet | ( | const GR & | graph | ) | [inline] |
Constructor of the ArcSet.
Arc addArc | ( | const Node & | s, | |
const Node & | t | |||
) | [inline] |
Add a new arc to the digraph with source node s
and target node t
.
void erase | ( | const Arc & | a | ) | [inline] |
Erase an arc a
from the digraph.