Since childhood you have been fascinated by model railroads. Designing your own tracks,complicated intersections, train stations with miniatures of travellers, train operators, luggage is so much fun! However, it also needs a lot of space. Since your house is more than full by now, you decide to move to the garden.
You have already moved all your completed tracks outside when you notice an important ?aw:
Since different tracks were in different rooms before, there are stations which cannot be reached from each other. That has to change!
Since you have already ?xed the exact positions of the stations, you know the lengths for all possible connections you can build and also which stations are connected already. All connections can be used in both directions. You can decide to remove some existing connections and instead build new ones of at most the same total length. Is it possible to rearrange the railroads so that every station is reachable from all other stations?