Computer Science, asked by keertanachiguru6799, 1 year ago

Does kruskal algorithm work with negative weights

Answers

Answered by debjitnaskar6p74mul
0
Yes,The concept of MST allows weights of an arbitrary sign. The two most popular algorithms for finding MST (Kruskal's and Prim's) work fine with negative edges. Actually, you can just add a big positive constant to all the edges of your graph, making all the edges positive.
Similar questions