Okay, so you need to do two things at once - navigate within a maze and visit a list of arbitrary destinations.
So, use an function that works out the number of steps from one place in the maze to another.
Now, use the results of that function to assess the distance from your position to each of the destinations. After you've decided on the best destination to visit next, you trace the path used in the distance function to get to your destination. Repeat until all destinations have been visited.
Please, please, PLEASE - read this page: Tips to getting better answers in forums