Add definition of the shortest path algorithm