Lecture 26

\( \newcommand{\set}[1]{\{#1\}} \newcommand{\comprehension}[2]{\{#1\,\vert\,#2\}} \newcommand{\size}[1]{\left\vert#1\right\vert} \newcommand{\true}{\top} \newcommand{\false}{\bot} \newcommand{\limplies}{\rightarrow} \newcommand{\divides}{\mathbin{\vert}} \newcommand{\mult}{\mathbin{\cdot}} \newcommand{\xor}{\oplus} \newcommand{\union}{\cup} \newcommand{\intersect}{\cap} \newcommand{\complement}[1]{\overline#1} \newcommand{\powerset}{\mathcal{P}} \newcommand{\ixUnion}{\bigcup} \newcommand{\ixIntersect}{\bigcap} \newcommand{\Div}{\mathrm{div}} \newcommand{\gcd}{\mathrm{gcd}} \newcommand{\divmod}{\mathop{\mathbf{divmod}}} \newcommand{\div}{\mathop{\mathbf{div}}} \newcommand{\mod}{\mathop{\mathbf{mod}}} \newcommand{\ceiling}[1]{\lceil#1\rceil} \newcommand{\floor}[1]{\lfloor#1\rfloor} \DeclareMathOperator{\Pr}{Pr} \DeclareMathOperator{\rng}{rng} \DeclareMathOperator{\lcm}{lcm} \DeclareMathOperator{\deg}{deg} \DeclareMathOperator{\E}{E} \DeclareMathOperator{\V}{V} \DeclareMathOperator{\T}{T} \DeclareMathOperator{\O}{O} \newcommand{\abs}[1]{\left\lvert#1\right\rvert} \newcommand{\indeg}{\mathop{\deg^-}} \newcommand{\outdeg}{\mathop{\deg^+}} \)

The final exam is scheduled for 10:30am-12:30pm on Monday, March 13th, in this room. The final will be cumulative, but will emphasize material from the second half of the course.

Graph Theory: Isomorphism

Consider the following two graphs:

Two different ways to present the 3-cube.

Looking at these graphs, we can see some similarities and some differences. Both graphs have 8 vertices, and if we bother to count them, 12 edges. It is clear from their presentation that graph $A$ is bipartite, while $B$ is planar (i.e., we can lay it out on the plane without crossing edges). If we cared to look a bit deeper, we might notice that both graphs seem to have strong regularity properties, albeit quite different ones. Graph $B$ is clearly just the 3-cube, whereas $A$ looks like the Devil's version of cat's cradle (this turns out to be surprisingly apt!). As a bipartite graph $A$, is almost complete $(K_{4,4})$, except that it omits the horizontal edge from a vertex in one bipartition to its peer on the other. We might even notice that both graphs have the property that all of their vertices have degree 3.

As we contemplate these graphs further, we might notice that graph $B$ is also bipartite:

A two-coloring of the 3-cube.

As we contemplate the bipartite presentation of graph $B$ even more deeply still, we might notice that each vertex of one color is connected to three of the four vertices of the other color, indeed it is connected to every vertex except from the one that occupies the opposite most corner of the cube. Thus, if we were simply to pull the white points to one side, and the black points to the other, and then carefully arrange the points so that each was placed across from the point at the opposite side of the cube, we'd obtain a graph that is exactly how we described $A$. These are, in a very fundamental sense, the same graph, despite their very different appearances.

Definition 26.1 Two simple graphs $G_1=(V_1,E_1)$ and $G_2=(V_2,E_2)$ are isomorphic if there is a bijection (a one-to-one and onto function) $f : V_1 \to V_2$ such that if $a,b\in V_1$, then there is an edge between $a$ and $b$ iff there is an edge between $f(a)$ and $f(b)$. In this case, we will write $G_1 \cong G_2$, or $f : G_1 \cong G_2$, as needed.

Note that this definition isn't satisfactory for non-simple graphs. Consider the following two graphs:

Two non-isomorphic, non-simple graphs.

These two graphs would be isomorphic by the definition above, and that's clearly not what we want. The issue, of course, is that for non-simple graphs, two vertices do not uniquely determine an edge, and we want the edge structures to line up with one another too. It's not difficult to sort this out.

Definition 26.2 (Isomorphism of Graphs) Two graphs $G_1=(V_1,E_1)$ and $G_2=(V_2,E_2)$ are isomorphic if there is an $f = (f_V,f_E)$, where $f_V$ is a bijection from $V_1$ to $V_2$, $f_E$ is a bijection from $E_1$ to $E_2$, and $e\in E_1$ is incident to $v \in V_1$ iff $f_E(e)$ is incident to $f_V(v)$.

As Definition 26.2 makes clear, the standard definition of a graph can be improved by explicitly including the incidence relation in its signature—something to keep in mind if you're writing code to manipulate graphs. Or are trying to prove theorems...

Of course, we can easily demonstrate that two graphs are isomorphic by exhibiting the required isomorphism, and then checking to make sure that the incidence relation is preserved. Indeed, we really only need $f_E$, and the ability to count the number of edges between two vertices in both graphs. As long as those counts line up between pairs of vertices in $V_1$ and the corresponding pairs in $V_2$, we know an isomorphism exists. Showing that two graphs are not isomorphic can be more challenging. In many cases, we can show that two graphs are non-isomorphic by showing that they don't share an isomorphism invariant, i.e., they differ on some function or proposition that is preserved by isomorphisms. A simple example of this would be vertex size: we can only build bijections between sets with the same number of elements! Likewise, edge size is also an isomorphism invariant.

Exercise 26.3 Show that being bipartite is an isomorphism invariant.

Definition 26.4 For a graph $G=(V,E)$ the degree sequence of $G$ is comprised of the degrees of the vertices of $G$, with their multiplicity, in non-decreasing order.

For example, the degree sequence associated with graph $B$, the $3$-cube, is $\langle 3,3,3,3,3,3,3,3 \rangle$, the degree sequence associated with graph $C$ is $\langle 4,3,3,2\rangle$, and the degree sequence associated with graph $D$ is $\langle 3,3,3,3 \rangle$.

Theorem 26.5 The degree sequence of a graph is an isomorphism invariant.

Proof Let $G_1=(V_1,E_1)$ and $G_2=(V_2,E_2)$ be graphs, with $f : G_1 \cong G_2$. Let $\langle v_1,v_2,\ldots,v_n\rangle$ be a permutation of $V_1$ that witnesses the degree sequence of $G_1$, i.e., each vertex in the list has the corresponding degree. It is easy to see that for each $i$, $f_V(v_i)$ must have the same degree as $v_i$, as an edge $e_j\in E_1$ will be incident to $v_i$ if and only if $f_E(e_j)$ is incident to $f_V(v_i)$, and $f_E$ is a bijection, and so preserves the count. Therefore $\langle f_V(v_1),f_V(v_2),\ldots,f_V(v_n)\rangle$ corresponds to the same sequence of degrees as $\langle v_1,v_2,\ldots,v_n\rangle$.

$\Box$ Theorem 26.5

We can use Theorem 26.5 to show that graphs $C$ and $D$ are not invariant, but it's not always good enough. Consider, for example, the following two graphs (from Rosen):

Two non-isomorphic graphs with the same degree sequence.

We can easily see that these graphs have the same degree sequence, $\langle 3,3,3,3,2,2 \rangle$. We know that having the same degree sequence is an isomorphism invariant, i.e., it is necessary that two isomorphic graphs have the same degree sequence. But is it sufficient? Unfortunately, no.

It's fairly easy to see that $E$ and $F$ aren't isomorphic if you know what to look for: $E$ contains two triangles (i.e., copies of $K_3$), but by inspection, $F$ does not contain any triangles. Clearly, a graph isomorphism has to maintain the triangle count.

Exercise 26.6 Flesh out this “clearly,” i.e., show that if $G_1$ and $G_2$ are isomorphic graphs, then the number of triangles in $G_1$ equals the number of triangles in $G_2$.

A problem with the “triangle count” invariant is that it's comparatively expensive to compute, as it requires us to consider $\size{V} \choose 3$ many triples of vertices. In this case, though, we can actually do a bit better:

Theorem 26.7 A graph is bipartite if and only if it does not contain a circuit of odd length.

Proof First, we do the “if” part. Assume that a graph $G$ does not contain an odd cycle. Without loss of generality, we can assume that $G$ is connected, as a graph will be bipartite if and only if all of its connected components are bipartite. Fix a vertex $v$, and define the sets $V_1 = \comprehension{v'\in V}{\text{there exists a path of even length between $v$ and $v'$}}$, and $V_2 = \comprehension{v'\in V}{\text{there exists a path of odd length between $v$ and $v'$}}$ The sets $V_1$ and $V_2$ are exhaustive, because we're assuming $G$ is connected, and disjoint, because otherwise we could compose the two witnessing paths to create an odd circuit. It is easy to see that $(V_1,V_2)$ is a bipartition of $G$.

For the “only if” part, assume $G$ is bipartite, and consider a cycle in $G$. It must alternate sides of the bipartition, and since it has to end up on the same side that it started, must have even length.

$\Box$ Theorem 26.7

Exercise 26.8 Is the analogous result true for tripartite graphs? Prove or give a counter-example.

We can save ourselves some work by exhibiting the following, a bipartition of $F$:

A bipartition of graph F.

Note that we can verify that a graph is bipartite by simply checking that each edge is incident on both black and white vertices, and this requires checking $\size{E} \leq {\size{V} \choose 2}$ rather than $\size{V} \choose 3$ simple facts about $G$. Once we've verified that $F$ is bipartite, we know by Theorem 26.7 that $F$ contains no cycles of odd length, and in particular, no triangles.

Some brief reflections on graph isomorphism

You won't be surprised to know that while the number of triangles in a graph is an isomorphism invariant, it is not a sufficient condition for the existence of an isomorphism. This is a sadly common case. We can often show that two graphs are non-isomorphic by noticing a structural difference between them, and then showing that that difference is an isomorphism invariant. But we don't yet have easily checked isomorphism invariants that are sufficient. Nor do we know they don't exist. The complexity of graph isomorphism remains a significant open problem.

In complexity theory, we often distinguish between feasible problems (i.e., problems that have polynomial time algorithms), and infeasible problems (those that don't). An important class of problems are those for which it is feasible to check a solution. These are the so-called NP problems, as they're solvable in nondeterministic polynomial time: we guess a solution, and then check it for correctness. We can often reduce one problem to another, and there are problems in NP to which all NP problems can be feasibly reduced. These are the NP-complete problems. Almost all natural problems that are in NP but are not known to be in P can be shown to be NP-complete. This isn't a theorem, but an empirical observation with a lot of data behind it!

Among such problems, graph isomorphism has long stood out as a problem that resists classification: it is not known to be in P, neither is it known to be NP-complete. This has lead more than one person to conjecture that graph isomorphism might be a natural example of an infeasible, NP-incomplete problem.

Professor Babai has recently provided some important evidence that this might indeed be the case. The best known result for the time complexity of NP complete problems is that they are contained in exponential time, and they're widely believed to require exponential time. Babai has tentatively claimed (the proof isn't yet fully vetted, and so he's being careful) that graph isomorphism is in quasi-polynomial time, i.e., time $\O(n^{(\log n)^c})$ for some constant $c$. And we know by the time-hierarchy theorem that $\T(n^{(\log n)^c})$ (the sets that can be computed in time $\O(n^{(\log n)^c})$ is strictly contained in $\T(2^{n^c})$. If this is so, and Babai's algorithm is of optimal order, then indeed, graph isomorphism is an infeasible, NP-incomplete problem.

Note that questions similar to graph isomorphism have been more completely resolved, in particular, the question of subgraph isomorphism, i.e., given graphs $G_1$ and $G_2$, is there a vertex induced subgraph $G_2'$ of $G_2$ such that $G_1 \cong G_2'$, is known to be NP-complete. Indeed, for the special case where $G_1$ was $K_n$ for some $n$, this is known as the clique problem (an interesting case of the vocabulary of the social sciences entering the vocabulary of mathematics), and it was one of the original problems described by Cook in his original paper on NP-completeness.

If you want to know more of such things, you'll need to take Algorithms, Complexity Theory, and/or Graph Theory, as this class, and this course, is done. Thank you!

$\Box$ CMSC-27100