2020-1ν•™κΈ°, λŒ€ν•™μ—μ„œ β€˜μ•Œκ³ λ¦¬μ¦˜β€™ μˆ˜μ—…μ„ λ“£κ³  κ³΅λΆ€ν•œ λ°”λ₯Ό μ •λ¦¬ν•œ κΈ€μž…λ‹ˆλ‹€. 지적은 μ–Έμ œλ‚˜ ν™˜μ˜μž…λ‹ˆλ‹€ :)

1 minute read

2020-1ν•™κΈ°, λŒ€ν•™μ—μ„œ β€˜μ•Œκ³ λ¦¬μ¦˜β€™ μˆ˜μ—…μ„ λ“£κ³  κ³΅λΆ€ν•œ λ°”λ₯Ό μ •λ¦¬ν•œ κΈ€μž…λ‹ˆλ‹€. 지적은 μ–Έμ œλ‚˜ ν™˜μ˜μž…λ‹ˆλ‹€ :)

<μ΅œλ‹¨κ²½λ‘œ(shortest path)>λΌλŠ” 주제둜 생각해볼 수 μžˆλŠ” μ—¬λŸ¬ 경우λ₯Ό μ •λ¦¬ν•΄λ³΄μ•˜μŠ΅λ‹ˆλ‹€ 😎


Source And Destination

  1. Single source and single destination shortest path problem
  2. Single source shortest path problem
  3. Single destination shortest path problem
  4. 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에 μ œμ•½ 쑰건이 λ“€μ–΄κ°„ κ²½μš°β€λŠ” μΆ”ν›„ μΆ”κ°€ μ˜ˆμ • 🎈)

Categories:

Updated: