 # The complete set of minimal simple graphs that support unsatisfiable 2-CNFs

A propositional logic sentence in conjunctive normal form that has clauses with two literals (a 2-CNF) can be associated with a multigraph in which the vertices correspond to the variables and edges to clauses. We first show that every such sentence that has been reduced, that is, which is unchanged under application of certain tautologies, is equisatisfiable to a 2-CNF whose associated multigraph is, in fact, a simple graph. Our main result is a complete characterization of graphs that can support unsatisfiable 2-CNF sentences. We show that a simple graph can support an unsatisfiable reduced 2-CNF sentence if and only if it can be contracted to a graph that contains one of three specific small graphs as a subgraph. The contraction refers to edge-contractions of edges not contained in a triangle. Equivalently, all reduced 2-CNF sentences supported on a given simple graph are satisfiable if and only if those three graphs are forbidden as subgraphs in contractions of the original graph. We conclude with a discussion of why the Robertson-Seymour graph minor theorem does not apply in our approach.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Given a sentence in propositional logic, the satisfiability decision problem is to determine if there exists a truth assignment for the variables that makes the sentence true. Let  be a finite set of Boolean variables,  be the set  of negations, and let the symbols  and  be True and False values of variables. We define the set of literals obtained from  to be the set .

A Conjunctive Normal Form (CNF) on  is a conjunction of one or more clauses, where each clause is a disjunction of literals. A CNF (or clause) is reduced if it is unchanged under application of all the tautologies listed below

1. ,

2. ,

3. ,

4. ,

5. ,

6. ,

7. ,

8. .

It is a fact that every CNF (or clause) is logically equivalent to a reduced CNF (or clause). The length of a reduced clause is the number of literals in the clause. For , a reduced CNF is a reduced -CNF if all of its clauses have length . Additionally, for ease of stating results, the CNFs  and  will be treated as -CNFs for every . We will refer to the satisfiability decision problem as SAT and the satisfiability problem for -CNFs as -SAT.

Instead of algorithmic issues our aim in this paper is to study the structure of unsatisfiable 2-CNF sentences in a sense that will be made precise later. For completeness, here we briefly summarize the relevant fundamental algorithmic results for satisfiability problems. The 2-SAT problem is in P. An was given by Krom Krom1967 and a linear time algorithm by Even, Itai and Shamir EvItSh1976 and Aspvall, Plass and Tarjan AsPlTa1979 . All solutions of a given 2-CNF sentence can be listed efficiently using an algorithm by Feder Feder1994 .

In contrast with the algorithmic tractability of 2-SAT, the SAT problem in general is NP-complete as was shown by Cook and by Levin independently Cook1971 ; Levin1973 . As part of the proof of the NP-completeness of SAT, they also proved that every logical sentence can be rewritten as a CNF while changing its length by no more than a constant factor. Schaefer’s dichotomy theorem states necessary and sufficient conditions under which a finite set of relations over the Boolean domain yields polynomial-time or NP-complete problems when the relations of are used to constrain some of the propositional variables Schaefer1978 . Thus Schaefer1978 gives a necessary and sufficient condition for SAT-type problems to be in P vs. NP.

Our paper relates properties of certain graphs to satisfiability. An early connection between satisfiability and graphs was in the proof of NP-completeness of various graph problems, such as the clique decision problem and the vertex cover problem, by Karp Karp1972 . One of the linear time algorithms for 2-SAT mentioned above AsPlTa1979 also related graphs and satisfiability in its use of strongly-connected graph components as a tool for deciding satisfiability.

We explore the structures of unsatisfiable 2-CNFs by relating reduced 2-CNFs to graphs and examining which graphs can support unsatisfiable sentences. Given a 2-CNF, an associated multigraph can be created by identifying the variables as vertices and each clause as an edge. Since multiple clauses may involve the same two variables, it is not immediate that it is sufficient to consider graphs rather than multigraphs. That it indeed is so is the content of Section 4. In Section 5 we prove two theorems about families of graphs that support unsatisfiable sentences. Theorem 5 in that section shows that the family of simple graphs that can support an unsatisfiable sentence is closed under the operation of edge-contraction of edges not contained in triangles and Theorem 6 shows that a graph can support an unsatisfiable sentence if one of its subgraph can. Section 7 is about connectivity properties of graphs that we need to prove the main result. The main result of this paper is Theorem 18 in which we give a complete characterization of graphs that can support unsatisfiable sentences. This is given in the form of a finite set of obstructions to supporting only satisfiable sentences. In Section 9 we discuss how our approach differs from the application of finite obstructions (forbidden minors) theory developed in Robertson-Seymour graph minor theorem published in a series of papers starting with RoSe1983 and ending with RoSe2004 .

## 2 Preliminaries

For a reduced CNF  and a variable , we denote by  the CNF obtained by

1. setting all occurrences of  in  to ,

2. setting all occurrences of  in  to , and

3. reducing the CNF thus obtained, that is, applying all the tautologies listed in Section 1 to the CNF to obtain a reduced CNF.

Similarly, the CNF obtained by setting  to , setting  to , and then performing the tautological reductions is denoted by  . If we set multiple variables to true or false, we use the notation  as short-hand for  and so on for variables  and . Note that the order in which we set variables to true or false is not important, as it yields logically equivalent results.

We now define some more adjectives for CNFs. A reduced CNF  is true if , false if , and nontrivial if  is neither true nor false. A reduced CNF  is satisfiable if there is a subset  of  such that  is true. A reduced CNF is unsatisfiable if it is not satisfiable. Two reduced CNFs,  and  are equisatisfiable, denoted by , if either both are satisfiable or both are unsatisfiable.

## 3 Graph associated with a reduced CNF

We define an operation  as , for every . Let  be a nontrivial clause denoted by , where  and  for . We extend the domain of the operation  to include clauses like  by defining .

Let  be a nontrivial -CNF. We can write it as , where and each is a clause of length . To we associate a multigraph having vertex set and having an edge for every . Note that a variable and its negation are both represented by a single vertex (also labeled ) in . The -CNF being nontrivial guarantees that is a nonempty multigraph, thus avoiding pathological cases. The nontriviality of implies that is reduced, thus ensuring there are no self-loops in , since self-loops can only occur due to clauses  and .

If a multigraph is the associated multigraph of a -CNF , then we say  is supported on . A nontrivial -CNF is simple if its associated graph is simple. In such a case, we drop the prefix “multi-” and denote the associated graph simply by . We denote by  the following family of graphs

 U={G(S):S is an unsatisfiable simple % 2-CNF}.

Our aim in this paper is to characterize the elements of . First, we note that  is nonempty since

 S=(¬a∨¬b)∧(a∨c)∧(b∨c)∧(¬c∨d)∧(¬d∨¬e)∧(¬d∨¬f)∧(e∨f)

is an unsatisfiable simple -CNF supported on the following graph

## 4 Simple CNFs suffice

In this section, we show that every nontrivial reduced -CNF is equisatisfiable to a simple -CNF. Thus when studying satisfiability of -CNFs we only need consider those that are simple.

First, we make the observation that for any , there are at most two length  clauses, namely  and . Such clauses involving a single variable  (or its negation) will be referred to as -clauses. For every , there are at most four length  clauses, namely  and . Consequently, for any reduced -CNF , edges in  have a maximum multiplicity of . Such clauses involving both  and  (or their negations) will be referred to as -clauses.

###### Lemma 1

Let  and  be reduced CNFs. Let  such that  does not contain any -clauses.

1. If , then  is unsatisfiable.

2. If , then .

[Proof.] Let . We can simplify this as . Therefore,  is unsatisfiable.

Let . Any truth assignment that satisfies  must have  and must therefore satisfy . Conversely, consider truth assignment that satisfies . Recall that  denotes the reduced CNF resulting from replacing  with  and  with  in . Hence, the variable  (or its negation) are not present in . As a result, any truth assignment that satisfies  must leave the variable  unassigned. By additionally setting , we obtain an assignment that satisfies . We conclude that . ∎

###### Lemma 2

Let  and  be reduced -CNFs. Let  such that  does not contain any -clauses.

1. If , then  is unsatisfiable.

2. If , then .

3. If , then .

4. If , then .

5. If , then

[Proof.] Suppose  is of the form . Due to the logical implications  and , we can deduce the implication . Therefore,  is unsatisfiable.

Let . We note that the three -clauses of  imply . Hence any truth assignment that satisfies  must also satisfy . We can conclude that such an assignment must have . Hence this assignment must also satisfy . Thus,  satisfiable implies  satisfiable. Conversely, consider a truth assignment that satisfies . By additionally setting , we obtain an assignment that satisfies . We conclude .

Let . Since , any truth assignment that satisfies  must have . Thus, such a truth assignment must also satisfy . Conversely, consider a truth assignment that satisfies . By additionally setting , we obtain an assignment that satisfies . We conclude that .

Let . Since , by a similar reasoning to the previous case, we conclude that .

Lastly, let . Any truth assignment that satisfies  must map  and  to opposite truth values in order to satisfy the two -clauses. Thus, such a truth assignment must also satisfy . Conversely, consider a truth assignment that satisfies . In this truth assignment, we have no assignment for (as all occurrences of have been replaced by ). By additionally setting , we obtain an assignment that satisfies . We conclude that . ∎

###### Lemma 3

Let  be a reduced CNF with clauses of length at most .

1. If  has an -clause for some variable , then there exists a reduced -CNF  equisatisfiable to .

2. If  has four -clauses for some , then  is unsatisfiable.

3. If  has three or fewer -clauses for every , then there exists a -CNF  equisatisfiable to  such that either  is trivial or  is simple.

[Proof.] Let  be a reduced CNF having four -clauses for some . We can then write  in the form , where  is a reduced -CNF not containing any -clauses. By Lemma 2 (1), we conclude that  is unsatisfiable.

Let  have an -clause for some . The reduced CNF  has either exactly one or exactly two -clauses. If  has exactly two -clauses, then we can write , where  is a reduced CNF not containing any -clauses. By Lemma 1 (1), we conclude that  is unsatisfiable. Hence we can write , where  is the trivially false -CNF .

If  has exactly one -clause, then by exchanging  with  if needed, we can ensure that  is of the form , where  is a reduced CNF not containing any -clauses. By Lemma 1 (2), we conclude that . The reduced CNF  has no -clauses but might have (either one or two) -clauses for some other variable . By repeated application of Lemma 1 (1) and (2), we can find a resulting CNF  equisatisfiable to , and having no length  clauses. Since  has no length clauses, it is a -CNF.

Having dealt with the case when  has four -clauses for some , we can assume throughout the remainder of the proof that  has three or fewer -clauses for every . Also, having dealt with the case when  has an -clause for some , we can henceforth assume that  is a reduced -CNF.

Let  such that  has exactly two -clauses. By exchanging  with  and/or  with  we can ensure that one of the two -clauses is . Thus  has one of three forms, which we label  and

 S1=R∧(a∨b)∧(a∨¬b), S2=R∧(a∨b)∧(¬a∨b), S3=R∧ (a∨b)∧(¬a∨¬b),

where  is a reduced -CNF not containing any -clauses. Lemma 2 (3) implies that . We note that  is a reduced CNF with clauses of length either  or . By repeated application of Lemma 1 (1) and (2), we can again find a reduced -CNF  such that , and such that  (as opposed to ) has no -clauses. Repeating this process for every  such that  has exactly two -clauses gives us a resulting -CNF  equisatisfiable to  such that  has either three, or one, or zero -clauses for every .

Lemma 2 (4) implies that . By repeated application of Lemma 1 (1) and (2), we can again find an reduced -CNF  such that  and such that  (as opposed to ) has no -clauses. If has exactly two -clauses for some , then repeating the above process gives us a resultant -CNF  equisatisfiable to  such that  has either three, or one, or zero -clauses for every .

Lemma 2 (5) implies that . By repeated application of Lemma 1 (1) and (2), we can again find an reduced -CNF  such that  and such that  (as opposed to ) has no -clauses. If has exactly two -clauses for some , then repeating the above process gives us a resultant -CNF  equisatisfiable to  such that  has either four, or three, or one, or zero -clauses for every . If  has four -clauses for any , then just as before, we can replace with .

We can assume for the remainder of the proof that  itself is a reduced -CNF that has either three, or one, or zero -clauses for every . Let  be such that  has exactly three -clauses. By exchanging  with  and/or  with  we can ensure that the three -clauses are  and . Hence we can write , where  is a reduced -CNF not containing any -clauses. By Lemma 2 (2), we conclude that . The reduced CNF  does not have -clauses. By using procedures already described in this proof, we can find a reduced -CNF  equisatisfiable to  and having either three, or one, or zero -clauses for every . By repeating this procedure as many times as needed, we can find a resultant reduced -CNF  equisatisfiable to  such that  does not have three -clauses for any . Therefore, the reduced -CNF  has one or fewer -clauses for every . In other words, the reduced -CNF  is simple. ∎

## 5 U is closed under edge-contraction

Let be a simple graph. If is not contained in any triangle in , then edge-contraction of graph at edge results in a graph with

1. Vertex set , where is a new vertex not already in .

2. Edge set , where and are the set of neighboring vertices of and respectively, and .

For example, edge-contraction of   at the central edge results in  .

###### Lemma 4

If  is a simple graph having an edge  not contained in any triangle, then every simple -CNF  supported on  can be written in the form

 SH=S∧(⋀a∈Aa∨u)∧(⋀b∈Bb∨¬u)∧(⋀c∈Cc∨v)∧(⋀d∈Dd∨¬v)∧(u∨v),

where  is either trivially true or is a simple -CNF not containing  or ; and  and  are four subsets of  such that  and  are pairwise-disjoint.

[Proof.] If  is not already in the desired form, then it can be modified as follows

• If the -clause in  is negative in , then exchange  with .

• If the -clause in  is negative in , then exchange  with .

• For every  and for every , if the -clause in  is negative in , then exchange  with .

• For every  and for every , if the -clause in  is negative in , then exchange  with .∎

###### Theorem 5

If a simple graph  can be obtained by edge-contraction of a simple graph  at an edge not contained in a triangle, then .

[Proof.] Say  can be obtained by edge-contraction of  at  and  is not part of any triangle in . We denote by  the new vertex in  created by edge-contraction. If , then there exists an unsatisfiable simple -CNF , supported on . Since is not part of any triangle in , we have

 degG(w)=degH(u)+degH(v)−2, (1)

where the accounts for the deletion of the edge itself. The neighboring vertices of in can be partitioned into two disjoint sets and defined as

 N1(w) ={a∈V(G)∪¬V(G):(a∨w) is a % clause in SG}, and N2(w) ={a∈V(G)∪¬V(G):(a∨¬w) is a % clause in SG}.

We then have

 degG(w)=|N1(w)|+|N2(w)|. (2)

Combining Equations (1) and (2) gives

 |N1(w)|+|N2(w)|=degH(u)+degH(v)−2. (3)

Without loss of generality, we can assume . If this is not the case, then we simply declare  to be the variable (instead of ), thus interchanging the sets  and . We will further assume that . If this is not the case, then we simply exchange the variable  with  to make this true (both  and  cannot be strictly larger than  as that would violate Equation (3)). This also implies that . Lastly, we enumerate the elements of  and  as  and  respectively.

We can write without loss of generality

 SG=S∧⎛⎝|N1(w)|⋀i=1ai∨w⎞⎠∧⎛⎝|N2(w)|⋀j=1bj∨¬w⎞⎠, (4)

where is either trivially true or a simple -CNF not containing or as literals. We then define a simple -CNF supported on by

 SH=S∧⎛⎝degH(u)−1⋀i=1ai∨u⎞⎠∧⎛⎝|N2(w)|⋀j=1bj∨v⎞⎠∧⎛⎝|N1(w)|⋀k=degH(u)ak∨¬v⎞⎠∧(¬u∨¬v). (5)

One can confirm that this is indeed a sentence on  by counting the clauses to make sure that we have all the elements of  and  accounted for, while also respecting the vertex-degrees of  and  in . We now claim that  is unsatisfiable. We will prove this by showing that from any truth assignment that satisfies , we can obtain a truth assignment satisfying , leading to a contradiction.

Given a truth assignment for , we can extend it to a truth assignment for  by setting  if  is  and setting  if  is . Alternately, one can think of this as setting . We make the following observations about this truth assignment

• The -CNF  is a part of  and therefore the assignment satisfies .

• By setting  we have , which is a clause of  for every choice of the index .

• By the same assignment we have , which is a clause of  for every choice of the index .

• In the assignment, if  and  are assigned the same truth value, then for the  clause in  to be satisfied, we must have . Then by setting  we have

 (ai∨w)=(ai∨¬v)=(ai∨⊤)=⊤

for every .

• If, on the other hand, the variables  and  are assigned opposite truth values, then by setting  we have , which is a part of  for every .

Since this truth assignment satisfies every clause in , it contradicts the unsatisfiability of . We conclude that  is unsatisfiable, and hence .

Conversely, suppose that . There exists an unsatisfiable simple -CNF , supported on . By Lemma 4, since  is not contained in any triangle, we can write

 SH=S∧(⋀a∈Aa∨u)∧(⋀b∈Bb∨¬u)∧(⋀c∈Cc∨v)∧(⋀d∈Dd∨¬v)∧(u∨v),

where  is either trivially true or is a simple -CNF, and  and  are four subsets of  such that  and  are pairwise-disjoint. We then choose

 SG=S∧(⋀a∈A∪Da∨w)∧(⋀b∈B∪Cb∨¬w),

and then note that is a simple -CNF supported on . We now claim that  is unsatisfiable. We will prove this by showing that from any truth assignment that satisfies , we can obtain a truth assignment satisfying , leading to a contradiction.

Given a truth assignment for , we can extend it to a truth assignment for  by setting  and . We make the following observations about this truth assignment

• The CNF is a part of and therefore the assignment satisfies .

• By setting  and  we have , which is a part of  for every .

• By the same assignment we have , which is a part of  for every .

• By the same assignment we have , which is a part of  for every .

• By the same assignment we have , which is a part of  for every .

• Lastly, we also have

Since this truth assignment satisfies every clause in , it contradicts the unsatisfiability of . We conclude that is unsatisfiable, and hence . ∎

###### Theorem 6

Let and be simple graphs such that is a subgraph of . If , then .

[Proof.] If then there exists an unsatisfiable simple -CNF supported on . We denote by a simple -CNF supported on the graph with vertex set  and edge set . We then define a simple -CNF  as . The -CNF is supported on and is unsatisfiable since any truth assignment satisfying would also satisfy . Hence . ∎

Theorem 6 motivates the following definition — a graph is a minimal unsatisfiability graph if and for every proper subgraph of . Theorem 5 further prompts us to define the notion of a complete set of minimal unsatisfiability graphs — it is a set of minimal unsatisfiability graphs such that a graph is in  if and only if has a subgraph which can be reduced to some element of via a series of edge-contractions. Theorem 5 implies not only that such a complete set of minimal unsatisfiability graphs exists but also that it must be unique. The remainder of this paper is dedicated to finding this unique complete set of minimal unsatisfiability graphs.

## 6 K4−e and C3 are not in U

###### Lemma 7

Let denote the triangle graph. Let be a -CNF supported on . For every , the CNF is satisfiable.

[Proof.] We enumerate the vertex set of as . Without loss of generality, choose . has three clauses: an -clause, a -clause and an -clause. If needed, we interchange  with  and/or  with  to ensure that the -clause is positive in both and . If needed, we further interchange  with  in order to ensure that the -clause is positive in . The -CNF  can have one of two forms, which we label and

 S1=(a∨b)∧(a∨c)∧(b,c)-clause,
 S2=(a∨b)∧(¬a∨c)∧(b,c)-clause.

If , then gives us a single -clause. This single clause can be satisfied by making the appropriate assignment for either or .

If , then . This conjunction of a length clause with a length clause can be satisfied by setting  to  and then setting such that it satisfies the -clause. Thus, is satisfiable. Since  was an arbitrary element of , we can conclude that  is satisfiable for every . ∎

###### Lemma 8

.

[Proof.] Let be a -CNF on and let be a vertex of . By Lemma 7, the CNF is satisfiable. We claim that because a truth assignment that sets to satisfies iff it satisfies . Since implies , the -CNF itself must be satisfiable. Therefore, . ∎

###### Lemma 9

Let denote the graph obtained by deleting a single edge from the complete graph on four vertices, denoted . Then, .

[Proof.] We enumerate the vertex set of as . Let  denote the edge  such that . Let be a -CNF supported on . Then is composed of five clauses: an -clause, an -clause, an -clause, a -clause and a -clause.

If needed, we interchange with and/or with in order to ensure that the -clause is positive in both and . If needed, we further interchange with to ensure that the -clause is positive in .

The -CNF can have one of two forms, which we label and

 S1=(a∨d)∧(b∨d)∧S′1,
 S2=(a∨d)∧(b∨¬d)∧S′2,

where and are simple -CNFs supported on the triangle graph with vertex set .

If , then by setting to we obtain . Since  is supported on , by Lemma 8 the -CNF is satisfiable. On the other hand, if , then by setting  to  we get . However, we have  and by Lemma 7 the -CNF  is satisfiable. Hence every -CNF supported on is satisfiable, and therefore . ∎

## 7 Structure of graphs with two or three independent cycles

In this section we prove two lemmas about the structure of graphs that have two or three independent cycles. These structural results are needed for proving the results in Section 8 including the main result of this paper.

###### Lemma 10

If  is a connected simple graph having exactly two independent cycles, then  can be reduced to one of the following graphs via a series of edge-contractions at edges not contained in triangles

-configuration -configuration

For convenience, we have labeled the two graphs in Lemma 10 as the -configuration ( stands for vertex) and the -configuration ( stands for edge), respectively.

[Proof.] Let  be a connected simple graph with exactly two independent cycles. Edge-contractions can reduce a graph with leaf-edges (edges incident on a vertex of degree ) to a graph without leaf edges. Hence we assume without loss of generality that  has no leaf-edges. The two cycles in  either share (one or more) edges, or only share a single vertex or share neither edges nor vertices. (Sharing of more than one vertex while still having exactly two independent cycles is the same as sharing one or more edges).

If the two cycles in  share more than one edges, then they share a contiguous path. This path can be reduced via a series of edge-contractions till the path has length . This case has therefore been reduced to the instance where the two independent cycles share a single edge. If they share exactly one edge, then via a series of edge-contractions at edges other than the shared edge the cycles can be reduced till they each have length . In this case, we have reduced  to    .

If the two cycles in  share neither vertices nor edges, then since is connected, there must be (one or more) paths connecting vertices of one cycle to vertices of the other. However, since  has only two independent cycles, we conclude that there can be no more than one path connecting vertices of the two cycles. Edges on this single path can be subjected to a series of edge-contractions to result a graph with two independent cycles sharing a single vertex. This case has therefore been reduced to the instance where the two independent cycles share a single vertex.

If the two cycles in  share a single vertex then the edges in the cycles themselves can be subjected to a series of edge-contractions resulting in both cycles having length . However, a graph with two independent cycles of length , such that both cycles share a single vertex is isomorphic to  . ∎

###### Lemma 11

If  is a connected simple graph having three or more copies of  as subgraphs, then  must have at least one of the following  graphs as a subgraph

 ppp-config. #1 ppe-config. #2 vve-config. #1 pvv-configuration vve-config. #2

 ppv-config. #1 pve-configuration vee-configuration vvv-config. #1 eee-config. #1 vvv-config. #2 eee-config. #2

Labels for each of the graphs (like -config. ) are explained as part of the proof. The three copies of have been colored in the graphs for the sake of easy visual identification. Here denotes any path of length or greater and configurations with are actually not individual graphs but infinite families of graphs. Every pair of (taken from the three copies of in ) can share zero, one or two vertices among themselves. We label these possibilities by (for path), (for vertex) and (for edge) respectively. To ensure that we consider all possibilities, we need to specify the number of vertices shared by all three pairs of that exist in . We do this by enumerating the following “connection” possibilities: these are all the three-letter words formed by the letters and , with repetition, up to permutation of the letters

 pppppvppepvvpvepeevvvvveveeeee.

For example, the possibility is to be interpreted as the first pair of (copies of)  sharing no vertices (and being connected by a path instead), the second pair of  sharing a vertex and the third (and last) pair of sharing an edge.

Having enumerated all possible connections among the copies of in , we can now proceed to enumerate all graph “configurations” that satisfy these  connections, up to graph isomorphisms. We detail the deduction of the two possible -configurations and omit the rest as they can be similarly deduced. Suppose the copies of are connected in the  fashion. The first implies that two of the are connected as in