Disconnected computers

Find the maximum number of direct connections among 30 computers, such that when you select any three computers, there are at least two with no direct connection.


As an explicit example, we provide a case of having 4 computers with 4 direct connections that satisfies the conditions of the problem.

  • Case 1: Select A , B , C \color{#20A900} A,B,C , and you will have A , C \color{#D61F06} A,C not connected.
  • Case 2: Select A , C , D \color{#20A900} A,C,D , and you will have A , C \color{#D61F06} A,C not connected.
  • Case 3: Select A , B , D \color{#20A900} A,B,D , and you will have B , D \color{#D61F06} B,D not connected.
  • Case 4: Select B , C , D \color{#20A900} B,C,D , and you will have B , D \color{#D61F06} B,D not connected.


The answer is 225.

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.

1 solution

Ivan Koswara
Dec 16, 2016

If we represent each computer as a vertex of a graph, and direct connection between computers to be an edge between the two vertices, we now have a graph representing the connections. The condition of the problem means the graph is triangle-free: it doesn't contain three vertices, each adjacent to each other. By Mantel's theorem, a simple triangle-free graph of n n vertices has at most n 2 4 \left\lfloor \frac{n^2}{4} \right\rfloor edges, so since n = 30 n = 30 , we have 3 0 2 4 = 225 \left\lfloor \frac{30^2}{4} \right\rfloor = \boxed{225} edges, achievable by the complete bipartite graph K 15 , 15 K_{15,15} : 15 vertices in one group and 15 in the other, and there is an edge between two vertices of different groups (and none in the same group).


That was not very satisfactory, huh? Just a single application of the theorem. So let's prove the theorem. (This follows the same proof in Wikipedia.) Mantel's theorem is a special case of Turan's theorem. (Turan's theorem gives the number of edges for a graph that doesn't have K r K_r : r r vertices, each adjacent to each other; Mantel's theorem is r = 3 r = 3 .) Both are example theorems in the field of extremal graph theory , a subfield of graph theory where we look at extremes: graphs with most/least vertices, edges, cycles, whatever else, subject to certain conditions.

The proofs of such theorems generally follow the same structure: take the extreme example, and prove statements about it that must hold.

In the following, all graphs are simple. deg v \deg v is the degree of v v ; that is, the number of edges incident to v v .

Let G G be a graph of n n vertices that is triangle-free and has the most number of edges. (We want to find the number of edges in G G to prove Mantel's theorem. Also note that we can do so because there is an upper bound on the number of edges and the number of edges is an integer, so there must be a maximum.) We have a claim:

Claim 1 : G G doesn't contain three vertices u , v , w u,v,w where u v uv is an edge but u w , v w uw, vw aren't. That is, for any three vertices, there must be either zero or two edges among them.

Suppose otherwise. We want to construct a new graph G G' of n n vertices that is still triangle-free but has more edges than G G ; this would contradict the fact that we chose G G to have the most number of edges. We can divide into two cases:

Case 1 : deg w < deg u \deg w < \deg u or deg w < deg v \deg w < \deg v

Without loss of generality, suppose deg w < deg u \deg w < \deg u (otherwise swap the names of u u and v v ). Delete w w (with all edges incident to it) and replace it with a copy of u u named u u' ; every neighbor of u u is also a neighbor of u u' and vice versa. u u and u u' themselves aren't adjacent. Since the original graph doesn't contain any triangle, the graph after deleting w w also doesn't contain any triangle. When we introduce u u' , there is also no triangle. For, if u , x , y u', x, y make a triangle, then neither of x , y x,y can be u u because u u uu' is not an edge. So u x , u y , x y u'x, u'y, xy are edges, thus by definition of u u' , we know that u x , u y , x y ux, uy, xy are also edges. But this means u , x , y u, x, y make a triangle, which implies the original graph is not triangle-free, contradiction. So our new graph is triangle-free. Moreover, since deg w < deg u \deg w < \deg u , we erased deg w \deg w edges but added deg u \deg u edges, for a total of deg u deg w > 0 \deg u - \deg w > 0 edges. This means G G' has more edges than G G , contradiction.

Case 2 : deg w deg u , deg v \deg w \ge \deg u, \deg v

Similar to before, we delete and make copies. This time, we delete both u u and v v , and make two new copies of w w named w , w w', w'' . Similar to before, there is no triangle not involving w w' nor w w'' . A triangle involving w w' , say w , x , y w', x, y , implies that w x , w y , x y w'x, w'y, xy are edges, and hence w x , w y , x y wx, wy, xy are edges, and hence w , x , y w, x, y is also a triangle, contradiction. Similar with a triangle involving w w'' . So our new graph is triangle-free. But how many edges were deleted and introduced? We deleted deg u \deg u edges from u u , plus d e g v deg v edges from v v ; however, one of the edges is counted twice, because u v uv is an edge and thus contributes one for both u u and v v . Thus we only lose deg u + deg v 1 \deg u + \deg v - 1 edges, and we gain 2 deg w 2 \cdot \deg w edges from the two copies. That's a net gain of 2 deg w ( deg u + deg v 1 ) = ( deg w deg u ) + ( deg w deg v ) + 1 0 + 0 + 1 > 0 2 \cdot \deg w - (\deg u + \deg v - 1) = (\deg w - \deg u) + (\deg w - \deg v) + 1 \ge 0 + 0 + 1 > 0 edges, so G G' has more edges than G G as well, contradiction.

Thus we have proven Claim 1.

Now, for each vertex in G G , give it a color such that two vertices that are not adjacent have the same color and two vertices that are adjacent have different colors. We can do this, because of Claim 1:

  • If u , v u,v are not adjacent, then they have the same color. If v , w v,w are not adjacent, then they have the same color. By Claim 1, if u , v u,v are not adjacent and so as v , w v,w , then u , w u,w are also not adjacent; indeed, they do have the same color, because all of u , v , w u,v,w are of the same color.
  • Similar to above; suppose u , v u,v are not adjacent. If v , w v,w are adjacent, then they have different colors. Thus u , w u,w also have different colors (because u , v u,v have the same color but v , w v,w have different colors). Indeed, by Claim 1, u , w u,w must be adjacent.

Technically speaking, we can partition the vertices of G G into equivalence classes, where two vertices are equivalent if and only if they are not adjacent.

Now, if there are three colors, suppose u , v , w u, v, w are colored by the first, second, and third colors respectively. This means u , v , w u,v,w must be all adjacent to each other (because any two of them have different colors). But this means they form a triangle, contradiction. So there are at most two colors. We can divide the vertices into two groups A A and B B , having a a and b b vertices respectively, where two vertices in different groups are adjacent and two vertices in the same group are not adjacent.

Finally, we show that a b 1 |a-b| \le 1 ; that is, the division must be as small as possible. This one is straightforward: a + b = n a+b = n , the number of vertices, is fixed, and we want to maximize a b ab , the number of edges. Without loss of generality, a b a \le b (otherwise swap the names A A and B B ). If a b 2 a \le b-2 , consider moving one vertex from B B to A A , so we have a = a + 1 , b = b 1 a' = a+1, b' = b-1 . We have a b = ( a + 1 ) ( b 1 ) = a b + b a 1 a b + 2 1 > a b a'b' = (a+1)(b-1) = ab + b - a - 1 \ge ab + 2 - 1 > ab , so we can make a graph with more edges, contradiction. So a b 1 a \ge b-1 , and since a b a \le b , this proves the claim that a b 1 |a-b| \le 1 . There is only one such possibility: a = n 2 , b = n 2 a = \left\lfloor \frac{n}{2} \right\rfloor, b = \left\lceil \frac{n}{2} \right\rceil , and we can check the two cases ( n n even and n n odd) that a b = n 2 4 ab = \left\lfloor \frac{n^2}{4} \right\rfloor , as required.

Mantel's theorem is one of those where at first glance, we go "This must obviously be true". However, it resists most basic attempts at proving it.

It's one of my favorite for "Induction will not help you here", which feels so counter intuitive since the equality cases are so nicely built up on each other.

I like the Cauchy Schwarz approach for it's elegance, but it doesn't quite give the "graph theory" feel of it.

A lot of material here would be great on the Mantels Theorem . Can you help get it started?

Calvin Lin Staff - 4 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...