[理工] 103/102交大 演算法

看板Grad-ProbAsk作者 (ananquenchana)時間7年前 (2018/11/22 15:21), 編輯推噓1(103)
留言4則, 3人參與, 7年前最新討論串1/1
https://i.imgur.com/eKNMvWG.jpg
想問一下 為何52(2)把每個邊的weight變double ,shortest path仍不變? 相較於下面這題 https://i.imgur.com/bsEHtfl.jpg
53(1)把每個邊加上一個constant c 使每邊不為負邊卻不是原本的shortest path? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.12.128.19 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1542871307.A.AD5.html

11/22 15:27, 7年前 , 1F
畫4個邊,權重分別為4、1、1、1
11/22 15:27, 1F

11/22 15:28, 7年前 , 2F
權重4的邊為起點和終點,分別+1和*2答案就出來了
11/22 15:28, 2F

11/22 15:36, 7年前 , 3F

11/22 17:20, 7年前 , 4F
哦了解!感謝樓上兩位~
11/22 17:20, 4F
文章代碼(AID): #1RzbaBhL (Grad-ProbAsk)