Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
๐ ๋ฌธ์ ๋งํฌ
โ๏ธ ์์๋ ์๊ฐ
20๋ถ
โจ ์๋ ์ฝ๋
์๋ ์ฝ๋
์ด๋ฒ ๋ฌธ์ ๋ ๋ชจ๋ ์ ์ ์ ๊ฐ์ ์ต๋จ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ๋ ํ๋ก์ด๋-์์ (Floyd-Warshall) ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํ๋ ๋ํ์ ์ธ ๋ฌธ์ ์ ๋๋ค.
์ฐ๋ฆฌ๊ฐ ๊ฐ์ฅ ๋ณดํธ์ ์ผ๋ก ์ต๋จ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ๋ ๋ฐฉ๋ฒํ๊ณ ๋น์ทํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
ํ๋ก์ด๋-์์ ์๊ณ ๋ฆฌ์ฆ
๋ค์ต์คํธ๋ผ๋ ํ๋์ ์ ์ ์์ ๋ค๋ฅธ ๋ชจ๋ ์ ์ ๊น์ง์ ์ต๋จ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ๋ ์๊ณ ๋ฆฌ์ฆ์ด์๋ค๋ฉด, ํ๋ก์ด๋-์์ ์๊ณ ๋ฆฌ์ฆ์ ํ ๋ฒ ์คํํ์ฌ ๋ชจ๋ ๋ ธ๋ ๊ฐ ์ต๋จ ๊ฒฝ๋ก๋ฅผ ๊ตฌํ ์ ์์ต๋๋ค.
์ด๋ ํ๋ก์ด๋-์์ ์๊ณ ๋ฆฌ์ฆ์ด ๋์ ๊ณํ๋ฒ์ ๊ธฐ๋ฐ์ผ๋ก ํ๋ ์ต๋จ ๊ฒฝ๋ก ์๊ณ ๋ฆฌ์ฆ์ด๊ธฐ ๋๋ฌธ์ ๋๋ค.
gif ์ถ์ฒ : [์๊ณ ๋ฆฌ์ฆ] Floyd-Warshall Algorithm : ํ๋ก์ด๋ ์์ ์๊ณ ๋ฆฌ์ฆ์ด๋?
์ฝ๋์์ ์ฝ๊ฒ ์ด ์๊ณ ๋ฆฌ์ฆ์ ๋ฐ๋ผ๋ณผ ์ ์์ต๋๋ค.
๋๊ฒ ์ง๊ด์ ์ด์ฃ ?
"i์์ j๋ก ์ง์ ๊ฐ๋ ๊ฒ vs k๋ฅผ ๊ฑฐ์ณ์ ๊ฐ๋ ๊ฒ ์ค ๋ ์งง์ ๊ฒฝ๋ก๋ก ์ ๋ฐ์ดํธ" ํ๋ ๊ณผ์ ์ ๋ชจ๋ ๊ฐ๋ฅํ ๊ฒฝ์ ์ ์ ๋ํด ๋ฐ๋ณตํ๋ ์ฝ๋์ ๋๋ค.
์ผ์ค ๋ฐ๋ณต๋ฌธ์ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ์๊ฐ๋ณต์ก๋๊ฐ ์ปค์ ธ์ ํฐ ๊ทธ๋ํ์์๋ ์ฌ์ฉํ๊ธฐ ํ๋ค๋ค๋ ๋จ์ ์ด ์๊ธฐ๋ ํฉ๋๋ค.
ํ๋ก์ด๋-์์ ์๊ณ ๋ฆฌ์ฆ์ ์จ๋ด๋ผ~! ํ๋ ๋ฌธ์ ์ด๊ธฐ ๋๋ฌธ์
์๊ณ ๋ฆฌ์ฆ์ ๋ฐฐ์ด ์ฝ๋๋ฅผ ๊ฑฐ์ ๊ทธ๋๋ก ์ฌ์ฉํด๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.
๐ ์๋กญ๊ฒ ์๊ฒ๋ ๋ด์ฉ
ํ๋ก์ด๋-์์ vs ๋ค์ต์คํธ๋ผ: