Index      Minimax Theorems  Problems  Change Language   Source

Minimax Theorems

In this section, we examine several theorems stating that the minimum of one quantity equals the maximum of another. Some of these theorems hold in any graph, while others hold only in bipartite graphs.

First, we establish the following notations:

Theorems Valid in Every Graph

In this section, we examine fundamental theorems that hold true for all graphs.

Handshaking Lemma

The sum of all vertex degrees in a graph is equal to twice the number of edges:

\[\sum_{v \in V} \deg(v) = 2|E|\]

Proof Suppose we count all edge endpoints. Each edge contributes 2 to the total count, hence \(2|E|\). This must equal the sum of degrees. ∎

 1def calculate_degrees(graph):
 2    # Calculate degree of each vertex
 3    degrees = {}
 4    for v in graph.vertices:  # در اینجا رأس‌های گراف را پیمایش می‌کنیم
 5        degrees[v] = len(graph.neighbors(v))
 6    return degrees
 7
 8# Example usage
 9G = Graph()
10G.add_edges([(1,2), (2,3), (1,3)])
11print(calculate_degrees(G))  # Output: {1: 2, 2: 2, 3: 2}

توجه

In any graph, the number of vertices with odd degree is always even. This is a direct consequence of the Handshaking Lemma.

Euler's Theorem

A connected graph contains an Eulerian trail if and only if it has exactly 0 or 2 vertices of odd degree.

book/13/images/eulerian_graph.png

هشدار

This theorem applies only to undirected graphs. For directed graphs, the conditions differ.

\[\alpha + \beta = n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\]

The complement of an independent set is a vertex cover, and the complement of a vertex cover is an independent set (Why?). Therefore, if we consider the maximum independent set, its complement will be the minimum vertex cover, and vice versa.

\[\alpha^{\prime} + \beta^{\prime} = n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\]

First, we must assume the graph has no isolated vertices, as otherwise an edge cover cannot be defined for such a graph.

Now consider a minimal edge cover.

First, we can conclude this set contains no cycles (if it did, removing one edge from the cycle would yield a smaller set that is still an edge cover). Therefore, each connected component is a tree.

Next, we can conclude none of the trees have a distance greater than 2 (Why?). Hence, each tree is a star.

The number of stars is \(n-\beta^{\prime}\). We can select exactly one edge from each star to form a matching whose size is less than or equal to the maximum matching. That is, \(n-\beta^{\prime} \leq \alpha^{\prime}\), hence \(n \leq \alpha^{\prime} + \beta^{\prime}\).

Now consider the maximum matching.

Take any vertex \(u\) not covered by the maximum matching. All neighbors of \(u\) must be covered by the maximum matching (Why?), and since there are no isolated vertices, \(u\) has at least one neighbor.

We construct an edge cover as follows: First, add all edges of the matching to it. Then, for each vertex not covered by the maximum matching, add one of its adjacent edges to the edge cover. Now we have an edge cover of size \(n - \alpha^{\prime}\), because the initial \(\alpha^{\prime}\) edges each covered two vertices, and the remaining edges each covered one vertex. Thus \(n-\alpha^{\prime} \geq \beta^{\prime}\), leading to \(n \geq \alpha^{\prime} + \beta^{\prime}\).

Finally, combining the two parts above proves the theorem.

\(\beta \geq \alpha^{\prime}\)

Consider a maximum matching. To cover the edges of this matching, you need \(\alpha^{\prime}\) vertices. (Each vertex can cover at most one of them). Therefore, \(\beta \geq \alpha^{\prime}\).

Theorems Holding in Bipartite Graphs

def is_bipartite(graph):
    # Check if graph is bipartite using BFS
    color = {}
    for node in graph:
        if node not in color:
            queue = [node]
            color[node] = 0
            while queue:
                v = queue.pop(0)
                for neighbor in graph[v]:
                    if neighbor in color:
                        if color[neighbor] == color[v]:
                            return False
                    else:
                        color[neighbor] = 1 - color[v]
                        queue.append(neighbor)
    return True
images/bipartite.png

قضیه ۱: هر گراف دوبخشی فاقد چرخه‌های فردطول است. برعکس، هر گراف بدون چرخه‌های فردطول یک گراف دوبخشی است.

Theorem 1: Every bipartite graph contains no odd-length cycles. Conversely, every graph without odd-length cycles is bipartite.

# in ra taghir nade (don't change this line)
print("Bipartite check result:", is_bipartite(graph))

نتیجه‌گیری: از این قضیه می‌توان برای تشخیص دوبخشی بودن گراف با جستجوی چرخه‌های فردطول استفاده کرد.

Conclusion: This theorem can be used to detect bipartiteness of a graph by searching for odd-length cycles.

:math:`\alpha^{\prime} = \beta`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the previous section, we had :math:`\beta \geq \alpha^{\prime}`, meaning every vertex cover is at least as large as a matching. Thus, if we find a matching equal in size to a vertex cover, we will have proven the claim. Moreover, such a matching will be maximum, and the vertex cover will be minimum.

Consider a minimal vertex cover. Suppose our bipartite graph has partitions :math:`X` and :math:`Y`, and the vertex cover is :math:`X_1 \cup Y_1`, where :math:`X_1 \subseteq X` and :math:`Y_1 \subseteq Y`. Let :math:`X_2 = X - X_1` and :math:`Y_2 = Y - Y_1`.

Now consider the subgraph induced by the vertices :math:`X_1` and :math:`Y_2`. We aim to find a **complete matching** from :math:`X_1` to :math:`Y_2` (i.e., every vertex in :math:`X_1` is included in the matching).

To verify Hall's condition for finding a complete matching from :math:`X_1` to :math:`Y_2`, suppose :math:`S \subseteq X_1`. We claim :math:`|S| \leq |N(S)|` holds. Assume for contradiction that :math:`|S| > |N(S)|`. If we remove set :math:`S` from the vertex cover and add :math:`N(S)` to it, all edges remain covered, resulting in a smaller vertex cover. This contradicts the minimality of the original vertex cover. Hence, Hall's condition is satisfied.

Similarly, a complete matching from :math:`Y_1` to :math:`X_2` can be found. This implies the existence of a matching whose size equals that of the vertex cover.

\(\beta^{\prime} = \alpha\)

From the previous sections, we have that \(\alpha^{\prime} = \beta\), \(n - \alpha = \beta\), and \(n - \beta^{\prime} = \alpha^{\prime}\) hold.

Therefore, \(n - \alpha = n - \beta^{\prime}\), hence \(\alpha = \beta^{\prime}\).