Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在图中找到通过至少一条标记为“必须通过”的边的最短路径。有任何想法吗?可以修改 Dijkstra 的算法以实现这一目标吗?
对于必须经过 C 的从 A 到 B 的路径,将其计算为两条最短路径,一条从 A 到 C,另一条从 C 到 B。