Next Article in Journal
On a Controlled Se(Is)(Ih)(Iicu)AR Epidemic Model with Output Controllability Issues to Satisfy Hospital Constraints on Hospitalized Patients
Previous Article in Journal
Special Issue on Bio-Inspired Algorithms for Image Processing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Convert a Strongly Connected Directed Graph to a Black-and-White 3-SAT Problem by the Balatonboglár Model

Faculty of Informatics, Eszterházy Károly University, 3300 Eger, Hungary
*
Author to whom correspondence should be addressed.
Submission received: 4 November 2020 / Revised: 30 November 2020 / Accepted: 30 November 2020 / Published: 3 December 2020
(This article belongs to the Section Combinatorial Optimization, Graph, and Network Algorithms)

Abstract

:
In a previous paper we defined the black and white SAT problem which has exactly two solutions, where each variable is either true or false. We showed that black and white 2-SAT problems represent strongly connected directed graphs. We presented also the strong model of communication graphs. In this work we introduce two new models, the weak model, and the Balatonboglár model of communication graphs. A communication graph is a directed graph, where no self loops are allowed. In this work we show that the weak model of a strongly connected communication graph is a black and white SAT problem. We prove a powerful theorem, the so called transitions theorem. This theorem states that for any model which is between the strong and the weak model, we have that this model represents strongly connected communication graphs as black and white SAT problems. We show that the Balatonboglár model is between the strong and the weak model, and it generates 3-SAT problems, so the Balatonboglár model represents strongly connected communication graphs as black and white 3-SAT problems. Our motivation to study these models is the following: The strong model generates a 2-SAT problem from the input directed graph, so it does not give us a deep insight how to convert a general SAT problem into a directed graph. The weak model generates huge models, because it represents all cycles, even non-simple cycles, of the input directed graph. We need something between them to gain more experience. From the Balatonboglár model we learned that it is enough to have a subset of a clause, which represents a cycle in the weak model, to make the Balatonboglár model more compact. We still do not know how to represent a SAT problem as a directed graph, but this work gives a strong link between two prominent fields of formal methods: the SAT problem and directed graphs.

1. Motivation

In logic the most natural representation of an edge of a directed graph, say a b , is to use implication—i.e., a b ; i.e., the edge a b can be represented by the binary clause: ( ¬ a b ) . We used that representation in a previous paper [1] and we were able to prove that the SAT representation of a strongly connected directed graph is a black and white 2-SAT problem. It is not a surprise that the SAT representation is a 2-SAT problem, since each edge can be represented by a binary clause.
The other property, black and white, means that the resulting SAT problem is "nearly" unsatisfiable; that means it has only two solutions, the white assignment and the black one. The white assignment assigns true to each variable; the black one assigns false to each variable.
This representation helps to translate a graph into a 2-SAT problem. We can also translate a black and white 2-SAT problem into a directed graph. We can also translate any other 2-SAT problem into a directed graph, if it does not subsume either the black or the white clause—i.e., it does not contain a clause which contains only positive or negative literals, for instance, ( a b ) or ( ¬ a ¬ b ) .
There are some natural questions. Why should we translate a 2-SAT problem into a direct graph? What can one do with clauses which contain only positive or negative literals?
Actually, there is no point to translating a 2-SAT problem into a directed graph, because the 2-SAT problem is solvable in linear time [2]. Preferably, we should translate 3-SAT problems into directed graphs, because then we could use graphical tools to study them, or we can translate them into 2-SAT problems. To be able to do so, the first step is to create a 3-SAT representation for directed graphs. The second step should answer the second question—what can one do with clauses which contain only positive or negative literals?
This paper aims to help to answer the first question. We present several models which can translate a directed graph into a SAT problem such that the SAT problem is black and white if and only if the directed graph is strongly connected.
The second question is answered partially in another study from our research group (http://fmv.ektf.hu/team.html); see [3].

2. Introduction

In recent years one of the most promising directions in mathematics has been the idea that one can unify various mathematical theories. One excellent example of this is the Langlands [4] program, which relates algebraic number theory to automorphic forms and representation theory. Another very interesting example is the modularity theorem [5]. This theory states that elliptic curves over the field of rational numbers are related to modular forms. Without this modularity theorem, Andrew Wiles could not have proven Fermat’s last theorem [6]. In this paper, we show some connection points between directed graphs and propositional logic formulas. We prove a theorem which allows one to use an algorithm from the field of propositional logic to check a graph property. Namely, we transform a directed graph into a SAT problem to check whether the graph is strongly connected or not.
The most well-known graphical representations are: the implication graph [2], the and-inverter graph [7], the reduced ordered binary decision diagram [8] and the zero-suppressed binary decision diagram [9]. Graphical representations of logical games stand as a well-known connection between graphs and logical formulas; see, for example, [10,11]. A more detailed list can be found in [12].
As we can see, great effort has been made in the direction of formulas to graphs. In this paper, we study the other way, the direction of graphs to formulas.
In a previous paper [1] we showed how to convert a directed graph into a 2-SAT problem. In this paper, we aim to translate directed graphs into 3-SAT problems.

3. Definitions

Negation of a set H is denoted by ¬ H , which means that all elements in H are negated. Note that ¬ ¬ H = H .
A literal is normally a Boolean variable—a positive literal; the negation of a Boolean variable is called a negative literal. Examples for literals are: a , ¬ a , b , ¬ b , .
A clause is a set of literals. A clause set is a set of clauses. A SAT problem is a clause set. An assignment is a set of literals.
Clauses are interpreted as disjunctions of their literals. Assignments are interpreted as conjunctions of their literals. Clause sets are interpreted as conjunctions of their clauses.
If a clause or an assignment contains exactly k literals, then we say it is a k-clause or a k-assignment, respectively. A k-SAT problem is a clause set where its clauses have at most k literals. A clause from a clause set is a full-length clause if and only if (iff) it contains all variables from the clause set.
If a is a literal in clause set S, and ¬ a is not a literal in S, then we say that a is a pure literal in S.
Let V be the set of variables of a clause set. We say that W W is the white clause or the white assignment iff W W = V . We say that B B is the black clause or the black assignment iff B B = ¬ V . For example, if V = { a , b , c } , then W W = { a , b , c } , and B B = { ¬ a , ¬ b , ¬ c } .
We say that clause C subsumes clause D iff C is a subset of D.
We say that clause set S subsumes clause C iff there is a clause in S which subsumes C. Formally: S s u b s u m e s C D ( D S D C ) .
We say that assignment M is a solution for clause set S iff for all C S we have M C { } .
We say that the clause set S is a black and white SAT problem iff it has only two solutions, the white assignment ( W W ) and the black one ( B B ).
We say that clause sets A and B are equivalent iff they have the same set of solutions. We say that clause set A entails clause set B iff the set of solutions of A is a subset of the set of solutions of B; i.e., A may have no other solutions than B. This notion is denoted by A B . Note that if A subsumes all clauses of B, then A B .
We say that A is stronger than B iff A B and A and B are not equivalent. This notion is denoted by A > B .
The construction D = ( V , E ) is a directed graph, where V is the set of vertices, and E is the set of edges. An edge is an ordered pair of vertices. The edge ( a , b ) is depicted by a b , and we can say that a has a child b. If ( a , b ) is an element of E , then we may say that ( a , b ) is an edge of D .
We say that D is a communication graph iff for all a in V have that ( a , a ) is not in E , and if x is an element of V then ¬ x must not be an element of V . We need this constraint because we generate a logical formula out of D . If we speak about a communication graph then we may use the word node as a synonym of vertex.
A path from a 1 to a j in directed graph D is a sequence of vertices a 1 , a 2 , , a j such that for each i { 1 , , j 1 } we have that ( a i , a i + 1 ) is an edge of D . A path from a 1 to a j in directed graph D is a cycle iff ( a j , a 1 ) is an edge of D . The cycle a 1 , a 2 , , a j , a 1 is represented by the following tuple: ( a 1 , a 2 , , a j ) . This tuple can be used as a set of its elements. Note that in the representation of a cycle the first and the last element must not be the same vertex. Figure 1 shows an example for a path and a cycle.
If we have a cycle ( a 1 , a 2 , , a n ) then b is an exit point of it iff for some j { 1 , 2 , , m } we have that ( a j , b ) is an edge and b { a 1 , a 2 , , a n } .
A directed graph is complete iff every pair of distinct vertices is connected by a pair of unique edges (one in each direction). A directed graph is strongly connected iff there is a path from each vertex to each other vertex. Note that a complete graph is also strongly connected. Note that a strongly connected graph contains a cycle which contains all vertices.

4. The Strong Model of Communication Graphs

In our previous model [1], which we call in this paper the strong model of communication graphs, edges are represented by logical implication: Let us assume that the graph D is ( { a , b , c } , { ( a , b ) , ( a , c ) } ) ; i.e., D is a graph with three vertices, a, b and c, and with two edges, from a to b and from a to c. Thus, the strong model of D is ( a b ) ( a c ) .
The interpretation of this formula is the following in the field of wireless sensors networks: If node a is able to send a message to nodes b and c, then node a sends the message to both nodes b and c. However, this might result in an error, because both nodes have to send an acknowledgment that the message has arrived, but using the same frequency at the same time results in interference. A more natural way of communication is that we use some protocol, which decides where to send the message, either to node b or to node c; see the next section.
The strong model was defined formally in our previous work [1]. We recall its definition.
Let D = ( V , E ) be a communication graph; then the strong model of D is denoted by SM , and defined as follows:
SM : = { { ¬ a , b } | ( a , b ) E } .
Note that SM is a 2-SAT problem and has a nice property: each clause in it has exactly one positive and one negative literal; therefore, SM is satisfiable for any communication graph D .
Furthermore, SM is a black and white SAT problem iff D is strongly connected; see Theorem 1 in [1]. Since we use this theorem several times herein, we recall it:
Theorem 1
(Theorem 1 from [1]). Let D be a communication graph. Let SM be the strong model of D . Then SM is a black and white 2-SAT problem if and only if D is strongly connected.
As an example we show the strong model of the communication graph of Figure 2:
SM = { { ¬ a , b } , { ¬ a , c } , { ¬ b , a } , { ¬ b , c } , { ¬ b , d } , { ¬ c , a } , { ¬ c , d } } .
Note that since the communication graph from Figure 2 is not strongly connected, its strong model (1) is not a black and white SAT problem. For example, { ¬ a , ¬ b , ¬ c , d } is a solution of it.
As a second example we show the strong model of the communication graph from Figure 3. This graph is almost the same as the previous one (Figure 2), but here we have an edge from d to a, which makes this graph strongly connected. Its strong model is:
SM = { { ¬ a , b } , { ¬ a , c } , { ¬ b , a } , { ¬ b , c } , { ¬ b , d } , { ¬ c , a } , { ¬ c , d } , { ¬ d , a } } .
Note that since the communication graph from Figure 3 is strongly connected, its strong model is a black and white SAT problem; i.e., the SAT problem in (2) has only these two solutions: { a , b , c , d } and { ¬ a , ¬ b , ¬ c , ¬ d } .
It is not easy to check that this SAT problem is indeed a black and white SAT problem. Therefore, first we show the set of all full-length clauses on the variables { a , b , c , d } with an index number (index number: full-length clause):
{ 0 : { ¬ a , ¬ b , ¬ c , ¬ d } , 1 : { ¬ a , ¬ b , ¬ c , d } , 2 : { ¬ a , ¬ b , c , ¬ d } , 3 : { ¬ a , ¬ b , c , d } , 4 : { ¬ a , b , ¬ c , ¬ d } , 5 : { ¬ a , b , ¬ c , d } , 6 : { ¬ a , b , c , ¬ d } , 7 : { ¬ a , b , c , d } , 8 : { a , ¬ b , ¬ c , ¬ d } , 9 : { a , ¬ b , ¬ c , d } , 10 : { a , ¬ b , c , ¬ d } , 11 : { a , ¬ b , c , d } , 12 : { a , b , ¬ c , ¬ d } , 13 : { a , b , ¬ c , d } , 14 : { a , b , c , ¬ d } , 15 : { a , b , c , d } } ,
As a second step, we give which clause from (2) subsumes which full-length clauses (clause: indices of subsumed full-length clauses):
SM = { { ¬ a , b } : 4 , 5 , 6 , 7 , { ¬ a , c } : 2 , 3 , 6 , 7 , { ¬ b , a } : 9 , 10 , 11 , 12 , { ¬ b , c } : 2 , 3 , 10 , 11 , { ¬ b , d } : 1 , 3 , 9 , 11 , { ¬ c , a } : 8 , 9 , 13 , 14 , { ¬ c , d } : 1 , 5 , 9 , 13 , { ¬ d , a } : 8 , 10 , 12 , 14 } .
From this one can check that (2) subsumes all full-length clauses, except the black and the white clause; hence, it has only two solutions, the white and the black assignment.

5. The Weak Model of Communication Graphs

We define the weak model of communication graphs. Let us assume that D = ( { a , b , c } , { ( a , b ) , ( a , c ) } ) , as in the previous section. The weak model of D contains the clause ( a b ) ( a c ) , which means that if a node can send a message to more than one nodes, then it can send the message only to one of them. Note that ( a b ) ( a c ) is equivalent to ( ¬ a b c ) .
The only problem with this representation is that the message can be trapped if a graph contains a cycle. Let us assume that we have a cycle with two nodes, n 1 and n 2 . Then n 1 may send the message to n 2 , and n 2 to n 1 , and so on, which means that other nodes could never get the message. This is not good, since our goal is to send a message to each node, if it is possible.
Let us add a new edge to the graph ( { a , b , c } , { ( a , b ) , ( a , c ) } ) . The new edge should go from b to a. Now we have a cycle with the nodes a and b. Now we have to add a clause to our model which ensures that if b sends a message to a, and a can send a message to b or c, then a should not send back the message to b, but it has to send it to c: ( ( b a ) ( a ( b c ) ) ( a c ) . Note that this is equivalent to the clause: ( ¬ a ¬ b c ) .
In a more general way, node a which has outgoing edges to nodes b 1 , b 2 , , b k is represented by the clause: ( ¬ a b 1 b 2 b k ) ; and the cycle a 1 , a 2 a n , a 1 with exit points b 1 , b 2 , , b m is represented by the clause: ( ¬ a 1 ¬ a 2 ¬ a n b 1 b 2 b m ) . We call this model as the weak model of communication graphs.
We also define it formally: Let D be a communication graph. Let V be the set of vertices of D and E the set of edges of D . Since D is a communication graph, we know that elements of V can be used as positive literals. Then we define the following notion:
O u t E ( a ) : = { b | ( a , b ) E } .
N o d e R e p ( a ) : = { ¬ a } O u t E ( a ) .
N o d e R e p : = { N o d e R e p ( a ) | a V O u t E ( a ) } .
C y c l e s : = { ( a 1 , a 2 , , a k ) | k = 1 i = 1 k ( a ( i m o d k ) + 1 O u t E ( a i ) } ,
and for any two elements of C y c l e s they cannot be equal as a set.
E x i t P o n t s ( ( a 1 , a 2 , a k ) ) : = { b | i = 1 k ( b O u t E ( a i ) ) ¬ j = 1 k ( b = a j ) } .
C y c l e R e p : = { ¬ C E x i t P o n t s ( C ) | C C y c l e s E x i t P o n t s ( C ) } .
WM : = N o d e R e p C y c l e R e p .
WM is the weak model of D .
Note that N o d e R e p is a subset of C y c l e R e p , because we take each node itself as a cycle; see the constraint k = 1 in the definition of C y c l e R e p . Thus, alternatively we can define WM as follows: WM : = C y c l e R e p . We do not use this observation in this work, although some proofs would be shorter.
Please note that each clause in WM contains at least one positive and one negative literal, because a node is only represented if it has an outgoing edge, and a cycle is only represented if it has an exit point; therefore, SM is satisfiable for any communication graph D .
Figure 4 shows two simple communication graphs. Their N o d e R e p values are: { { ¬ a , b , c } } , and { { ¬ a , b , c , d } } , respectively.
Figure 2 shows a communication graph with three cycles:
( a , b ) , ( a , b , c ) , ( a , c ) .
Thus, its weak model is (after each clause we list the indices of subsumed full-length clauses from (3)):
WM = { { ¬ a , b , c } : 6 , 7 , { ¬ b , a , c , d } : 11 , { ¬ c , a , d } : 9 , 14 , { ¬ a , ¬ b , c , d } : 3 , { ¬ a , ¬ b , ¬ c , d } : 1 , { ¬ a , ¬ c , b , d } : 5 } .
Note that since d has no child node, it does not occur as a negative literal in the model.
Note that since the communication graph from Figure 2 is not strongly connected, its weak model (5) is not a black and white SAT problem. For example, { ¬ a , ¬ b , ¬ c , d } is a solution of the SAT problem in (5).
As a second example we show the weak model of the communication graph from Figure 3. In this graph we have six cycles:
( a , b ) , ( a , b , c ) , ( a , c ) , ( a , b , d ) , ( a , c , d ) , ( a , b , c , d ) .
The last cycle contains all vertices, so it has no exit point; therefore, no clause is generated for it. Note that in this graph we have an edge from d to a. The corresponding clauses are the last three clauses in this example; the last two clauses correspond to the new cycles. The remaining clause is the same as in the previous model. Thus, the weak model is (after each clause we list the indices of subsumed full-length clauses from (3)):
WM = { { ¬ a , b , c } : 6 , 7 , { ¬ b , a , c , d } : 11 , { ¬ c , a , d } : 9 , 14 , { ¬ a , ¬ b , c , d } : 3 , { ¬ a , ¬ b , ¬ c , d } : 1 , { ¬ a , ¬ c , b , d } : 5 { ¬ d , a } : 8 , 10 , 12 , 14 , { ¬ a , ¬ b , ¬ d , c } : 2 , { ¬ a , ¬ c , ¬ d , b } : 4 } .
Note that since the communication graph from Figure 3 is strongly connected, its weak model is a black and white SAT problem; i.e., the SAT problem in (6) has only these two solutions: { a , b , c , d } and { ¬ a , ¬ b , ¬ c , ¬ d } .
Each cycle was a simple cycle in the above two examples. A cycle is simple iff only the first and last vertices are repeated. Thus, we might think that it is enough to consider simple cycles. The next example shows a case when we need to consider a non-simple cycle as well.
In Figure 5 we can see a strongly connected communication graph which contains three simple cycles, ( a , b ) , ( a , b , c , d ) and ( b , c ) , and one non-simple cycle, ( a , b , c , b ) . As a third example we give the weak model of this communication graph (after each clause we list the indices of subsumed full-length clauses from (3)):
WM = { { ¬ a , b } : 4 , 5 , 6 , 7 , { ¬ b , a , c } : 10 , 11 , { ¬ c , b , d } : 5 , 13 , { ¬ d , a } : 8 , 10 , 12 , 14 , { ¬ a , ¬ b , c } : 2 , 3 , { ¬ b , ¬ c , a , d } : 9 , { ¬ a , ¬ b , ¬ c , d } : 1 } .
Note that the last clause is generated from the non-simple cycle, and that full-length clause is not subsumed by any other clause.

6. The Balatonboglár Model of Communication Graphs

Since the weak model does not result in a 3-SAT problem, we introduce also the Balatonboglár model, which is a simplified version of the weak model, which uses the trick that instead of detecting each cycle in the graph, it generates from each path a , b , c the following 3-clause: ( ¬ a ¬ b c ) even if there is no cycle which contains the vertices a and b. This simplification allows very fast 3-SAT model generation from a directed graph, and the model will be black and white 3-SAT if and only if the input directed graph is strongly connected.
We define the Balatonboglár model of communication graphs as follows. Let D be a communication graph. Let V be the set of vertices of D and E the set of edges of D . Since D is a communication graph, we know that elements of V can be used as positive literals. Then we define the following notion:
N o d e R e p 2 : = { { ¬ a , b } | a V { b } = O u t E ( a ) } .
N o d e R e p 3 ( a ) : = { ¬ a , b , c } , w h e r e a V b O u t E ( a ) c O u t E ( a ) b c .
N o d e R e p 3 : = { N o d e R e p 3 ( a ) | a V } .
T a g F o r w a r d : = { { ¬ a , ¬ b , c } | a V b O u t E ( a ) c O u t E ( b ) a b c } .
BM : = N o d e R e p 2 N o d e R e p 3 T a g F o r w a r d .
BM is a Balatonboglár model of D .
Note that N o d e R e p 3 ( a ) is not a deterministic function, it is just any 3 length subset of N o d e R e p ( a ) .
The name T a g F o r w a r d comes from the children’s game tag: There is one child who has to catch someone else by touching he or she. This action is called tagging. There is a rule: the tagged one cannot tag back; he or she must tag someone else, so must tag forward.
As a first example, we give the Balatonboglár model of the graph from Figure 2 (after each clause we list the indices of subsumed full-length clauses from (3)):
BM = { { ¬ a , b , c } : 6 , 7 , { ¬ b , c , d } : 3 , 11 , { ¬ c , a , d } : 9 , 13 , { ¬ a , ¬ b , c } : 2 , 3 , { ¬ a , ¬ b , d } : 1 , 3 , { ¬ a , ¬ c , b } : 4 , 5 , { ¬ a , ¬ c , d } : 1 , 5 , { ¬ b , ¬ c , a } : 8 , 9 , { ¬ b , ¬ c , d } : 1 , 9 } .
Note that b has three child nodes, so instead of { ¬ b , c , d } , we could use either { ¬ b , a , c } or { ¬ b , a , d } . Note also that Figure 2 is not strongly connected, so its Balatonboglár model is not a black and white SAT problem. For example, { ¬ a , ¬ b , ¬ c , d } is a solution of the SAT problem in (8).
As a second example, we show the Balatonboglár model of the communication graph from Figure 3. Note that in this graph we have an edge from d to a. The corresponding clauses are the last three clauses in this Balatonboglár model: (after each clause we list the indices of subsumed full-length clauses from (3)):
BM = { { ¬ a , b , c } : 6 , 7 , { ¬ b , c , d } : 3 , 11 , { ¬ c , a , d } : 9 , 13 , { ¬ d , a } : 8 , 10 , 12 , 14 , { ¬ a , ¬ b , c } : 2 , 3 , { ¬ a , ¬ b , d } : 1 , 3 , { ¬ a , ¬ c , d } : 1 , 5 , { ¬ b , ¬ c , a } : 8 , 9 , { ¬ b , ¬ c , d } : 1 , 9 , { ¬ b , ¬ d , a } : 8 , 10 , { ¬ c , ¬ a , b } : 4 , 5 , { ¬ c , ¬ d , a } : 8 , 12 , { ¬ d , ¬ a , b } : 4 , 6 , { ¬ d , ¬ a , c } : 3 , 7 } .
Note that since the communication graph from Figure 3 is strongly connected, its Balatonboglár model is a black and white SAT problem; i.e., the SAT problem in (9) has only these two solutions: { a , b , c , d } , and { ¬ a , ¬ b , ¬ c , ¬ d } .
As a third example, we show the Balatonboglár model of the communication graph from Figure 5 (after each clause we list the indices of subsumed full-length clauses from (3)):
BM = { { ¬ a , b } : 4 , 5 , 6 , 7 , { ¬ b , a , c } : 10 , 11 , { ¬ c , b , d } : 5 , 13 , { ¬ d , a } : 8 , 10 , 12 , 14 , { ¬ a , ¬ b , c } : 2 , 3 , { ¬ b , ¬ c , a } : 8 , 9 , { ¬ b , ¬ c , d } : 1 , 9 , { ¬ c , ¬ d , a } : 8 , 12 , { ¬ a , ¬ d , b } : 4 , 6 } .
Since there is no node which has more than two child nodes, there is no other possible Balatonboglár model for this graph.
Note that since the communication graph from Figure 5 is strongly connected, its Balatonboglár model (10) is a black and white SAT problem.
Our long term goal is to find out how to represent a 3-SAT problem as a directed graph. This model does not tell us how to do that; it gives only a link from the field of directed graphs to the field of 3-SAT problems, which might help us to find out in the future how to represent a 3-SAT problem as a directed graph. Thus, this remains an open question, which seems to be a very difficult one, because if we are able to translate a 3-SAT problem into a directed graph, then we could translate it to a 2-SAT problem using the result of our previous work, which means that we would have a 3-SAT to 2-SAT converter.

7. Theoretical Results

This section is the main contribution of this work. We prove that the new models, the weak one and the Balatonboglár one, have the same property as the strong one; i.e., the model of a communication graph is a black and white SAT problem iff the graph is strongly connected. To be able to prove this, we need some auxiliary lemmas. The first one states that the weak model has at least two solutions, the white one and the black one.
Lemma 1.
Let D be a communication graph. Let WM be the weak model of D . Then WM has at least two solutions, namely, the white assignment ( W W ) and the black assignment ( B B ).
Proof. 
Let D be a communication graph. Let WM be the weak model of D . Since there is a positive and also a negative literal in each clause of WM , the white assignment ( W W ) and also the black assignment ( B B ) are solutions for WM . □
The second lemma states that if the weak model has only two solutions, then each cycle in the communication graph has at least one exit point, except the cycle which contains all vertices of the graph.
Lemma 2.
Let D be a communication graph. Let WM be the weak model of D . Assume that WM has only two solutions. Then for each cycle C C y c l e s we have that E x i t P o n t s ( C ) is not empty or C contains all vertices of D .
Proof. 
Let D be a communication graph. Let WM be the weak model of D . Assume that WM has only two solutions. Lemma 1 makes sure that the solutions are W W and B B . Assume that our goal is not true; i.e., there is a cycle C = ( a 1 , a 2 , , a k ) , which has no exit point and does not contain all vertices of D . We show that this assumption leads to a contradiction. Let us construct the following assignment: { a 1 , , a k , ¬ b 1 , ¬ b m } , where { b 1 , b 2 , , b m } = V C , where V is the set vertices of D . Since C has no exit point, there is no corresponding clause generated by C y c l e R e p . Since there is no clause which would falsify the constructed assignment, this is a solution of WM . However, this contradicts the assumption that WM has only two solutions—namely, W W and B B . Thus, our original statement is true. □
The next lemma states that a black and white SAT problem may not contain pure literals.
Lemma 3.
If S is a black and white SAT problem, then it contains no pure literal.
Proof. 
Assume S is a black and white SAT problem. Then, by definition of a black and white SAT problem, we know that S has only two solutions, W W and B B . Since there is no other solution of S and ¬ W W = B B , we obtain that S may not contain a pure literal. □
The next lemma states that if we have a complete graph, then its weak model is a black and white SAT problem. This result is somehow natural, since the weak model of a complete graph is the biggest possible that we can generate and the weak model always has at least two solutions.
Lemma 4.
If D is a complete communication graph, and WM is the weak model of D , then WM is a black and white SAT problem.
Proof. 
Assume D is a complete communication graph. Assume WM is the weak model of D . Since D is complete, for any vertex a we have that O u t E ( a ) contains all other vertices, so N o d e R e p contains all full-length clauses with one negative literal. Since any two vertices create a cycle where the exit points are the rest of the vertices, C y c l e R e p contains all full-length clauses with two negative literals. The same is true for any k = 2 n 1 vertices, so C y c l e R e p contains all full-length clauses with 2 , , n 1 negative literals. However, WM does not subsume the full-length clause with no negative literals, i.e., the white clause ( W W ), nor the full-length clause with n negative literals, i.e., the black clause ( B B ). This means that WM has only two solutions, the white and the black assignment; i.e., WM is a black and white SAT problem. □
Now comes one of our main contributions, the theorem which states that the weak model of a strongly connected graph is a black and white SAT problem, which means that if the graph is strongly connected, then the weak model has the same power as the strong model. Since the proof is rather technical, we give also a high-level proof of it.
From left to right we prove the theorem in a constructive way: Let us have a sequence of vertices which can be built by Lemma 3 and by the construction of N o d e R e p . Eventually we will find a cycle at the end of this sequence. Lemma 2 ensures that there is an exit point from this cycle, which either results in a bigger cycle, or in a longer sequence. Using these two steps, eventually we construct a strongly connected component. From Lemma 2 it follows that it is also maximal (otherwise there would be an exit point from it which would allow one to do the above steps); i.e., the graph is strongly connected.
From right to left we use induction: We start the proof from a complete graph. We know that complete graphs are also strongly connected. As the induction step, we drop an edge from this graph such that it remains strongly connected. We assume that before the drop the weak model was black and white, which is true by Lemma 4. We show that it remains black and white also after the drop. To show this, we show that each clause in the model after the drop is a subset of some clause from the mode before the drop. Thus, the new model may not have more solutions then the old one. However, the new model has to have at least two solutions by Lemma 1. Thus, the new model is black and white. Since our graph can be constructed by dropping edges from a complete graph, which has the same set of vertices, its weak model is also black and white.
Theorem 2.
Let D be a communication graph. Let WM be the weak model of D . Then WM is a black and white SAT problem if and only if D is strongly connected.
Proof. 
Let D be a communication graph. Let WM be the weak model of D . We show that WM is a black and white SAT problem if and only if D is strongly connected.
(From left to right:) We assume WM is a black and white SAT problem; we show by construction that D is strongly connected.
(R0) Let a 1 be a vertex from D . Let j = 1 .
(R1) Now we have a sequence of vertices: a 1 , , a j . We work with its last vertex: a j . From Lemma 3 we know that literal a j is not pure in WM , so ¬ a j is present in WM . Thus, there must be a clause in WM generated be N o d e R e p for vertex a j . Since N o d e R e p is a subset of C y c l e R e p , by Lemma 2, there is a clause { ¬ a j , b 1 , , b k } in WM . Let a j + 1 be a vertex from b 1 , , b k such that a j + 1 is not in { a 1 , , a j } . If this is possible, then let j = j + 1 and go to (R1). Note that this is not always possible because D is a final graph, so eventually each vertex from b 1 , , b k must be in the set { a 1 , , a j } . In this case let a j + 1 be a vertex from b 1 , , b k such that a j + 1 = a i , where i < j and i is the smallest possible. This means that we have i such that i < j and a i = a j + 1 ; i.e., ( a i , , a j ) is a cycle. Go to (R2).
(R2) Now we have a sequence of vertices a 1 , , a j , and the end of this sequence from a i to a j is a cycle. If i = 1 and the cycle contains all the vertices from D , then go to (R3). Otherwise, by creation of C y c l e R e p and by Lemma 2 we know that WM contains a clause { ¬ a i , , ¬ a j , b 1 , , b m } , where b 1 , , b m are exit points of the cycle ( a i , , a j ) . Let a j + 1 be a vertex from b 1 , , b m such that a j + 1 is not present in a 1 , , a j . If this is possible, then let j = j + 1 , and go to (R1). Note that this is not always possible because D is a final graph. so eventually each vertex from b 1 , , b k must be in the set { a 1 , , a j } . In this case let a j + 1 be a vertex from b 1 , , b m , such that a j + 1 = a i and i is the smallest possible. Since b 1 , , b m are exit points of the cycle ( a i , , a j ) , we know that i is smaller than i because each vertex from b 1 , , b m is different from a i , , a j . This means that we have i such that i < j , and i < i and a i = a j + 1 ; i.e., ( a i , , a j ) is a cycle. Let i = i , and go to (R2).
(R3) Eventually (R2) exists to (R3) because, by Lemma 2, each cycle has at least one exit point, which results in a bigger cycle, or in a longer a 1 , , a j sequence of vertices. Thus, eventually the sequence a 1 , , a j will contain all vertices, and eventually i will be 1, so eventually we will find a cycle which contains all vertices. Hence, D is strongly connected.
(From right to left:) We assume D is strongly connected; we show by induction that WM is a black and white SAT problem. Let H be the complete communication graph which has the same set of vertices as D . We know from Lemma 4 that the weak model of H is a black and white SAT problem. This is our induction base. It is well known that complete graphs are also strongly connected. We create G from H by deleting edges from H such that G remains strongly connected. Let Z be the weak model of G. Our induction hypothesis is that Z is a black and white SAT problem. Our induction step is that we delete an edge from G such that it remains strongly connected. Let G be this graph. Let Z be the weak model of G . We show that Z is a black and white SAT problem. To show this, we show that Z Z ; i.e., Z subsumes all clauses from Z. Without loss of generality let us assume that we deleted the edge from vertex a to vertex b. All clauses from Z are the same as the clauses of Z , except the ones generated by C y c l e R e p for those cycles which contain a. From those clauses let D = { ¬ a 1 , , ¬ a k , b 1 , , b m } be an arbitrary but fixed one, where ( a 1 , , a k ) is a cycle in Z and b 1 , , b m are its exit points. We know that k > = 1 and a = a i for some i { 1 , , k } , and b is one of the other vertices from this clause. There are the following cases:
  • If b is one of the exit points and some other vertex from the cycle has an edge to b, then Z contains the same clause: D.
  • If b is one of the exit points, say b = b p , where p { 1 , , m } , and no other vertex from the cycle has an edge to b, then Z contains the clause { ¬ a 1 , , ¬ a k , b 1 , , b p 1 , b p + 1 , b m } , which is a subset of D. Note that the vertex sequence b 1 , , b p 1 , b p + 1 , b m contains some vertices, because G is a strongly connected graph; i.e., each cycle has an exit point, unless it contains all vertices.
  • If b is one of the other vertices of the cycle, but b is not the next vertex after a in this cycle, then Z contains the same clause, D.
  • If b is one of the other vertices of the cycle, and b is the next vertex after a in this cycle, then a 1 , , a k is not a cycle in Z . If there is no other child vertex of a in { a 1 , , a k } , then the clause generated by N o d e R e p for a in G is a subset of D. If there are other child vertices of a in { a 1 , , a k } , then there must be a subset of { a 1 , , a k } which contains all other child vertices of a except b, and which is a cycle in G . The clause generated by C y c l e R e p for this cycle in G is a subset of D.
We showed that Z subsumes all clauses from Z. This means that Z Z ; i.e., Z may have no other solutions than Z. By our induction, hypothesis Z has only two solutions, B B and W W . We know from Lemma 1 that B B and W W are solutions for Z , because Z is a weak model. In addition, since Z may have no other solution, Z is a black and white SAT problem. This means that the weak model of any strongly connected communication graph is a black and white SAT problem. Hence, WM is a blacked-and-white SAT problem, because D is strongly connected and WM is its weak model. □
The following lemma states that SM entails WM for any communication graph. This means that any solution of SM is also a solution of WM . To show this, it is enough to show that SM subsumes all clauses from WM .
Lemma 5.
Let D be a communication graph. Let SM be the strong model of D . Let WM be the weak model of D . Then SM WM .
Proof. 
Assume D is a communication graph, SM is the strong model of D and WM is the weak model of D . We show that SM WM . To show this, it is enough to show that SM subsumes all clauses from WM . Let C is an arbitrary but fixed element of WM . If C is an element of N o d e R e p , then, without loss of generality, we may assume that C = { ¬ a , b 1 , b 2 , , b k } , where k > 0 . From the construction of N o d e R e p we know that in D there are the following edges: ( a , b 1 ) , ( a , b 2 ) , , ( a , b k ) . Since SM is generated from the same graph, by its definition we know that SM contains the clauses { ¬ a , b 1 } , { ¬ a , b 2 } , , { ¬ a , b k } and all of these ones subsume C.
If C is an element of C y c l e s , then, without loss of generality, we may assume that C = { ¬ d 1 , ¬ d 2 , , ¬ d m , e 1 , e 2 , , e n } , where m > 0 , and n > 0 . From the construction of C y c l e s we know that in D there is an edge: ( d , e ) such that d is one of the vertices from d 1 , d 2 , , d m , and e is one of the vertices from e 1 , e 2 , , e m . Since SM is generated from the same graph, by its definition we know that SM contains the clauses { ¬ d , e } , which subsumes C.
Hence, SM WM . □
The following lemma states that SM and WM are equivalent if the represented communication graph is strongly connected or there are no branches in the graph. If the communication graph is strongly connected, then both SM and WM are black and white SAT problems, so they are equivalent.
Lemma 6.
Let D be a communication graph. Let SM be the strong model of D . Let WM be the weak model of D . If
(I) 
D is strongly connected, or
(II) 
Each vertex in D has only one child,
then SM and WM are equivalent.
Proof. 
In the case of (I) we know that D is strongly connected, so by Theorem 1, and by Theorem 2 we know that SM and WM are black and white SAT problems, so by the definition of clause set equivalent-ness they are equivalent. In case of (II) we have that N o d e R e p = SM and N o d e R e p WM . From this we obtain that WM SM . From Lemma 5 we know that SM WM . Hence, SM and WM are equivalent. □
The following lemma gives a criterion for the communication graph which makes the strong model stronger than the weak model. This lemma is not needed to prove the following theorems but it is still interesting.
Lemma 7.
Let D be a communication graph. Let SM be the strong model of D . Let WM be the weak model of D . Then SM > WM iff D is not strongly connected, and there is at least one vertex in it which has more than one child vertex.
Proof. 
(From left to right:) We assume SM > WM , so SM and WM are not equivalent. Since the right side of Lemma 6 is negated, the negation of the left side of Lemma 6 is implied. Hence, D is not strongly connected, and there is at least one vertex in it which has more than one child vertex.
(From right to left:) Assume D is not strongly connected, and there is at least one vertex in it, say a, which has more than one child vertex, say b 1 , b 2 , , b k , where k > 1 . In this case W W { b 1 } { ¬ b 1 } and B B ¬ a , ¬ b k { a , b k } are solutions for WM but they are not solutions of SM , since they do not satisfy the clause { ¬ a , b 1 } from SM . Thus, SM and WM are not equivalent. From this and from Lemma 5 we obtain that Then SM > WM . □
The following theorem, the so called transitions theorem states that any “transition” between SM and WM is a black and white SAT problem iff the communication graph is strongly connected. This is one of the main results of this work.
Theorem 3
(Transitions Theorem). If for all communication graphs D we have SM MM WM , where SM is the strong model of D , WM is the weak model of D and MM is an arbitrary but fixed model of D , then MM is a black and white SAT problem iff D is strongly connected.
Proof. 
Assume that D is a communication graph. Assume that SM is the strong model of D , WM is the weak model of D and MM is an arbitrary but fixed model of D . We show that MM is a black and white SAT problem iff D is strongly connected.
(From left to right:) Assume MM is a black and white SAT problem. From this and from the assumption that SM MM , we have that SM is a black and white SAT problem, since any strong model has always at least two solutions, the white assignment and the black one; see [1]. From this and from Theorem 1 we have that D is strongly connected.
(From right to left:) Assume D is strongly connected. Then by Lemma 6 we know that SM and WM are equivalent. From this and from the assumption that SM MM WM it follows that SM and MM and WM are equivalent. Since D is strongly connected by Theorem 2 we know that WM is a black and white SAT problem. We know that MM and WM are equivalent; hence, MM is a black and white SAT problem. □
The following theorem shows that the Balatonboglár model of a communication graph is a transition between the strong and the weak model. Actually, Balatonboglár is a small city in Hungary next to lake Balaton. We spent quite a lot of time next to the lake thinking about a model which is 3-SAT and black and white if the directed graph is strongly connected. As the next theorem shows, we were successful. As a sign of appreciation for that great time, we gave the name Balatonboglár to that model.
Theorem 4.
Let D be a communication graph. Let BM be a Balatonboglár model of D . Then BM is a black and white 3-SAT problem if and only if D is strongly connected.
Proof. 
Assume D is a communication graph. Assume BM is a Balatonboglár model of D . We show BM is a black and white 3-SAT problem if and only if D is strongly connected. Due to the construction of BM , it is a 3-SAT problem for any communication graph. Let WM be the weak model of D . Let SM be the strong model of D . Now we show that BM is a black and white 3-SAT problem if and only if D is strongly connected. From the transitions theorem (Theorem 3), we know that to show this, it is enough to show that SM BM WM .
(I) As a first step, we show that SM BM . To show this it is enough to show that SM subsumes all clauses from BM . Let C be an arbitrary but fixed element of BM . This means that C is either an element of N o d e R e p 2 , or N o d e R e p 3 , or T a g F o r w a r d . If C is an element of N o d e R e p 2 , then C is also element of SM , so this case is trivial. If C is an element of N o d e R e p 3 , then, without loss of generality, we may assume that C = { ¬ a , b , c } , where a is a vertex in D and b O u t E ( a ) and c O u t E ( a ) and b c . From the construction of N o d e R e p 3 we know that in D there are the following edges: ( a , b ) , ( a , c ) . Since SM is generated from the same graph, by its definition we know that SM contains the clauses { ¬ a , b } , { ¬ a , c } and both of them subsume C. If C is an element of T a g F o r w a r d , then, without loss of generality, we may assume that C = { ¬ d , ¬ e , f } , where d is a vertex in D , and e O u t E ( d ) and f O u t E ( e ) . From the construction of T a g F o r w a r d we know that in D there are the following edges: ( d , e ) , ( e , f ) . Since SM is generated from the same graph, by its definition we know that SM contains the clause { ¬ e , f } which subsumes C.
(II) As a second step, we show BM WM . To show this it is enough to show that BM subsumes all clauses from WM . Let C be an arbitrary but fixed element of WM . This means that C is an element of either N o d e R e p or C y c l e s . If C is an element of N o d e R e p , then, without loss of generality, we may assume that C = { ¬ a , b 1 , b 2 , , b k } , where k > 0 . From the construction of N o d e R e p we know that in D there are the following edges: ( a , b 1 ) , ( a , b 2 ) , , ( a , b k ) . Since BM is generated from the same graph, by its definition we know that BM contains the clause { ¬ a , b 1 } , if k = 1 , or { ¬ a , b , c } , where b and c are different vertices from b 1 , b 2 , , b k , and that said clause subsumes C. If C is an element of C y c l e s , then, without loss of generality, we may assume that C = { ¬ d 1 , ¬ d 2 , , ¬ d m , e 1 , e 2 , , e n } , where m > 0 and n > 0 . If m = 1 then C is an element of N o d e R e p , whose case was already considered, so we may assume that m > 1 . From the construction of C y c l e s and from m > 1 we know that in D there are these edges: ( d i , d i + 1 ) and ( d i + 1 , e ) such that d i and d i + 1 are some of the vertices from d 1 , d 2 , , d m , and e is one of the vertices from e 1 , e 2 , , e m . Since BM is generated from the same graph, by its definition we know that BM contains the clause { ¬ d i , ¬ d i + 1 , e } which subsumes C.
Hence, BM is a black and white 3-SAT problem if and only if D is strongly connected. □

8. Future Work

This work is purely theoretical; there is no usage described here. That does not mean that it is not possible. In this section we list some possible usage.
The BaW 1.0 SAT solver solves the SAT problems generated by our strong model in linear time [13]. The proof of Theorem 2 suggests that we might find a similar algorithm for SAT problems generated by our weak model.
Most probably, this is not possible in the case of the Balatonboglár model, since in that model there is not enough information to reconstruct the input directed graph. It is an interesting question: in which cases is the reconstruction still possible? Most probably not in all cases, because then we could translate a 3-SAT problem into a directed graph, and then that directed graph into a 2-SAT problem. Although this direction seems to be unrealistic, it is still interesting and very challenging for us.
One of the problems is to do with those clauses in a 3-SAT problem, which subsumes the white clause or the black clause. To solve this problem we need a technique which creates a black and white SAT, if the input SAT problem is unsatisfiable.
Our latest results suggest that our weak model is the weakest possible model for communication graphs, because if we generate a weak model from a strongly connected graph and we add the black and the white clause to the model, then we get a minimal unsatisfiable SAT instance; i.e., there is no redundant clause in the weak model [12]. Our other models are quite redundant; see [14]. We plan to combine the good features of the weak and the Balatonboglár models. The first one is non-redundant; the second one can be constructed in a fast way.

Author Contributions

Writing—original draft, G.K.; Writing—review and editing, C.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Hungarian Government, grant number: GINOP-2.1.2-8-1-4-16-2017-00176. The APC was funded by InnovITech Ltd.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Biró, C.; Kusper, G. Equivalence of Strongly Connected Graphs and Black-and-White 2-SAT Problems. Miskolc Math. Notes 2018, 19, 755–768. [Google Scholar] [CrossRef]
  2. Aspvall, B.; Plass, M.F.; Tarjan, R.E. A Linear-Time Algorithm for Testing the Truth of Certain Quantified Boolean Formulas. Inf. Process. Lett. 1979, 8, 121–123. [Google Scholar] [CrossRef]
  3. Balla, T.; Biró, C.; Kusper, G. The BWConverter Toolchain: An Incomplete Way to Convert SAT Problems into Directed Graphs. In Proceedings of the ICAI 2020, Yokohama, Japan, 11–17 July 2020; pp. 24–29. [Google Scholar]
  4. Langlands, R.P. Problems in the theory of automorphic forms to Salomon Bochner in gratitude. In Lectures in Modern Analysis and Applications III; Springer: Berlin/Heidelberg, Germany, 1970; pp. 18–61. [Google Scholar]
  5. Weil, A. Uber die Bestimmung Dirichletscher Reihen durch Funktionalgleichungen. Math. Ann. 1967, 168, 149–156. [Google Scholar] [CrossRef]
  6. Wiles, A.J. Modular elliptic curves and Fermat’s Last Theorem. Ann. Math 1995, 141, 443–551. [Google Scholar] [CrossRef] [Green Version]
  7. Hellerman, L. A Catalog of Three-Variable Or-Invert and And-Invert Logical Circuits. IEEE Trans. Electron. Comput. 1963, 198–223. [Google Scholar] [CrossRef]
  8. Bryant, R.E. Graph-Based Algorithms for Boolean Function Manipulation. IEEE Trans. Comput. 1986, 100, 677–691. [Google Scholar] [CrossRef] [Green Version]
  9. Minato, S. Zero-suppressed BDDs for Set Manipulation in Combinatorial Problems. In Proceedings of the 30th International Design Automation Conference, Dallas, TX, USA, 14–18 June 1993; pp. 272–277. [Google Scholar]
  10. Hearn, R.A. Games, Puzzles, and Computation. Ph.D. Thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, June 2006. [Google Scholar]
  11. Nagy, B. Truth-teller-liar puzzles and their graphs. Cent. Eur. J. Oper. Res. 2003, 11, 57–72. [Google Scholar]
  12. Kusper, G.; Balla, T.; Biró, C.; Tajti, T.; Yang, Z.G.; Baják, I. Generating Minimal Unsatisfiable SAT Instances from Strong Digraphs. In Proceedings of the 2020 22nd International Symposium on Symbolic and Numeric Algorithms for Scientific Computing, Timisoara, Romania, 1–4 September 2020. [Google Scholar]
  13. Biró, C.; Kusper, G. BaW 1.0-A Problem Specific SAT Solver for Effective Strong Connectivity Testing in Sparse Directed Graphs. In Proceedings of the IEEE 18th International Symposium on Computational Intelligence and Informatics (CINTI 2018), Budapest, Hungary, 21–22 November 2018; pp. 160–165. [Google Scholar]
  14. Kusper, G.; Biró, C.; Balla, T. Investigation of the Efficiency of Conversion of Directed Graphs to 3-SAT Problems. In Proceedings of the 2020 IEEE 14th International Symposium on Applied Computational Intelligence and Informatics (SACI), Timisoara, Romania, 21–23 May 2020; pp. 000227–000234. [Google Scholar] [CrossRef]
Figure 1. A path and a cycle.
Figure 1. A path and a cycle.
Algorithms 13 00321 g001
Figure 2. A communication graph with 4 vertices, 3 cycles.
Figure 2. A communication graph with 4 vertices, 3 cycles.
Algorithms 13 00321 g002
Figure 3. A strongly connected communication graph with 4 vertices, 6 cycles.
Figure 3. A strongly connected communication graph with 4 vertices, 6 cycles.
Algorithms 13 00321 g003
Figure 4. Two simple communication graphs.
Figure 4. Two simple communication graphs.
Algorithms 13 00321 g004
Figure 5. A strongly connected communication graph with 4 vertices, 3 simple cycles, 1 non-simple cycle.
Figure 5. A strongly connected communication graph with 4 vertices, 3 simple cycles, 1 non-simple cycle.
Algorithms 13 00321 g005
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Kusper, G.; Biró, C. Convert a Strongly Connected Directed Graph to a Black-and-White 3-SAT Problem by the Balatonboglár Model. Algorithms 2020, 13, 321. https://0-doi-org.brum.beds.ac.uk/10.3390/a13120321

AMA Style

Kusper G, Biró C. Convert a Strongly Connected Directed Graph to a Black-and-White 3-SAT Problem by the Balatonboglár Model. Algorithms. 2020; 13(12):321. https://0-doi-org.brum.beds.ac.uk/10.3390/a13120321

Chicago/Turabian Style

Kusper, Gábor, and Csaba Biró. 2020. "Convert a Strongly Connected Directed Graph to a Black-and-White 3-SAT Problem by the Balatonboglár Model" Algorithms 13, no. 12: 321. https://0-doi-org.brum.beds.ac.uk/10.3390/a13120321

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop