A king rules over cities, and there are bridges connecting some of the cities together (a bridge can only be built between two cities, connecting both of them.) One day, he holds a conversation with the royal architect.
King: Our subjects have complained that we are not putting their tax money to good use. Get two cities which you would like to connect, and build a bridge between them.
Architect: But building another bridge would be wasted funds, your majesty. As you can see, if another bridge were to be built between any two cities of your choice, it would be redundant, as there would be another series of bridges which would connect the two cities on which the bridge will be built between. Since this has not yet happened before, our citizens would surely dislike this idea.
Find the minimum value of for which this dilemma can hold.
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.
Consider the cities as vertices and bridges as edges between them.So, there are 2 0 1 7 vertices and n edges.The present number of bridges already connects every pair if cities not necessarily direct but through series of bridges.If any other bridges will be built then it will be redundant.
This is possible if a graph is a tree where n vertices requires n − 1 edges to be minimally connected .So, here 2 0 1 7 − 1 = 2 0 1 6 bridges are there.