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