I’am not able to understand the problem correctly.
It says “While there is a path between vertex u and v, delete the edge with the smallest weight. Cost(u,v) is the sum of the weights of the edges that were deleted in this process.” So do we have to consider all outlier paths too?
Like in going from 1->2 according to the test case, are 1->2->3->6->2…1->2->3->4->5->3->2 valid routes?
Also,once we delete an edge with smallest weight in a path between nodes,say node 1 and node 2,do we consider it deleted already,while computing cost(u,v) of some other pair of nodes?
i have read that question and what i understand is this :
given a undirected graph u need to calculate the sum of summation of all (cost)(u,v) where u<v
cost(ui,vi ) is defined as the smallest weight on the path from u to v.
graph was not loading on my machine due to slow internet connection so i am not able to verified what i have understood from the statement .