I'm trying to implement Dijkstra's algorithm in order to find the shortest path between 2 points in a grid (x,y) but the problem is that I can only move up, down, right and left.
I have an ArrayList containing the x and ys of the points I need to pass on and another ArrayList of the points that are obstacles on the grid, I'm trying to write a function that returns an ArrayList of the movement needed in order to finish all the path.
In example: 1,1,1,2,3,4,1.. 1 being right 2 being left and 3 being up and finally 4 being down.
Can you please provide me with some hints and/or examples.