Skip to content

๐Ÿ” 2022 ICNCT ๊ตญ์ œํ•™์ˆ ๋Œ€ํšŒ ์ฐธ์—ฌ - Find the Midpoint of Multiple Vertices using Dijkstra Algorithm

Notifications You must be signed in to change notification settings

four-silver/find-a-midpoint-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

70 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Find the Midpoint of Multiple Vertices using Dijkstra Algorithm

๐Ÿ” 2022 ICNCT ๊ตญ์ œํ•™์ˆ ๋Œ€ํšŒ ์ฐธ์—ฌ

์š”์•ฝ

ํƒ€๋‹นํ•œ ์ค‘๊ฐ„ ์ง€์ ์„ ์„ ํƒํ•˜๋Š” ๊ฒƒ์€ ์ด๋™ ๋ฐ ์†ก์ˆ˜์‹ ์˜ ํšจ์œจ์„ฑ ์ธก๋ฉด์—์„œ ์ค‘์š”ํ•˜๋‹ค. ๋”ฐ๋ผ์„œ ๋ณธ ๋…ผ๋ฌธ์—์„œ๋Š” ๊ทธ๋ž˜ํ”„์—์„œ ์ž…๋ ฅ๋œ ์—ฌ๋Ÿฌ ๋…ธ๋“œ์˜ ์ค‘๊ฐ„ ์ง€์ ์„ ๊ตฌํ•˜๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ œ์•ˆํ•œ๋‹ค. ์ค‘๊ฐ„์ง€์ ์€ โ€˜์ž…๋ ฅ ๋…ธ๋“œ์—์„œ ๋™์‹œ์— ์ถœ๋ฐœํ•˜์˜€์„ ๋•Œ ๊ฐ€์žฅ ๋นจ๋ฆฌ ๋งŒ๋‚˜๋Š” ์ โ€™์œผ๋กœ ์ •์˜ํ•œ๋‹ค. ํšจ์œจ์ ์ธ ํƒ์ƒ‰์„ ์œ„ํ•ด ํƒ์ƒ‰ ๋ฒ”์œ„๋ฅผ ์ œํ•œํ•˜๊ณ  ํ•ด๋‹น ๋ฒ”์œ„ ์•ˆ์—์„œ ์ค‘๊ฐ„ ์ง€์ ์„ ์„ ํƒํ•œ๋‹ค. ํ•ด๋‹น ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ๋ชจ์˜ ์‹คํ—˜์„ ํ†ตํ•ด ์ค‘๊ฐ„ ์ง€์ ์˜ ํƒ€๋‹น์„ฑ์„ ์ฆ๋ช…ํ•˜์˜€๋‹ค.

1. ํƒ์ƒ‰๋ฒ”์œ„ ์ œํ•œ

์ž…๋ ฅ ๋…ธ๋“œ๋งˆ๋‹ค ๊ฐ€์žฅ ๋จผ ๋‹ค๋ฅธ ์ž…๋ ฅ ๋…ธ๋“œ๊นŒ์ง€์˜ ์ตœ๋‹จ ๊ฑฐ๋ฆฌ ์•ˆ์— ์žˆ๋Š” ๋…ธ๋“œ๋“ค์„ ํ•ด๋‹น ์ž…๋ ฅ ๋…ธ๋“œ์˜ ํƒ์ƒ‰๋ฒ”์œ„๋กœ ์„ค์ •ํ•œ๋‹ค. ๋ชจ๋“  ์ž…๋ ฅ ๋…ธ๋“œ์˜ ํƒ์ƒ‰ ๋ฒ”์œ„๋ฅผ ๊ตฌํ–ˆ๋‹ค๋ฉด, ํƒ์ƒ‰ ๋ฒ”์œ„๋“ค์˜ ๊ต์ง‘ํ•ฉ์„ ์ตœ์ข… ํƒ์ƒ‰ ๋ฒ”์œ„๋กœ ์„ค์ •ํ•œ๋‹ค.

image

2. ์ค‘๊ฐ„ ์ง€์  ์ฐพ๊ธฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜

์ค‘๊ฐ„ ์ง€์ ์€ ์ž…๋ ฅ๋…ธ๋“œ์—์„œ ๋™์‹œ์— ์ถœ๋ฐœํ•˜์˜€์„ ๋•Œ ๊ฐ€์žฅ ๋นจ๋ฆฌ ๋งŒ๋‚˜๋Š” ์ ์œผ๋กœ ์ •์˜ํ•œ๋‹ค. ํ•œ ์ •์ ์—์„œ ๋ชจ๋“  ์ž…๋ ฅ ๋…ธ๋“œ๊นŒ์ง€์˜ ์ตœ๋‹จ ๊ฑฐ๋ฆฌ ์ค‘ ์ตœ๋Œ“๊ฐ’์„ ์†Œ์š”์‹œ๊ฐ„์ด๋ผ๊ณ  ์ •์˜ํ•˜๊ณ , ์†Œ์š”์‹œ๊ฐ„์ด ์ตœ์†Œ์ธ ์ •์ ์ด ์ค‘๊ฐ„์ง€์ ์ด๋‹ค.

  • $durations=maxโก( distance(i)), i=inputnode, exploration\underline{ }range:all\underline{ }node$
  • $candidate\underline{ }midpoints=vertex(minโก( durations))$
  • $midpoint = vertex(min(sum(distance(i))), i = inputnode, exploration\underline{ }range:candidate\underline{ }midpoints$

3. ์‹œ๋ฎฌ๋ ˆ์ด์…˜

์—ญ ๊ฐ„์˜ ์—ฐ๊ฒฐ์„ฑ ๋ฐ ์—ญ ๊ฐ„ ์ด๋™ ์‹œ ์†Œ์š”์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•ด ์—ฌ๋Ÿฌ ์‹คํ—˜์„ ์ง„ํ–‰ํ•˜์—ฌ ํƒ€๋‹น์„ฑ์„ ์ฆ๋ช…ํ•˜์˜€๋‹ค. ๋˜ํ•œ SPFA์™€ DFS์™€์˜ ๋น„๊ต๋ฅผ ํ†ตํ•ด ํšจ์œจ์„ฑ์„ ์ฆ๋ช…ํ•˜์˜€๋‹ค.

About

๐Ÿ” 2022 ICNCT ๊ตญ์ œํ•™์ˆ ๋Œ€ํšŒ ์ฐธ์—ฌ - Find the Midpoint of Multiple Vertices using Dijkstra Algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages