The following Graph member functions are defined for insertion and removal of Vertex and Edge components in both the generic and user-derived Graph types:
int insert(Vertex* v); int insert(Edge* e); int remove(Vertex* v); int remove(Edge* e);
In our example, for a Module m and Transport_Time t, the following operations are legal:
widget.insert(&m); widget.remove(&t); etc.
The Graph is not changed and the return value is false if any of the following three conditions exist:
Note that removing a Vertex or Edge from a Graph does not destroy it; likewise, inserting a Vertex or Edge into a Graph does not create it: static or dynamic creation of Vertices and Edges must take place prior to insertion into the Graph.