Shortest Path Case Study
2020-1νκΈ°, λνμμ βμκ³ λ¦¬μ¦β μμ μ λ£κ³ 곡λΆν λ°λ₯Ό μ 리ν κΈμ λλ€. μ§μ μ μΈμ λ νμμ λλ€ :)
<μ΅λ¨κ²½λ‘(shortest path)>λΌλ μ£Όμ λ‘ μκ°ν΄λ³Ό μ μλ μ¬λ¬ κ²½μ°λ₯Ό μ 리ν΄λ³΄μμ΅λλ€ π
Source And Destination
- Single source and single destination shortest path problem
- Single source shortest path problem
- Single destination shortest path problem
- All pairs shortest path problem
1. Single source and single destination shortest path problem
κ°λ¨νλ€. κ·Έλ₯ <Dijkstra Algorithm>μΌλ‘ ν΄κ²°νλ©΄ λλ€ π
μ¬μ€ 2λ²μ§Έ μΌμ΄μ€μΈ βSingle source shortest path problemβλ <Dijkstra Algorithm>μ λ리면 λλ€ γ γ γ
3. Single destination shortest path problem
μ¬μ€ μ΄κ²λ <Dijkstra Algorithm>μΌλ‘ ν΄κ²° λλ€ γ γ γ κ·Έλνμ directed edgeμ λ°©ν₯μ λͺ¨λ λ°λλ‘ λ°κΎΌ ν, destinationμ μΆλ°μ μΌλ‘ μΌμμ β2. single source shortest path problemβμ νλ©΄ λλ€! π
4. All pairs shortest path problem
μ΄ λ μμ <Dijkstra Algorithm>μ΄ μλ <Floyd-Warshall Algorithm>μΌλ‘ νμ΄μΌ νλ€! DPλ‘ κ΅¬ννλ©°, μμΈν λ΄μ©μ ν¬μ€νΈλ₯Ό μ½μ΄λ³΄μ! π
(βShortest Pathμ μ μ½ μ‘°κ±΄μ΄ λ€μ΄κ° κ²½μ°βλ μΆν μΆκ° μμ π)