Apply Dijkstra's algorithm in a undirected graph with negative weights
问题 Can anyone apply Dijkstra's algorithm in the undirected graph with negative weights above? Even if the algorithm fails. Adjancency's list: A -> (B, 3), (C, 2), (D, 4) B -> (A, 3), (C, -2), (F, 6) C -> (A, 2), (B, -2), (E, 5) D -> (A, 4), (E, 3), (F, 2) E -> (C, 5), (D, 3), (F, -2) F -> (B, 6), (D, 2), (E, -2) 回答1: Seed the traversal list with source node A, and it's cost with 0. Add an infinite cost for every other node: {}, [A=0, B=inf, C=inf, D=inf, E=inf, F=inf] Then take the lowest