0

I have a Dictionary that contains this :

grid =  {
 (6, 7): 'cheese',
 (9, 2): 'cheese',
 (0, 2): 'mouse',
 (9, 1): 'cat'
}

My starting coordinate is : (9,1) and destination is : (0,2). I want to use BSF and DSF to calculate shortest path using both methodologies so that cat can eat mouse before mouse eats all cheese. Mouse's part to eat cheese is done using euclidean distance to find the nearest cheese .

But i am not sure how to perform BFS and DFS to find best next move for my cat to move in order to catch mouse.

Do i need to change my Grid's data structure , i know about BFS , DFS but i am not sure how to implement them in grid

Joy
  • 145
  • 2
  • 9
  • 1
    Can you provide more information? Like how the cat and mouse gonna move? Whose start coordinate is that? Mouse or Cat? – Ahmad Faiyaz Feb 20 '20 at 12:00
  • The objetive of the game is determine a move-set for the Cat, in suh a way that the Mouse does not eat all the cheese on the board. The less cheese eaten, the better.Mouse will move toward cheese that is close to him , but i only have to worry about cat movement. `grid` dictionary contain latest coordinates where obj is present. i need to apply from my starting point (cat's position) to destination point(mouse position) and will take only one step toward mouse.On the other hand mouse will move one step ahead towards closest cheese – Joy Feb 20 '20 at 12:12
  • And I have to apply both BFS and DFS separately to find best next move.Total Board Size is 10 x 10 – Joy Feb 20 '20 at 12:14

0 Answers0