There is a Dijkstra's algorithm. I want to generate graph with given |E|
and |V|
, in which the algorithm perform maximum number of relaxations: alt ← dist[u] + length(u, v)
.
This is a ACM problem
. But I have no idea how to solve it. I look forward to any ideas.
Example
. Let |V| = 4
and |E| = 3
. Than, I looking for a graph with the following edges and weight (v1, v2, w
):
(1, 2, 0)
(1, 3, 1
)
(1, 4, 2
)