Shortest distance between two vertices

algorithmsdiscrete mathematicsgraph theory

In the graph, we have to find the shortest distance between Newark and Cape May. I have tried using the Dijkstra algorithm but I can't seem to figure out how it would work. According to my working, the distance is coming out to be 175 whereas it should be 85.

graph

Best Answer

Djikstra's algorithm gives Newark-Woodbridge-Camden-Cape May with a distance of $165$.

I suspect that your error was to permanently box Atlantic City (on $130$) before you had boxed Camden (on $80$).

Related Question