The algorithms will not change if you add more food. The only thing that changes is the state space. When you have only one food to eat, then you only need the x, y position of PacMan. When you have 3 dots to eat, for instance, you have to add this information into your model. You could add 3 boolean variables to indicate that Pacman has passed through the dot. Now your state space is a graph made of nodes of the following kinds:
((x,y),FALSE,FALSE,FALSE) -> state that indicates that Pacman has not eaten any food
((x,y),FALSE,TRUE,FALSE) -> state that indicates that Pacman has eaten only one food
((x,y),TRUE,TRUE,TRUE) -> this is the goal state
To solve the problem you just run the same algorithm in your new model. BFS and A* will always give you the optimal solution. The main obstacle is that when you put more food, the slower it gets to find a solution. So these algorithms won't answer in a reasonable time. You've got to think of a new way of doing this.
If you are looking to learn more about Artificial Intelligence then visit this Artificial Intelligence Course which will cover topics like Euclidean distance, Pearson Correlation Coefficient, Brute Force Algorithms, traveling salesman problem, NeuroEvolution of Augmenting Topologies, Fitness Function, Resolution Algorithm,k-nearest neighbors algorithm, Markov Model, Genetic Algorithm,deep first iterative deeping and many more.