eric.boissard.DeleteThis@gmail.com wrote:
> Hello,
>
> I am using A* to find the shortest path in a 3D environment, I have
> waypoints at each intersections, rooms, interesting points to create
> the graph. At the moment I can select a start and goal node, the A*
> algorithm do the rest and my character simply follows the path.
> Now I would like to modify it in order to set intermediate goals/nodes
> in the path. I want to make sure that the character pass through some
> 'mandatory' nodes before reaching the final destination. I can have
> maybe 3 or 4 intermediate destinations. The order to visit them is not
> important. Is there a simple way to do that ? One solution would be to
> calculate the cost of each 'intermediate' paths and combine them in
> order to get the shortest path to the 'final' goal. Is there a way to
> simply 'tweak' the A* algorithm ? Thanks for your help
Unfortunately, no. Best bet, based on the criteria given, is to:
1-Build paths from Start to all waypoints
2-Build paths from all waypoints to Goal
3-Build paths from all waypoints to all waypoints,
meaning doing both Point1 to Point2 and Point2 to Point1
(the paths will most likely be different)
4-Select a total path from the permutations, not to bad,
4 waypoints is only 4! or 24 paths to be considered and
4+4+12=20 paths to be calculated and if more than one
of the waypoints are fixed you could always precalc those
particular paths.
--
Geoff
>> Stay informed about: A* and multi-goals