Something like this (in serial):
std::vector<std::pair<std::size_t, std::size_t> > edge_pairs;
for (EdgeIterator e(mesh); !e.end(); ++e)
{
std::size_t v0 = e->entities(0)[0];
std::size_t v1 = e->entities(0)[1];
edge_pairs.push_back(std::make_pair<std::size_t, std::size_t>(v0, v1));
}
you also need to make sure the topology is initialised
mesh.init(1, 0);