Index      Graphs and Magic  Problems  Change Language   Source

Graphs and Magic

Sometimes combinatorial problems with very interesting ideas are modeled as graphs. In the realm of graphs, using the powerful tools at our disposal (theorems and good intuition about graphs), we can easily solve problems.

In this section, we aim to familiarize you with the magic of graph modeling through a few examples!

Tree?

Let set \(S\) be defined as the numbers 1 to \(n\), and consider \(n\) distinct subsets \(A_1, A_2, \ldots, A_n\) of \(S\). Prove that there exists a number \(x\) such that if \(x\) is removed from all \(A_i\) subsets, the subsets remain pairwise distinct.

Answer

When does removing an element like \(x\) from sets result in two equal sets? Only when there exist two sets like \(A_i, A_j\) that differ solely in \(x\). That is, all elements except \(x\) must either be present in both sets or absent from both.

Now, let's model this problem as a graph. Consider \(n\) vertices, each representing a set \(A_i\). Draw an edge between two vertices \(u, v\) with weight \(w\) if the only difference between \(A_u\) and \(A_v\) is the element \(w\). The problem now reduces to proving there exists a weight not present among the edges!

According to our graph model, traversing an edge with weight \(w\) toggles the membership of element \(w\) in our current set. Therefore, in any closed walk, we must have an even number of each weight (since the presence/absence status of each element must toggle an even number of times to return to the original set).

Assume for contradiction that every weight appears in at least one edge. Select one arbitrary edge for each weight to form a graph \(G\) with \(n\) edges.

First, observe that \(G\) cannot contain cycles. If a cycle existed, it would require an even number of each weight, which is impossible since we have exactly one edge per weight. Thus, \(G\) must be a forest. However, \(G\) has exactly \(n\) edges, which is impossible (as a forest's maximum edge count corresponds to a tree with \(n-1\) edges).

From this contradiction, we conclude there must exist a weight not present among the edges, proving our claim.

Triangles?

Assume that \(S\) is a set with \(2^n+1\) elements, and \(f(\{x,y\})\) is a function that takes a two-element subset of \(S\) as input and returns a number between 0 and \(2^{n-1}-1\). Furthermore, we know that for any three distinct elements \(x, y, z\) in \(S\), one of \(f(\{x,y\})\), \(f(\{x,z\})\), or \(f(\{y,z\})\) equals the sum of the other two. You must prove that there exist \(x, y, z\) such that \(f(\{x,y\})\), \(f(\{x,z\})\), and \(f(\{y,z\})\) are all equal to 0.