-// We assume we have marked the graph, as in getPath(). We also
-// assume that we have done so in such a way as to guarantee a
-// marked path from "from" to "to".
-// We then start at "to" and find the arrow leading to it that
-// has been marked. We add that to the path we are constructing,
-// step back on that arrow, and continue the process (i.e., recurse).
-void Graph::getMarkedPath(int from, int to, EdgePath & path) {
- if (from == to) {
- reverse(path.begin(), path.end());
- return;
- }
- // find marked in_arrow
- vector<Arrow *>::const_iterator it = vertices_[to].in_arrows.begin();
- vector<Arrow *>::const_iterator en = vertices_[to].in_arrows.end();
- for (; it != en; ++it)
- if ((*it)->marked)
- break;
- if (it == en) {
- LASSERT(false, /* */);
- return;
- }
- int const newnode = (*it)->from;
- path.push_back(newnode);
- getMarkedPath(from, newnode, path);
-}
-
-