Method line M20 · When and why do we use it?

Graph-Theoretic Methods

In the Chinese book: 图论方法

Objects become vertices, relations edges; degrees and triangles are visible.

📖 Chapter 20 of 《解题方法与策略》

One idea, one pictureTap one vertex and then another to join them. Add a few edges any way you like. How is the sum of the degrees related to “2 × edges”? How many vertices have odd degree?

Loading figure…

In one sentence

Draw the objects as vertices and “are related” as edges, and the problem becomes a graph. The simplest theorem of graph theory:

(Each edge joins two vertices and is counted twice: this is “counting in two ways” on a graph.) So the number of vertices of odd degree is always even. Add coloring the edges (know / do not know) and triangles, and many problems of the form “any people…” get an intuitive model.

Predict first

Can each of people have shaken hands with exactly of the others?

Choose an answer first; then you can see the result.

Example: among any 6 people, there are 3 who all know each other or 3 who all do not (the classic Ramsey problem)

Step 1 / 5
Loading figure…
  1. The model

    People → vertices; two people who know each other → a red edge, who do not → a blue edge. To prove: every two-coloring of the complete graph on vertices has a monochromatic triangle.

Stop 1 · Families of subsets: the intersection graph (Vol. 1)

In a family of sets, “two sets intersect” is a pairwise relation. Draw the sets as vertices, and the handshake lemma can answer existence questions.

Example: are there 7 sets such that each one intersects exactly 3 of the others?

Step 1 / 3
  1. Draw a graph

    Each set is a vertex, and two intersecting sets are joined by an edge. The condition becomes: vertices, each of degree .

Stop 2 · Partitions of a set: bipartite graphs and odd cycles (Vol. 1)

Split the vertices into two groups so that every edge goes across: that is a bipartite graph. Whether it can be done depends on whether there is an odd cycle.

Loading figure…
people sit in a circle, and each one does not get along with the two neighbors (an edge). You want to put them in two rooms so that people who do not get along are in different rooms. Try labeling A, B alternately around the circle on paper: what happens when you come back around?

Label the groups alternately A, B, A, B… around the cycle. After steps you are back at the start, which should now be B, but it is A. So an odd cycle cannot be split into two groups. Conversely, one can prove that a graph with no odd cycle can always be split into two groups (start from any vertex and group the vertices by the parity of their distance).

Stop 3 · Combinatorial estimates: graphs without triangles (Vol. 6)

Loading figure…
vertices, edges, no triangle. What happens if you add any one more edge?

One problem, several solutions

A graph on vertices has no triangle. Prove that the number of edges satisfies (Mantel's theorem).

Counting in two ways + Cauchy

For each edge : and have no common neighbor (otherwise there would be a triangle), so . Sum over all edges; each vertex appears once in each of its edges, so . By the Cauchy inequality, . So , that is, .

CostA clear line of thought, using the Cauchy inequality from Vol. 6.

The extremal principle

Take a vertex of largest degree, . The neighbors of are pairwise non-adjacent, so every edge has at least one end among the other vertices, each of degree : .

CostNo inequality needed, but you have to think of taking the vertex of largest degree.

Equality is reached by the complete bipartite graph: two groups of vertices each, all edges between the groups and none inside them. The graph above is the case , with .

Practice

Exercise 1Basic

At a party of people, each person shakes hands with exactly of the others. How many handshakes are there in all?

Exercise 2Basic

A graph on vertices has no triangle. At most how many edges can it have?

Exercise 3Advanced

Color every edge of the complete graph red or blue. What is the smallest for which there is a monochromatic triangle however the edges are colored?

Exercise 4Challenge

The edges of are colored red and blue in any way. What is the least possible number of monochromatic triangles?

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Counting each handshake only once

The wrong step: Can each of people shake hands with exactly of the others? The number of handshakes is , a positive integer, so yes.
What went wrong? Think first, then open

Diagnosis Each handshake involves two people and is counted once by each of them: is the sum of the degrees, which must equal twice the number of handshakes. is odd, so it cannot be twice an integer.

The right step: Draw it as a graph: the sum of the degrees the number of edges, which is always even. is odd, so it cannot be done.

“The sum of the degrees is twice the number of edges”

Exhibit

Thinking that 5 people cannot avoid it either

The wrong step: Among any people there must be who all know each other or all do not know each other, by the same argument as for people.
What went wrong? Think first, then open

Diagnosis The proof for people uses “one person has edges, so of them have the same color”. With people, each has only edges, which can be red and blue. And there really is a counterexample: color the sides of a pentagon red and the edges of the pentagram blue; there is no monochromatic triangle.

The right step: is the smallest: has a coloring that avoids it, does not. See it for yourself on the on this page.

“Every number in a proof is there for a reason”

Stops on this line

The same idea, used once in each of several places.

  1. Families of SubsetsVol. 1 Sets, ch. 5
  2. Partitions of a SetVol. 1 Sets, ch. 4
  3. Cauchy in Combinatorial EstimatesVol. 6 The Mean Inequalities and the Cauchy Inequality, §4.4