I want to calculate the shortest path between 2 nodes. Each node has position like [1,2]. When i iterate over nodes using BFS i mark each node as visited and add distance from start node. When end node is found I want to call a function, pass start and end node and get shortest path
input:
[3,3], [5,6], [all visited] (output included in all visited)
desired output:
[[3,4], [3,5], [3,6], [4,6]]
How do i filter all visited to get the shortest path?