Edge Mutable Graph
The Edge Mutable Graph concept defines the interface for a graph that supports the addition and removal of edges.
Valid Expressions
-
add_edge(u, v, g)returnsstd::pair<edge_descriptor, bool>
Semantics: Try to insert the edge (u,v) into the graph, returning the inserted edge or a parallel edge and a flag that specifies whether an edge was inserted. This operation must not invalidate vertex descriptors or vertex iterators of the graph, though it may invalidate edge descriptors or edge iterators.
Preconditions: u and v are vertices in the graph.
Postconditions: (u,v) is in the edge set of the graph. The returned edge descriptor will have u in the source position and v in the target position. If the graph allows parallel edges, then the returned flag is alwaystrue. If the graph does not allow parallel edges, if (u,v) was already in the graph then the returned flag isfalse. If (u,v) was not in the graph then the returned flag istrue.+ * `remove_edge(u, v, g)` *returns* `void` + + *Semantics:* Remove the edge _(u,v)_ from the graph. If the graph allows parallel edges this removes all occurrences of _(u,v)_. + *Precondition:* _(u,v)_ is in the edge set of the graph. + *Postcondition:* _(u,v)_ is no longer in the edge set of the graph. +
+ * `remove_edge(e, g)` *returns* `void` + + *Semantics:* Remove the edge _e_ from the graph. + *Precondition:* _e_ is an edge in the graph. + *Postcondition:* _e_ is no longer in the edge set for `g`. +
+ * `clear_vertex(u, g)` *returns* `void` + + *Semantics:* Remove all edges to and from vertex _u_ from the graph. + *Precondition:* _u_ is a valid vertex descriptor of `g`. + *Postconditions:* _u_ does not appear as a source or target of any edge in `g`.