Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
上記の負の重みを持つ無向グラフにダイクストラのアルゴリズムを適用できる人はいますか? アルゴリズムが失敗したとしても。
隣接リスト:
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)