1
$\begingroup$

So Basically, I am stuck on a question.

Given an undirected weighted graph,find the minimum weight of the edges of this graph so that the minimum distance between a particular vertex (say $A$) and all the other vertices is same with both the old and the new weight of the edges. For eg: Let the graph have n vertices and m edges with weights [$W_1,W_2,\ldots W_m]$.

The minimum cost to travel from A vertex to any other vertex be $[M_1,M_2,\ldots M_{n-1}]$.

Now, find the new minimum possible edge weights(for the same edges) $ [w_1,w_2,\ldots,w_m]$ keeping the minimum cost same.

I have to output the sum of these minimum edge weights;i.e $(w_1+w_2+w_3+\cdots +w_m)$.

Thank You.

  • 0
    The cost of going from $A $ to the $i $th vertex is $M_i $?2017-01-18
  • 1
    And also, what did you try?2017-01-18
  • 0
    Can you change the shape of the graph? I.e can I remove all the old edges and just insert some new edges where I see fit?2017-01-18
  • 0
    @RSerrao Yes the cost of going from A to the iith vertex is Mi, and no you can not change the shape of the graph.You can only alter the weights of the edges.2017-01-18
  • 1
    @RSerrao haha, I see where you're going; you can just make the graph into a path from $A$ through ascending-cost vertices. Worth asking but it seems a little too simple.2017-01-18
  • 0
    @RSerrao I could not figure out much , only that I have the minimum cost for all vertices , so somehow if I could implement a reverse Djikstra , it would be give me the edge weights , but i think that too would not be the minimum ones.2017-01-18

0 Answers 0