CSES - Bellman–Ford algorithm

Test the operation of the Bellman-Ford algorithm given in the course material using a graph constructed as follows:

  • The nodes are 1,2,,N1,2,\dots,N and N=5000N=5000.
  • The start node is the node 11.
  • There is an edge from a node aa to a node bb, if a<ba<b and ba<10b-a<10.
  • The weight of each edge is a random number in the range 110001 \dots 1000.
  • The edges are in a random order on the edge list.

How much time did the execution take? s

The code you used in the test: