๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์•Œ๊ณ ๋ฆฌ์ฆ˜

16-3๊ฐ•. ์ตœ๋‹จ๊ฒฝ๋กœ ์•Œ๊ณ ๋ฆฌ์ฆ˜ (Shortest Path Algorithm) (3)

by devshin.kr 2021. 1. 10.
728x90

์ด์ „ ๊ฐ•์ขŒ ์ฒจ๋ถ€,,

 

 

 

16-3๊ฐ•. ์ตœ๋‹จ๊ฒฝ๋กœ ์•Œ๊ณ ๋ฆฌ์ฆ˜ (Shortest Path Algorithm) (3)

 

์ด์ „ ๊ฐ•์ขŒ,,, Bellman-Ford Algo- ๋‚˜ Dijkstra Algo-๋Š” one-to-all ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด์—ˆ๋‹ค.

์ด๋ฒˆ ๊ฐ•์ขŒ์—์„œ๋Š” all-to-all ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ๋Œ€ํ•ด ๊ณต๋ถ€ํ•œ๋‹ค.

 

all-to-all ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ํ•˜๋‚˜๊ฐ€ Floyd Algorithm ํ˜น์€ Floyd-Warshall Algorithm์ด๋‹ค.

 

Floyd-Warshall ์•Œ๊ณ ๋ฆฌ์ฆ˜

- ๊ฐ€์ค‘์น˜ ๋ฐฉํ–ฅ ๊ทธ๋ž˜ํ”„ G=(V, E), V={1, 2, ..., n} (๋…ธ๋“œ๋“ค์—๋Š” 1๋ฒˆ๋ถ€ํ„ฐ n๋ฒˆ๊นŒ์ง€ ๋ฒˆํ˜ธ๊ฐ€ ๋ถ™์–ด ์žˆ๋‹ค..)

- ๋ชจ๋“  ๋…ธ๋“œ ์Œ๋“ค ๊ฐ„์˜ ์ตœ๋‹จ๊ฒฝ๋กœ์˜ ๊ธธ์ด๋ฅผ ๊ตฌํ•จ

- d์˜ k์Šน[i, j]

   ใ„ด ์ค‘๊ฐ„์— ๋…ธ๋“œ์ง‘ํ•ฉ {1, 2, ..., k}์— ์†ํ•œ ๋…ธ๋“œ๋“ค๋งŒ ๊ฑฐ์ณ์„œ ๋…ธ๋“œ i์—์„œ j๊นŒ์ง€ ๊ฐ€๋Š” ์ตœ๋‹จ๊ฒฝ๋กœ์˜ ๊ธธ์ด

 

 

 

 

 

 

www.inflearn.com/course/%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98-%EA%B0%95%EC%A2%8C/lecture/4115?tab=curriculum

 

์˜๋ฆฌํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์œ„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ฐ•์ขŒ - ์ธํ”„๋Ÿฐ

์˜๋ฆฌํ•˜๊ฒŒ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํ•  ์ˆ˜ ์žˆ๊ธฐ ์œ„ํ•œ ๊ธฐ๋ณธ ์†Œ์–‘์ธ '์•Œ๊ณ ๋ฆฌ์ฆ˜' ์„ ๋ฐฐ์šฐ๊ณ  ์‘์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์›๋‹ˆ๋‹ค. ์ดˆ๊ธ‰ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์˜จ๋ผ์ธ ๊ฐ•์˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์œ„ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ฐ•์ขŒ

www.inflearn.com

 

 

๋Œ“๊ธ€