Shortest two disjoint paths; two sources and two destinations

前端 未结 2 1059
太阳男子
太阳男子 2021-02-04 19:50

We\'re given an unweighted undirected graph G = (V, E) where |V| <= 40,000 and |E| <= 106. We\'re al

2条回答
  •  野的像风
    2021-02-04 20:42

    How about this? Do BFS (breadth first search) traversal from a1 -> a2 and remove the path and compute BFS b1 -> b2. Now reset the graph and do same with b1->b2 first and remove path and then a1->a2. Whatever sum is minumum is the answer.

提交回复
热议问题