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