κ·Έλž˜ν”„ μ•Œκ³ λ¦¬μ¦˜Advanced

벨만-ν¬λ“œ μ•Œκ³ λ¦¬μ¦˜

음수 κ°€μ€‘μΉ˜λ₯Ό μ²˜λ¦¬ν•˜κ³  음수 μˆœν™˜μ„ κ°μ§€ν•˜λŠ” 단일 μ†ŒμŠ€ μ΅œλ‹¨ 경둜 μ•Œκ³ λ¦¬μ¦˜μž…λ‹ˆλ‹€. λͺ¨λ“  간선을 V-1번 μ™„ν™”ν•˜μ—¬ 음수 κ°€μ€‘μΉ˜μ—λ„ μ •ν™•ν•œ 거리λ₯Ό 보μž₯ν•©λ‹ˆλ‹€. 톡화 차읡 거래 감지, λ‹€μ–‘ν•œ λΉ„μš©μ˜ λ„€νŠΈμ›Œν¬ λΌμš°νŒ…, λ‹€μ΅μŠ€νŠΈλΌ μ•Œκ³ λ¦¬μ¦˜μ΄ μ‹€νŒ¨ν•˜λŠ” 상황에 ν•„μˆ˜μ μž…λ‹ˆλ‹€. 속도λ₯Ό μœ μ—°μ„±κ³Ό κ΅ν™˜ν•©λ‹ˆλ‹€.

#graph#shortest-path#negative-weights#dynamic-programming

Complexity Analysis

Time (Average)

O(V Γ— E)

Expected case performance

Space

O(V)

Memory requirements

Time (Best)

O(V Γ— E)

Best case performance

Time (Worst)

O(V Γ— E)

Worst case performance

πŸ“š CLRS Reference

Introduction to Algorithmsβ€’Chapter 24β€’Section 24.1

Loading...

Implementation

Bellman-Ford Algorithm - Algorithm Vision