Код: Выделить всё
for (auto v : boost::make_iterator_range(vertices(fg)))
{
// Extract a shortest path
typedef std::vector PathType;
PathType path;
vertex_t vv = v;
for(vertex_t u = predecessors[vv];
u != vv; // Keep tracking the path until we get to the source
vv = u, u = predecessors[vv]
) // Set the current vertex to the current predecessor, and the predecessor to one level up
{
// this is the problem. Need to pull the correct edge out of the graph using predecessor map
std::pair edgePair = boost::edge(u, vv, fg);
edge_t edge = edgePair.first;
path.push_back( edge );
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... ected-in-g
Мобильная версия