The Red and Blue Friends

The Map of the Empire The Map of the Empire

In Sheldor's empire, there are several villages connected by roads of different length. The map of the empire is shown above.

However, because the emperor cannot put up with the high costs of maintaining so many roads decided that he would only keep as many roads as to keep the whole kingdom connected but the total length of the roads is minimum. He would blow up all the other roads.

The direct road between Red \color{#D61F06}{\text{Red}} and Blue \color{#3D99F6}{\text{Blue}} is the shortest road in the empire. Will this road still be kept in this regime?

No Yes

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Gregory Lewis
Apr 5, 2017

5-7-10-3-4-6-2 is a solution of length 37. If 2 was not included in the shortest solution, then 18 or 21 would be needed in order to connect blue. Since you need at least 7 roads to connect 8 cities, that means you would need the 6 other roads to add up to at most 19 in order to be as short. Even if 3 was part of the solution, that would still require the remaining 5 roads to average less than 4, which is clearly impossible since none of the other roads are less than 4.

Is it the case that the shortest path always remains in such a setting regardless of what the values in the other paths are?

Agnishom Chattopadhyay - 4 years, 2 months ago

Log in to reply

Yes it is! Kruskal's algorithm...

Geoff Pilling - 4 years, 2 months ago
Odinrawo201 Rom
Apr 3, 2017

You still need to get from village to village, the keeping the red-blue road is best because it provides access to the middle village(which is a good central hub) as well as the villages close to it, which means the king can destroy the long roads connecting village to village

Is it the case that the shortest path always remains in such a setting regardless of what the values in the other paths are?

Agnishom Chattopadhyay - 4 years, 2 months ago

by iteration the shortest road is 37 and it obviousely must include the red-blue road which has the lowest value among all.

Can you explain what you mean by iteration ?

Agnishom Chattopadhyay - 4 years, 2 months ago

choosing the lower valued path and eliminating the costly ones, wherever applicable, at each step, while insuring that all stations of the network are visited and interconnected. Trial and error.

Harout G. Vartanian - 4 years, 2 months ago

Log in to reply

Yes, this greedy strategy actually works! It is called kruskal's algorithm , by the way.

Agnishom Chattopadhyay - 4 years, 2 months ago

start at red continue to blue and on...

Harout G. Vartanian - 4 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...