[理工] 100 交大 Floyd-Warshall 负weight cycle

楼主: booowei1203 (wei)   2020-12-10 15:58:02
https://imgur.com/FalqPUB
106师大资工 这题的C小题,
如果 floyd warshall 的最后一个矩阵的对角线元素有负值的话,
代表该图有negative weight cycle
https://imgur.com/wJ4pD5H
但是交大100 这题的第2小题的d选项说
“floyd warshall 不能侦测 negative weight cycle”,却没有被选为错的。
是不是答案有问题呢?
作者: sososlee (尧)   2020-12-10 18:31:00
交大那题选项说他是错的,所以可以侦测负环看错,我也觉得d可以选
作者: mathtsai (mathtsai)   2020-12-10 21:28:00
上网查了 对角线有负值代表有负环
作者: yuai9111 (PlayBoyYuAi)   2020-12-11 00:12:00
我是这样想 师大题目:用floyd的"output"去detect有无负环 交大那题是floyd的"algo"能否判断负环 所以d没选有错请纠正

Links booklink

Contact Us: admin [ a t ] ucptt.com