A LOGICAL MODEL OF HCP

For an arbitrary undirected graph G, we are designing a logical model for the Hamiltonian Cycle Problem (HCP), using tools of Boolean algebra only. The obtained model is a logic formulation of the conditions for the existence of the Hamiltonian cycle, and uses m Boolean variables, where m is the number of the edges of a graph. This Boolean expression is true if and only if an initial graph is Hamiltonian. In general, the obtained Boolean expression may have an exponential length (the number of Boolean literals) and may be used for construction of the solution algorithm. 2000 Mathematics Subject Classification. 68R10, 94C10.


Introduction.
In principle, a Boolean function f may be constructed for every NP-problem.Usually, to obtain the Boolean function, one can reduce the problem to a satisfiability problem.
A satisfiability problem (SAT) is historically the first NP-complete problem.Classically, a SAT is formulated in the following way.
Let y i (i = 1,m) be some proposition, and f (y 1 ,y 2 ,...,y m ) be a compound proposition constructed from the y i 's.Further we assume that the value 0 for a proposition y i means that the proposition is false, and 1 means that the proposition y i is true.
Let B m = {0, 1} m , where 0 and 1 mean false and true, respectively.A mapping f : B m → {0, 1} is called a Boolean function on m variables.
An element σ = (σ 1 ,σ 2 ,...,σ m ) ∈ B m , where σ i ∈ {0, 1} (i = 1,m), is called an assignment of variables for the function f (y 1 ,y 2 ,...,y m ).If f (σ ) = 1, then the element σ ∈ B m is called a satisfying assignment of variables for the Boolean function f (y 1 ,y 2 ,...,y m ).We denote y i is called a literal.The literals y 0 and y 1 are called contrary.Any conjunction of r (r ≤ m) different noncontrary literals is called elementary.An elementary conjunction is equal to 1 if all its components are equal to 1. Let K 1 ,K 2 ,...,K s be elementary conjunctions.Then a disjunction is called a disjunction normal form (DNF). Obviously, the DNF in (1.2) is equal to 1 if at least one of its components is equal to 1.

Any disjunction different noncontrary literals
is also elementary.The elementary disjunction is equal to 1 if at least one of the literals is equal to 1.
Let D 1 ,D 2 ,...,D h be the elementary disjunctions.Then a conjunction is called the conjunction normal form (CNF). Obviously, the CNF in (1.4) is equal to 1 if each component disjunction is equal to 1.
Assume that there is a Boolean function of the form (1.4).We want to find satisfying assignment for Boolean variables of (1.4) such that f is true.
Thus, we have formulated a SAT in classical form.Unfortunately, variables of a similar SAT are formal.In fact, they describe some nondeterministic Turing machine for calculating the solution of the problem.
For example, the ways of constructing a SAT for the given Hamiltonian cycle problem (see [4]) are known.Obviously, variables of this SAT are formal, that is, these variables assign no graph element.
In this paper, we design the logic expression that determines existence of a Hamiltonian cycle in an arbitrary undirected graph.Boolean variables of this expression correspond to graph elements.

The logic expression for HCP. Consider a class L n of undirected graphs without loops and multiple edges with n vertices.
Let G = (X, E) ∈ L n , where X = {x 1 ,...,x n } is the set of graph vertices and E the set of unordered pairs of X, called edges.
A Hamiltonian cycle in a graph G is a cycle, visiting each graph vertex exactly once (indefinable concepts see in [6]).A graph G ∈ L n is Hamiltonian if it has a Hamiltonian cycle.HCP is an NP-complete problem (cf.[1,2]).
Construct a Boolean expression for HCP.First, we make some remarks.As it is already mentioned above, the Boolean expression may be considered as a logical model of any of the NP-problems.Therefore, we proceed from several assumptions as it is done in the time of construction of any mathematical model.
For example, let there be a set family S = {S 1 ,...,S m }.It is required to find a transversal of S. In this case, we mean that each of the sets S i ∈ S (i = 1,m) is nonempty.
Similarly, we shall proceed from several "natural" assumptions when we shall design the Boolean expression for HCP.Obviously, if some of them are not fulfilled then the Boolean expression has no satisfying assignments, and the corresponding graph is not Hamiltonian.
We construct the Boolean expression for HCP as a conjunction of two Boolean expressions To formulate each of the Boolean expressions F 1 and F 2 we shall introduce the Boolean variables.
A Hamiltonian cycle C H of G, when it exists, is worth to represent by a totality of n edges C H = e i 1 ,e i 2 ,...,e in . (2.2) Consider an arbitrary vertex x ∈ X of G, having a local degree deg(x).Let the edges e i 1 ,e i 2 ,...,e i deg(x) of G be incident to the vertex x.
The first assumption, which we proceed from, is that deg(x) ≥ 2 for all x ∈ X.The assumption is evident since a graph G is not two-connected, and has no Hamiltonian cycle if there are less than two vertices, that is, incident to some vertex of G.
A unique Boolean variable y iq is assigned to each edge e iq (q = 1, deg(x)).Suppose that y iq = 1 if e iq ∈ C H , and y iq = 0 otherwise.
Let the edges e i 1 ,e i 2 be incident to the vertex x ∈ X, and belong to a Hamiltonian cycle C H of G. Obviously, a conjunction In general, for a vertex x ∈ X we can compose conjunctions in the form (2.3), each of which contains two Boolean variables without negations.Let K(x) = {K 1 ,K 2 ,...,K t } be the set of all similar conjunctions.We assign a disjunction of conjunctions in the form (2.3) to each vertex x ∈ X of G. Thus, for any graph G ∈ L n we may determine a Boolean expression for all i, j ∈ {1,...,w} and w i=1 X i = X.Else, in this case the set W is called a 2-factor of G [3,6], or a vertex disjoint cycle cover [1].

Lemma 2.1. The Boolean expression (2.6) is true if and only if a graph vertices are split into disjoint cycles.
Proof.Obviously, if a graph vertices are split into disjoint cycles then expression (2.6) is true.
On the other hand, a satisfying assignment of Boolean variables (2.6) determines some totality E 1 of graph edges.By construction of (2.6), for any vertex of G in E 1 there exists exactly two edges which are incident to the given vertex.Therefore, the totality E 1 determines some partition W of G into disjoint cycles.
Note that expression (2.6) may be true if G is unconnected, for instance, if it consists of two unconnected distinct cycles.
The question raised: how can we take into account the two-connectedness of G in SAT for HCP?
Consider some cycle C(S) of G, where S is the vertex set of the cycle.The edge set of G, for which one and only one terminal vertex is incident to some vertex of S ⊂ X, we denote by E(S).Further, let R(S) be the set of edge pairs of E(S) such that they have no common vertex in S.
The second assumption is that for any cycle C(S) of G, the set R(S) is nonempty if S ≠ X.That is, if some cycle of G does not contain all graph vertices then there exists at least two edges for it, each of which has one terminal vertex only, that is, incident to distinct vertex of this cycle.
In other words, if the graph is Hamiltonian then any Hamiltonian cycle must go into any cycle C(S) (S ⊂ X), and goes out from the cycle.
As the first assumption, the second assumption is also natural since if it is fulfilled, then the graph, obviously, is not two-connected, and, hence, it has no Hamiltonian cycles.
Let C(S) be some cycle of a Hamiltonian graph G.We shall assign a conjunction y i 1 ∧ y i 2 to each edge pair (e i 1 ,e i 2 ) ∈ R(S).Clearly this conjunction is absent in F 1 if the corresponding edges have no common vertices.
For the cycle C(S) we compose a disjunction of conjunctions, each of which corresponds to one of the elements of the set R(S).
Then a set of disjunctions D(S) for all cycles C(S) of G induce an expression (2.8) Theorem 2.2.Expression (2.1) has an exponential number of conjunctions.
Proof.An exponential number of conjunctions in the expression for SAT follows from an exponential number of cycles of G (cf. [5]).

Theorem 2.3. The expression
Proof.Indeed, let G ∈ L n be a Hamiltonian graph.By Lemma 2.1, the expression F 1 is true.Besides, if C(S) is a cycle such that S ⊂ X, S ≠ X, then at least two edges of E(S) belong to a Hamiltonian cycle, that is, the expression F 2 is also true.
Conversely, if the expression F = F 1 ∧ F 2 is true then we have a partition of G into disjoint cycles.If we suppose that this partition contains more than one cycle then we have a contradiction since the expression F 2 is true.following form (further we cast out the symbol of the conjunction in the expressions): F 1 = (f g) ad f ∨a df ∨ ādf ab c∨a bc∨ ābc ce ḡ∨cēg∨ceg bc d∨bcd∨ bcd . (2.9) The given graph has the following cycles, each of which does not contain all vertices of the graph: 1-2-5-4, 2-3-5, 2-3-4-5, 3-4-5.
Thus, the expression F 2 will have to be a form: Obviously, the expression F determines two Hamiltonian cycles, each of which contains edges whose Boolean variables have no negatives.
On the other hand, if we consider the theta-graph, shown in Figure 2.1b, we obtain the value F = 0.