Re: [請益] 街道型的Two Shortest Path
看板Prob_Solve (計算數學 Problem Solving)作者yauhh (喲)時間14年前 (2010/05/09 02:28)推噓9(9推 0噓 33→)留言42則, 4人參與討論串4/7 (看更多)
※ 引述《MrGG (頭有點痛)》之銘言:
: ╔═══╦═══╦═══╦═D═╗
: ║ ║ ║ ║ ║
: ║ ║ ║ ║ ║
: ║ ║ ║ ║ ║
: ╠═══╬═══╬═══╬═══╣
: ║ ║ ║ ║ ║
: ║ ║ ║ ║ ║
: ║ ║ ║ ║ ║
: ╠═══╬═══╬═══╬═══╣
: ║ ║ ║ ║ ║
: ║ ○ ║ ║ ║
: ║ ║ ║ ║ ║
: ╠S→→→═○═╬═══╬═══╣
: ║ ║ ║ ║ ║
: ║ X ║ ║ ║
: ║ ║ ║ ║ ║
: ╚═══╩═══╩═══╩═══╝
: 假設現在由S走到D,
: 當在第一個路口的時候,我可以選擇○兩條路徑行走(最短路徑)
: 因此,此時會有兩種情境,暫定Case1和Case2
: 如果走X的話,則會繞遠路
這沒有可煩惱的. 路網表達為圖就是
.----.----.----.-.--.
| | | | D |
.----.----.----.----.
| | | | |
.----.----.----.----.
| | | | |
.-.--.----.----.----.
| S | | | |
.----.----.----.----.
固定路段權重都一樣, S與D局部路段用內插法分配權重,
然後用一般的選路法,選就對了.
繞路這種事,在選路法中會自動避開.
而如果你想的是人的選擇,就是另外一個比較複雜的問題了.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.160.209.141
推
05/09 02:32, , 1F
05/09 02:32, 1F
→
05/09 02:32, , 2F
05/09 02:32, 2F
→
05/09 02:43, , 3F
05/09 02:43, 3F
→
05/09 02:45, , 4F
05/09 02:45, 4F
→
05/09 02:46, , 5F
05/09 02:46, 5F
推
05/09 02:47, , 6F
05/09 02:47, 6F
推
05/09 02:49, , 7F
05/09 02:49, 7F
→
05/09 02:49, , 8F
05/09 02:49, 8F
→
05/09 02:49, , 9F
05/09 02:49, 9F
→
05/09 02:49, , 10F
05/09 02:49, 10F
→
05/09 02:50, , 11F
05/09 02:50, 11F
→
05/09 02:51, , 12F
05/09 02:51, 12F
→
05/09 02:51, , 13F
05/09 02:51, 13F
推
05/09 02:56, , 14F
05/09 02:56, 14F
→
05/09 02:57, , 15F
05/09 02:57, 15F
→
05/09 02:59, , 16F
05/09 02:59, 16F
→
05/09 03:00, , 17F
05/09 03:00, 17F
→
05/09 03:00, , 18F
05/09 03:00, 18F
→
05/09 03:04, , 19F
05/09 03:04, 19F
→
05/09 03:05, , 20F
05/09 03:05, 20F
推
05/09 03:10, , 21F
05/09 03:10, 21F
→
05/09 03:10, , 22F
05/09 03:10, 22F
推
05/09 06:28, , 23F
05/09 06:28, 23F
→
05/09 10:37, , 24F
05/09 10:37, 24F
→
05/09 10:38, , 25F
05/09 10:38, 25F
→
05/09 10:40, , 26F
05/09 10:40, 26F
推
05/09 10:40, , 27F
05/09 10:40, 27F
→
05/09 10:40, , 28F
05/09 10:40, 28F
推
05/09 10:42, , 29F
05/09 10:42, 29F
→
05/09 10:43, , 30F
05/09 10:43, 30F
→
05/09 10:44, , 31F
05/09 10:44, 31F
→
05/09 10:45, , 32F
05/09 10:45, 32F
→
05/09 10:45, , 33F
05/09 10:45, 33F
→
05/09 10:48, , 34F
05/09 10:48, 34F
→
05/09 10:48, , 35F
05/09 10:48, 35F
→
05/09 10:49, , 36F
05/09 10:49, 36F
→
05/09 10:49, , 37F
05/09 10:49, 37F
推
05/09 11:01, , 38F
05/09 11:01, 38F
→
05/09 11:03, , 39F
05/09 11:03, 39F
→
05/09 11:04, , 40F
05/09 11:04, 40F
→
05/09 11:05, , 41F
05/09 11:05, 41F
→
05/09 11:05, , 42F
05/09 11:05, 42F
討論串 (同標題文章)
Prob_Solve 近期熱門文章
PTT數位生活區 即時熱門文章