I\'m using the path.aStar function from this Github library: https://github.com/anvaka/ngraph.path. It\'s a library which calculates the shortest path in a grap
path.aStar