Some pairs of cities of a country consisting of cities are connected by round trip flights operated by air companies. There are at least two cities such that one is not reachable from the other one by one or two flights. Given that for any pair of cities there is an air company connecting these two cities by direct or indirect flights, find the maximal possible value of .
Solution
The answer is . The solution will be given in terms of graph theory: vertices are cities, edges corresponding to flights will be identically colored if they belong to the same air company. Let all edges of a tree connecting all vertices be identically colored and the remaining edges be differently colored. The conditions are held and .
Now we prove that there are at most colors. Consider a coloring of with maximal number of colors. Then
Identically colored edges form a connected tree. Indeed, if there is a monochromatic cycle we can recolor one of its edges in a new color and increase the number of colors; if two identically colored trees are not connected then we can recolor one of these trees in a new color and thereby increase the number of colors.
*Two trees can not have more than intersections.* Indeed, if there are more than two intersections the union of two trees includes at least two cycles and we can recolor these two trees identically and after that recolor one edge in each cycle in new colors and thereby increase the number of colors.
W.l.o.g. we can suppose that if two trees intersect at two vertices then both vertices are endpoints (vertices of degree one) of these trees. Indeed, if one of intersection vertices is not an endpoint there is a cycle; we can recolor these two trees identically and after that recolor one edge in a cycle by new color thereby the number of colors will not change.
Consider vertices and located at distance at least . Let be the set of vertices of a tree connecting and and . denotes the number of vertices in . Let be the set of all neighbor vertices of and . denotes the number of elements in . Let , , , .
Let be connected to vertices of by some trees and be their vertices. since different trees already have intersection in . Therefore to each tree we can assign a different vertex in . Therefore, trees contain at least vertices other than . Similarly, trees connecting to contain at least vertices other than .
If a tree contains vertices other than its root, edges are identically colored and color loss . Thus, the total color loss will be . Since the total color loss is . Thus, the total number of colors is at most . Done.