This agent allows the user to remove an edge from the graph.
void Graph::removeEdge(Gedge *edge)
{
GedgePtrBagManip edgeMan(&d_edges);
while(edgeMan){
if(edgeMan()==edge){
edge->to()->remove(edge);
edge->from()->remove(edge);
edgeMan.remove();
}
else{
edgeMan.advance();
}
}
}
The logic is similar to that used in the removal of node and we shall just hit the highlights of the analysis for this time. The GedgePtrBagManip object edgeMan is constructed using the following code: