JOIN
 Select a Forum     Round Tables New Member Discussions News Discussions Algorithm Matches Marathon Matches NASA Tournament Lab TopCoder Cookbook High School Matches Sponsor Discussions Development Forums Design Forums Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings View: Flat (newest first)  | Threaded  | Tree Previous Thread  |  Next Thread Forums Tutorial Discussions Introduction to graphs and their data structures Simpler BFS solution for 2 chess players problem
 Simpler BFS solution for 2 chess players problem | Reply For the BFS example, 1000 from Division 1 in SRM 156There 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 (jwang373@hotmail.com)
 Forums Tutorial Discussions Introduction to graphs and their data structures Simpler BFS solution for 2 chess players problem Previous Thread  |  Next Thread