0

I'm implement bidirectional A* search for pacman food search problem using the Berkeley AI Materials. Can we apply the bidirectional A* search to this problem as it has multiple goal states (multiple food)?

I tried to implement a new problem in the searchAgents.py. The state of the forward search is <position_of_pacman, list_of_food_left_in_the_maze> and the state of the backward search is <food_position, list_of_food_visited>. When the forward search and backward search meet at the same node (, list_of_food_left_in_the_maze = list_of_food_visited), it terminates the search. Does it sound good?

1 Answers1

0

Any algorithm that works for one goal can be extended to work for multiple goals by adding a new "goal" node and connecting all the actual goals to it with cost 0.

For the heuristic h(x) for the new node, you can use min(h(goal1), h(goal2), ...)

BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283