Dijkstra's algorithm finds the shortest path from one selected point to all the others. It is defined for a graph (directional or not) with non-negative edges. There is no faster algorithm for this case.
If there are restrictions on the weight of the edges - there may be a faster algorithm. For example, if the balance is limited [0,1] - the BFS algorithm can be used.
This can be generalized to the case with integer weights, you can also use a faster algorithm. (i.e., instead of using a binary search tree, you can use a limited set of arrays).
source share