Is it possible to form a table that will have simply the shortest distance from each source to destination using q learning?
If not, suggest any other learning algorithm.
Artificial Intelligence Stack Exchange is a question and answer site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment. It only takes a minute to sign up.Sign up to join this community
Welcome to AI.SE Adarsh!
This is fairly simple to do with Q-Learning.
If you assign a reward equal to -1 for each location other than the goals, and 0 for the goals, then Q-learning with no discount factor will learn the length of the shortest path from each location to the goal. Alternatively, you can use a discounting factor, and then invert the equation on the learned values of the Q function to obtain the number of steps.
Hope this helps!