This implementation is based on doubly-linked lists, from each node the incident edges make up lists, therefore one edge can be erased in constant time. It also makes possible, that node can be removed from the underlying graph, in this case all edges incident to the given node is erased from the arc set.
This class fully conforms to the Graph concept. It provides only linear time counting for nodes, edges 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::EdgeSetExtender<ListEdgeSetBase<GR> >.
Public Member Functions | |
ListEdgeSet (const GR &graph) | |
Edge | addEdge (const Node &u, const Node &v) |
Add a new edge to the graph. | |
void | erase (const Edge &e) |
Erase an edge from the graph. |
ListEdgeSet | ( | const GR & | graph | ) | [inline] |
Constructor of the EdgeSet.
Edge addEdge | ( | const Node & | u, | |
const Node & | v | |||
) | [inline] |
Add a new edge to the graph with node u
and node v
endpoints.
void erase | ( | const Edge & | e | ) | [inline] |
Erase the edge e
from the graph.