446 void astar_print_path(map<node*,node*> came_from, node* current, node *start)447 {448 node *x;449 if (came_from.find(current) == came_from.end())450 return;451 x = came_from[current];452 if (x == start) {453 printf("Start at #%s#\n", x->name.c_str());454 return;455 }456 astar_print_path(came_from, x, start);457 /* see if this is the last node on its line */458 if (x->curlink != current->curlink) {459 printf("Take #%s# to #%s#\n", lines[x->curlink].c_str(), current->name.c_str());460 }461 }#tart at #Amersham# to #Bethnal GreenLine# to #West HamLine# to #Royal Victoria# to #Becktonds Light Railway