Bellman-Ford O(n²) alg running perfectly for any n