Beispiel #1
0
// Write a function delete_edge( g, u, v ) that uses v.erase with
// std::find to delete an edge from the edge_list
inline void delete_edge( edge_list& g, vertex_id u, vertex_id v )
{
    edge e(u,v);
    std::pair<edge_list::iterator,edge_list::iterator> p
        = std::equal_range( g.begin(), g.end(), e );
    g.erase( p.first, p.second );
}
Beispiel #2
0
inline void delete_self_loops( edge_list& g )
{
    for ( edge_list::iterator p = g.begin(), e = g.end(); p != e; ++p )
        if ( p->first == p->second )
            p = g.erase(p);
}