Spot the problem

Revision en1, by longrange, 2023-03-16 07:25:55

Reference to link

My solution is to sort the distances and arrange them in a cyclic order(except the last one). Then add edges of negative weight to minimize the sum. This yields the answer to be -1*(max_element in distances) [except when n=2]. What is wrong with my algo?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English longrange 2023-03-16 07:25:55 428 Initial revision (published)