Getting edge properties (including related vertices) from boost::adjacency_list

Viewed 5828

So, I must have gone through the Boost documentation for an hour today. I must be blind. I have, I hope, a simple question:

How do you get the corresponding vertices for an edge with boost::adjacency_list?

I have the following code which I'm trying to figure out:

typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> Graph;
typedef boost::graph_traits<Graph>::edge_iterator EdgeIterator;
typedef std::pair<EdgeIterator, EdgeIterator> EdgePair;

EdgePair ep;
for (ep = edges(g); ep.first != ep.second; ++ep.first)
{
    // Get the two vertices that are joined by this edge...
}

Anyone know how to do this?

Thanks

1 Answers
Related