(requires constant-time multiplication) from <a href="https://en.wikipedia.org/wiki/Shortest_path_problem#Single-source_shortest_paths" rel="nofollow">https://en.wikipedia.org/wiki/Shortest_path_problem#Single-s...</a>