Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
Simpler BFS solution for 2 chess players problem | Reply
For the BFS example, 1000 from Division 1 in SRM 156

There seems to be a simpler (and faster?) solution here:

Step 1, suppose only one player can move (say X moves, Y doesn’t), find the shortest path (from X to Y) using BFS;
Step 2, now let X & Y both move from each end of the shortest path. when they become neighbour, X & Y do a swap and move further along the path.

Jackie (