Talk:A* search algorithm: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
No edit summary
Line 9: Line 9:
How would one show a path that   ''moves into''   a barrier?   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:42, 29 January 2017 (UTC)
How would one show a path that   ''moves into''   a barrier?   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:42, 29 January 2017 (UTC)


:While A* does not evaluate every possible move, it does internally check the cost of moving into a barrier square. For this reason, the cost of moving into a barrier square is required. However, there is always a lower cost alternative while still moving in the correct direction (according to the heuristic), it should never actually be part of the maze solution.
:While A* does not evaluate every possible move, it does internally check the cost of moving into a barrier square. For this reason, the cost of moving into a barrier square is required. However, there is always a lower cost alternative while still moving in the correct general direction (according to the heuristic), it should never actually be part of the maze solution.


:As you pointed out, the method for showing a path that moves into a barrier is left undefined. However, it should not be part of the a* solution so any method would be fine.--[[User:TimSC|TimSC]] ([[User talk:TimSC|talk]]) 16:58, 29 January 2017 (UTC)
:As you pointed out, the method for showing a path that moves into a barrier is left undefined. However, it should not be part of the a* solution so any method would be fine.--[[User:TimSC|TimSC]] ([[User talk:TimSC|talk]]) 16:58, 29 January 2017 (UTC)

Revision as of 16:59, 29 January 2017

moving into a barrier position

How does a path   move into   a barrier position?

I see that none of the programming examples show a path (so far) that "moves into" a barrier,
else we'd be seeing a total cost for a path that exceeds   100.

Does there need to be a cost when "moving into" a barrier, since no path has (apparently) done that?

How would one show a path that   moves into   a barrier?   -- Gerard Schildberger (talk) 16:42, 29 January 2017 (UTC)

While A* does not evaluate every possible move, it does internally check the cost of moving into a barrier square. For this reason, the cost of moving into a barrier square is required. However, there is always a lower cost alternative while still moving in the correct general direction (according to the heuristic), it should never actually be part of the maze solution.
As you pointed out, the method for showing a path that moves into a barrier is left undefined. However, it should not be part of the a* solution so any method would be fine.--TimSC (talk) 16:58, 29 January 2017 (UTC)

grid orientation

It would seem that some programming examples are using a non-standard orientation of the
grid display,   with the   (0,0)   origin point in the   top-left   of the display area,   with positive
values for   X   (columns)   going downward,   instead of   going upward.

For me, it doesn't make me no never-mind no-how, but it took a wee bit of fixin' for my
programming example   (not yet posted)   to match the existing displayed grids.   -- Gerard Schildberger (talk) 16:42, 29 January 2017 (UTC)