Your problem is obviously on this line:
edges[i->second.begin()] = i->second.end();
The type of the key of edges
is int
, but i->second.begin()
is returning an iterator, because i->second
returns a map. I guess you need something like:
edges[i->second.begin()->first] = i->second.end();
Depending on what information from Graph
you want to use, as you haven't told us about what the Graph
represents.