Let us consider the well-known Dijkstra algorithm to compute the shortest path between
two nodes i and j [211]. It works by constructing a shortest path tree from the
initial node to every other node in the graph. For each node of the graph, we have to
consider all its neighbors. In the worst-case analysis, the number of neighbors for a
node is in the order of n. The Dijkstra algorithm requires O(n2) running time where n
represents the number of nodes of the graph. Then, the algorithm requires no more
than a quadratic number of steps to find the shortest path. It is a polynomial-time
algorithm.