Jul-11-2019, 03:48 PM
(This post was last modified: Jul-11-2019, 03:49 PM by Gribouillis.)
It looks like a well known shortest path problem for which good algorithms are known and available in python, such as Dijkstra's algorithm. Have you done some research in this direction? Graph related python modules such as networkx have functions that compute the shortest path directly. Functions also exist in scipy. Why not use them?