Find cost of Edges in a Graph

you are given a graph of N nodes and M edges - all edge weights are DISTINCT

given two nodes u and v,  where u < v (node no_1 < node no_2   )

if there is a path between u and v you remove smallest weight edge from the graph, this edge may or may not belong to the path between u and v.

c(u,v) this is a sum of all the edge weight removed before u and v got disconnected

(there can be more than one path can exist)

you need to give me  sum c(u,v) for all u,v where u < v.

Author: kasthurirajesh
Login to Answer
Sort By:
My Answer