图 G 是一个无向图,其所有边的权重都相同。u,v 是 2 个给定的顶点,如何在 O(|V|) 中找到图 G 中 u 和 v 之间最短路径的数量?
|V| 代表 G 中的顶点数。
algorithm graph
algorithm ×1
graph ×1