Sunteți pe pagina 1din 25

a

r
X
i
v
:
1
2
0
8
.
0
9
5
4
v
3
3


[
c
s
.
C
C
]


3
0

D
e
c

2
0
1
3
P=NP
Sergey V. Yakhontov
Abstract
The present paper proves that P=NP. The proof, presented in this paper, is a constructive one:
The program of a polynomial time deterministic multi-tape Turing machine MAcceptingPath),
which determines if there exists an accepting computation path of a polynomial time non-deterministic
single-tape Turing machine MNP), is constructed (machine MAcceptingPath) is dierent for each
machine MNP)).
The features of machine MAcceptingPath) are the following:
1) the input of machine MAcceptingPath) does not contain any encoded program of machine
MNP);
2) machine MAcceptingPath) is based on reduction L
P
m
LP (Linear Programming) instead
of reduction L
P
m
3-CNF-SAT which is commonly used, wherein language L NP, machine
MNP) decides L, and
P
m
is polynomial time many-one reduction;
3) the accepting computation paths of machine MNP) are considered as a set of the computation
paths in the acyclic control ow graph (graph of polynomial size) of a deterministic computer
program that writes values to the tape cells and reads values from the tape cells;
4) the set of the accepting computation paths of machine MNP) is considered as a subset of a
more general set of the tape-arbitrary paths in the acyclic control ow graph;
5) reduction L
P
m
LP is based on the results of reaching denitions analysis for the deterministic
computer program.
The time complexity of machine MAcceptingPath) is O

14
t(n)
24

; the time complexity of the


pseudocode algorithm of this machine on a computer with Von Neumann architecture is O

7
t(n)
12

operations; here t(n) is an upper bound of the time complexity of machine MNP), and is a
constant depending on relation of machine MNP).
In fact, program analysis and linear programming are used in the present paper to solve the
P vs. NP Problem.
Keywords: computational complexity, Turing machine, class P, class NP, P vs. NP Problem, class
FP, accepting computation paths, program analysis, tape-consistent path existence problem, linear
programming.
Contents
1 Introduction 2
Sergey V. Yakhontov: Ph.D. in Theoretical Computer Science, Dept. of Computer Science, Faculty of
Mathematics and Mechanics, Saint Petersburg State University, Saint Petersburg, Russian Federation;
e-mail: SergeyV.Yakhontov@gmail.com, S.Yakhontov@spbu.ru; phone: +7-911-966-84-30; Personal Web page:
https://sites.google.com/site/sergeyvyakhontov/; Current status of the paper:
https://sites.google.com/site/sergeyvyakhontov/home/peqnp-paper-status/; 30-Dec-2013
1
2 Preliminaries 3
2.1 Non-deterministic computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Notations for graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Construction of deterministic multi-tape Turing machine MAcceptingPath) 5
3.1 Underlying elements of machine MAcceptingPath) . . . . . . . . . . . . . . . . . . . 5
3.1.1 Sequences of computation steps . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Computation steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Auxiliary denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Kinds of sequences of computation steps . . . . . . . . . . . . . . . . . . . . . . 7
A gure to explain the notion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Concept of the construction of machine MAcceptingPath) . . . . . . . . . . . . . . 8
3.2.1 Denitions for sets of sequences of computation steps . . . . . . . . . . . . . . 9
3.2.2 Determining if there exists an accepting computation path . . . . . . . . . . . 9
3.2.3 How machine MAcceptingPath) works . . . . . . . . . . . . . . . . . . . . . 11
3.3 Dierences from reduction L
P
m
3-CNF-SAT in detail . . . . . . . . . . . . . . . . . 11
3.4 Program of machine MAcceptingPath) . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.1 Non-deterministic multi-tape Turing machine MTArbitrarySeqs) . . . . . . . 12
3.4.2 Deterministic algorithm ConstructTArbitrarySeqGraph . . . . . . . . . . . . 13
3.4.3 Deterministic algorithm ComputeTConsistPairSet . . . . . . . . . . . . . . . 15
3.4.4 Deterministic algorithm DetermineIfExistsTConsistSeq . . . . . . . . . . . . 16
Commodities for tape-consistent pairs . . . . . . . . . . . . . . . . . . . . . . . 17
Linear program formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4.5 Pseudocode of machine MAcceptingPath) . . . . . . . . . . . . . . . . . . . 19
3.5 Time complexity of machine MAcceptingPath) . . . . . . . . . . . . . . . . . . . . . 20
4 Main results 21
4.1 Main theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Proof of FP=FNP based on machine MAcceptingPath) . . . . . . . . . . . . . . . 22
4.3 Some consequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5 Conclusion 24
1 Introduction
This paper concerns the complexity classes of languages over nite alphabets (wherein the number
of symbols is equal to or more than two) that are decidable by Turing machines.
It follows from the denition of classes P and NP [1] that PNP wherein P is the shortened
indication of PTIME and NP is the shortened indication of NPTIME. However, the problem of the
strictness of the inclusion, referred to as the P versus NP Problem, is one of the most important
unsolved problems in the theory of computational complexity.
The P vs. NP Problem was introduced by Stephen Cook in 1971 [2] and independently by
Leonid Levin in 1973 [3]. A detailed description of the problem in [4] formulates it as follows: Can
each language over a nite alphabet, which is decidable by a polynomial time non-deterministic
single-tape Turing machine, also be decided by a polynomial time deterministic single-tape
Turing machine? The shortened formulation of the problem is P=? NP.
The papers [59] contain detailed surveys on the P vs. NP Problem.
The present paper proves that P=NP. The proof, suggested in this paper, is a constructive one:
The program of a polynomial time deterministic multi-tape Turing machine MAcceptingPath),
which determines if there exists an accepting computation path of a polynomial time non-deterministic
2
single-tape Turing machine MNP) (more precisely, an accepting computation path of the computa-
tion tree of machine MNP) on the input), is constructed (machine MAcceptingPath) is dierent
for each machine MNP)).
It is known that problem 3-CNF-SAT is NP-complete [2,3] (CookLevin theorem); this theorem
is usually used as a basis to solve the P vs. NP Problem.
Most of the works on the attempts to solve the P vs. NP Problem can be found on the Internet
at [10] and [11]. It seems most of these works use reductions
L
P
m
3-CNF-SAT
P
m
. . .
P
m
L

wherein language L NP and


P
m
is polynomial time many-one reduction; a detailed list of these
reductions can be found in [12]. In particular, reductions to ILP (Integer Linear Programming) are
often used:
L
P
m
3-CNF-SAT
P
m
. . .
P
m
ILP;
a detailed list of reductions to ILP can be found in [13].
Regarding the works at [10, 11], the author of the present paper could not nd any work that
contains a concept similar to the concept suggested in the present paper.
The solution suggested in the present paper is completely dierent from the well-known approach-
ers to solve the problem; namely, reduction L
P
m
3-CNF-SAT is not used in the present paper.
The concept of the construction of machine MAcceptingPath) suggested in this paper is based on
the following general idea:
1) dene the set of the tape-arbitrary paths in an acyclic control ow graph of polynomial size
of a deterministic computer program such that this set is the disjoint union of the set of the
tape-consistent paths and the set of the tape-inconsistent paths; the main feature of the tape-
arbitrary paths is that the computations on such path starting at a point do not depend on the
computations from the start of the path to this point;
2) using reduction to problem LP, determine if there exists a tape-consistnt path p in the con-
trol ow graph; the reduction is based on the results of reaching denitions analysis for the
deterministic computer program;
3) there is one-to-one mapping from the tape-consistent accepting paths to the accepting compu-
tation paths of machine MNP), so one can determine if there exists an accepting computation
path of machine MNP).
In contrast to problem ILP, a fractional solution of problem LP can be found in polynomial time
[14, 15].
From the data, computed by machine MAcceptingPath), a t(n)

-length accepting computation


paths of machine MNP), wherein t(n) is an upper bound of the time complexity of machine MNP),
can be retrieved in polynomial time in t(n).
Machine MAcceptingPath) works in polynomial time in t(n) because the space used to compute
the computation steps of a tape-arbitrary sequence of the computation steps of machine MNP) is
logarithmic in t(n) only.
2 Preliminaries
In the present paper
1) t(n) is an upper bound of the time complexity of machine MNP),
2) in the estimations of the time complexity of the algorithms, TM steps and TM tape cells
mean steps and tape cells accordingly on a Turing machine,
3) in the estimations of the time complexity of the algorithms, VN operations and VN mem-
ory cells mean operations and memory cells accordingly on a computer with Von Neumann
architecture, and
3
4) all the propositions whose proofs are obvious or follow from the previous text are omitted.
This section contains general information that is used in all the constructions in the present paper.
2.1 Non-deterministic computations
Let
M = Q, , b, , , q
start
, F)
be a non-deterministic single-tape Turing machine wherein Q is the set of states, is the set of tape
symbols, b is the blank symbol, is the set of input symbols, is the transition relation, q
start
is
the initial state, and F is the set of accepting states. The elements of the set |L, R, S denote, as is
usual, the moves of the tape head of machine M.
Non-deterministic Turing machines as decision procedures (more precisely, programs for non-
deterministic Turing machines as decision procedures) are usually dened as follows.
Denition 2.1. [1] Non-deterministic Turing machine M accepts input x if there exists an accepting
computation path of machine M on input x.
Denition 2.2. [16] Non-deterministic Turing machine M rejects input x if all the computation
paths of machine M on input x are nite and these paths are not accepting computation paths.
Denition 2.3. [1] Non-deterministic Turing machine M decides a language A

if machine
M accepts each word x A and rejects each word x / A.
The time (space) computational complexity of non-deterministic Turing machine M is polynomial
if there exists a polynomial t(n) (s(n) accordingly) such that for any input x
1) the minimum of the lengths of all the accepting computation paths of machine M on input x
does not exceed t([x[) (accordingly, the number of the dierent visited cells on each accepting
computation path does not exceed s([x[)) if machine M accepts input x, and
2) the lengths of all the computation paths of machine M on input x do not exceed t([x[) (accord-
ingly, the number of the dierent visited cells on each computation path does not exceed s([x[))
if machine M rejects input x.
Here, (as is usual) by means of [x[ the length of word x is specied. Let be an integer.
Denition 2.4. Computation path p of Turing machine M on input x is said to be a -length
computation path if the length of p is equal to . Accepting computation path p of machine M on
input x is said to be a -length accepting computation path if p is -length computation path.
Denition 2.5. Computation path p of Turing machine M on input x is said to be a

-length (
>
-
length) computation path if the length of p is less than or equal to (is greater than ). Accepting
computation path p of machine M on input x is said to be a

-length accepting computation path if


p is a

-length computation path.


If Turing machine M accepts input x and the time complexity of machine M is bounded above by
polynomial t(n), then the computation tree of machine M on input x has at least one t([x[)

-length
accepting computation path.
If Turing machine M rejects input x and the time complexity of machine M is bounded above by
polynomial t(n) then all the computation paths of machine M on input x are precisely the t([x[)

-
length computation paths, and these paths are not accepting computation paths.
Lets note that there are some dierences between the denitions of how non-deterministic Turing
machine rejects the input. Usually, non-deterministic Turing machines are dened in such a way that
it is acceptable that there are some endless computation paths or t(n)
>
-length computation paths in
the case Turing machine rejects the input [1, 12, 17, 18]; sometimes denition 2.2, which is stronger
than the denitions in [1, 12, 17, 18], is used [16]. The construction of machine MAcceptingPath)
is based on denition 2.2, but all the results obtained in the present paper hold also for the weaker
denitions.
4
Non-deterministic computations are often dened as guess-and-verify computations [1, 19] or
search-and-check computations [3,18]. In [4], the Pvs. NPProblem is formulated precisely in terms
of guess-and-verify computations, but it is known [1, 18] that these denitions of non-deterministic
computations are equivalent to the denition, which is used in the present paper, of non-deterministic
computations in terms of non-deterministic Turing machines.
2.2 Notations for graphs
Let G = (V, E) be a direct acyclic graph.
Notation 2.1. Let NodesG) be set V .
Notation 2.2. Let EdgesG) be set E.
Notation 2.3. Let RootNodeG) be the root node of graph G.
Notation 2.4. Let s be the source node of graph G.
Notation 2.5. Let t be the sink node of graph G.
For each node u V let, as is usual,

(u) = |(v, u) [ ((v V ) ((v, u) E)) be the set of all in-edges of node u, and

+
(u) = |(u, v) [ ((v V ) ((u, v) E)) be the set of all out-edges of node u.
Let G = (V, E) be a direct acyclic graph with source node s and sink node t.
Denition 2.6. A path p in graph G is said to be s-t path if p starts with the source node s and ends
with the sink node t.
Denition 2.7. A path p in graph G is said to be u-v path if p starts with node u and ends with
node v.
Notation 2.6. Let PathSet(h
i
)), wherein (h
i
) = (u
1
, .., u
m
) is a sequence of nodes, be the set of
u
1
-u
m
paths in graph G containing each node u
i
(h
i
).
Notation 2.7. Let SubgraphG, P), wherein P is a path set in G, be graph (V sub), Esub)) such
that
V sub) = |u [ ((u V ) (p P : u p)) and
Esub) = |e [ ((e E) (p P : e p)).
Notation 2.8. Let SubgraphG, (h
i
)) be subgraph
SubgraphG, PathSet(h
i
))).
3 Construction of deterministic multi-tape Turing
machine MAcceptingPath
In this section, the components and the program of machine MAcceptingPath) are constructed in
detail.
3.1 Underlying elements of machine MAcceptingPath
3.1.1 Sequences of computation steps
The notion of sequences of computation steps is used to dene the general set of the tape-arbitrary
paths which includes the set of the computation paths of machine M.
5
Computation steps.
Denition 3.1. Computation step t of machine M is dened to be tuple
(q, s, q

, s

, m,
tape
,
step
)
wherein d = ((q, s), (q

, s

, m)) , m |L, R, S, and


tape
and
step
are integers. In that case, we
write d t.
Denition 3.2. Let
t
1
= (q
1
, s
1
, q

1
, s

1
, m
1
,
tape
1
,
step
1
) and t
2
= (q
2
, s
2
, q

2
, s

2
, m
2
,
tape
2
,
step
2
)
be computation steps. Pair (t
1
, t
2
) is said to be a sequential pair if q
2
= q

1
,
step
2
=
step
1
+ 1, and
1) if m
1
= L then
tape
2
=
tape
1
1;
2) if m
1
= R then
tape
2
=
tape
1
+ 1;
3) if m
1
= S then
tape
2
=
tape
1
.
Only nite sequences of the computation steps, such that each pair (t
i
, t
i+1
) of computation steps
is a sequential pair, are considered.
Denition 3.3. Pair of computation steps
t
i
1
= (q
i
1
, s
i
1
, q

i
1
, s

i
1
, m
i
1
,
tape
i
1
,
step
i
1
) and t
i
2
= (q
i
2
, s
i
2
, q

i
2
, s

i
2
, m
i
2
,
tape
i
2
,
step
i
2
)
is said to be a tape-consistent pair of computation steps if s
i
2
= s

i
1
. Otherwise (when s
i
2
,= s

i
1
) the
pair is said to be a tape-inconsistent pair of computation steps.
Lets note that it is not required in this denition for computation steps t
i
1
and t
i
2
that t
i
2
follows
immediately t
i
1
in computation paths of machine MAcceptingPath); there can be a sequence like
(. . . , t
i
1
, . . . , t
i
2
, . . .).
Denition 3.4. Pair of computation steps t
i
1
and t
i
2
is said to be a tape-inconsistent pair is it is
not a tape-consistent pair.
Auxiliary denitions. Lets enumerate the tape cells of Turing machine M on input x as follows:
The number of the cell c
1
, containing the leftmost symbol of input x, is 1, the number of the cell to
the right of c
1
is 2, the number of the cell to the left of c
1
is 0, and so on.
Notation 3.1. The tape cell with number is denoted by c

.
Notation 3.2. Let x be an input of machine M. The symbol in tape cell c

is denoted by Tapex, ).
Notation 3.3. Integer range [(1(1))..(1+(1))] of cell numbers is denoted by TapeRangex, ).
Denition 3.5. Subsequence L
sub
= (t
1
, . . . t

) of sequence L of the computation steps, denoted by


SubseqL, ), is said to be a subsequence at cell c

of sequence L if
tape
= for each computation
step t = (q, s, q

, s

, m,
tape
,
step
) in L
sub
.
Denition 3.6. We say that sequence L = (t
1
, . . . t

) of the computation steps starts on input x if


t
1
= (q
start
, s, q

, s

, m, 1, 1) for some s, q

, s

, and m.
Denition 3.7. We say that sequence L = (t
1
, . . . t

) of the computation steps corresponds to input


x at cell c

tape if one of the following holds:


1) if SubseqL,
tape
) = (t
i
1
, . . . t
i
k
) and t
i
1
= (q, s, q

, s

, m,
tape
,
step
), then s = Tapex,
tape
);
2) SubseqL,
tape
) is an empty sequence.
6
Denition 3.8.
= min|j [ t = (q, s, q

, s

, m,
tape
, j) L
wherein L is a sequence of computation steps, is denoted by
TapeFirstL,
tape
)
if the set of such j is not empty.
Denition 3.9.
= max|j [ (j <
step
) (t = (q, s, q

, s

, m,
tape
, j) L)
wherein L is a sequence of computation steps, is denoted by
TapePrevL,
tape
,
step
)
if the set of such j is not empty.
Denition 3.10. Sequence L = (t
1
, . . . t

) of the computation steps of machine M is said to be


q

-sequence of the computation steps if t

= (q, s, q

, s

, m,
tape
,
step
).
Denition 3.11. Sequence L of the computation steps of machine M is said to be an accepting
sequence of the computation steps if L is q-sequence wherein q F.
Denition 3.12. Sequence L = (t
1
, . . . t

) of the computation steps of machine M is said to be a


-length sequence of the computation steps.
Denition 3.13. Sequence L = (t
1
, . . . t
j
) of the computation steps of machine M is said to be a

-length sequence of the computation steps if j .


Lets note that
tape
TapeRangex, ) for each computation step t = (q, s, q

, s

, m,
tape
,
step
)
in a -length sequence of the computation steps.
Kinds of sequences of computation steps.
Denition 3.14. Sequence L = (t
1
, . . . t

) of the computation steps of machine M on input x is said


to be a tape-consistent sequence of the computation steps on input x if the following holds:
1) L starts on input x;
2) L corresponds to input x at each cell TapeRangex, );
3) for each TapeRangex, ) the following holds:
3.1) if subsequence L
sub
= SubseqL, ) is not empty, then each pair (t
i
, t
i+1
) in L
sub
is a
tape-consistent pair of computation steps.
Denition 3.15. Sequence L = (t
1
, . . . t

) of the computation steps of machine M on input x is


said to be a tape-inconsistent at pair (
tape
,
step
) sequence of the computation steps on input x if the
following holds:
1) t = (q, s, q

, s

, m,
tape
,
step
) L;
2) L starts on input x;
3) one of the following holds:
3.1) if
step
= TapeFirstL,
tape
) then s ,= Tapex,
tape
);
3.2) if there exists such that = TapePrevL,
tape
,
step
), then pair (t

, t

step) is a tape-
inconsistent pair of the computation steps.
Denition 3.16. Sequence L = (t
1
, . . . t

) of the computation steps of machine M on input x is said


to be a tape-inconsistent sequence of computation step on input x if L is tape-inconsistent at some
pair (
tape
,
step
) sequence on input x.
7
Figure 1: A sequence of computation steps.
Denition 3.17. Sequence L = (t
1
, . . . t

) of the computation steps of machine M on input x is said


to be a tape-arbitrary sequence of the computation steps if L starts on input x.
Denition 3.18. Tape-consistent sequence L = (t
1
, . . . t

) of the computation steps is said to be the


sequence corresponding to computation path P =
1
. . .
+1
of machine M on input x if each d
i
,
such that d
i
t
i
, is the transition corresponding to conguration transition
i

i+1
.
Denition 3.19. Tree T of the computation steps is said to be the -length (

-length) tape-arbitrary
tree of the computation steps of machine M on input x if each root-leaves path in T is a tape-arbitrary
sequence of the computation steps of machine M on input x, and the tree contains all the -length
(

-length) tape-arbitrary sequence of the computation steps.


A gure to explain the notion. The notion of sequences of computation steps is explained in
Figure 1; there
1) the pair of computation steps
s
2,8
= (q
i
1
, a, q

i
1
, b, L, 2, 8) and s
2,14
= (q
i
2
, b, q

i
2
, c, R, 2, 14)
is a tape-consistent pair of the computation steps;
2) the pair of computation steps
s
4,4
= (q
i
3
, x
4
, q

i
3
, d, R, 4, 4) and s
4,6
= (q
i
4
, e, q

i
4
, f, L, 4, 6),
wherein e ,= d, is a tape-inconsistent pair of the computation steps.
3.2 Concept of the construction of machine MAcceptingPath
The concept of the construction of machine MAcceptingPath) is based on the following proposition.
8
Proposition 3.1. There is one-to-one mapping from the set of the -length tape-consistent sequences
of the computation steps of machine M on input x onto the set of the -length sequences of the
computation steps of machine M on input x that correspond to the ( + 1)-length computation paths
of machine M on input x.
Proof. The proposition follows directly from the denition.
3.2.1 Denitions for sets of sequences of computation steps
Notation 3.4. Let TConsistSeqSetx, q, ) be the set of -length tape-consistent q-sequences of the
computation steps of machine M on input x.
Notation 3.5. Let TInconsistSeqSetx, q, ) be the set of the -length tape-inconsistent q-sequences
of the computation steps of machine M on input x.
Notation 3.6. Let TArbitrarySeqSetx, q, ) be the set of the -length tape-arbitrary q-sequences
of the computation steps of machine M on input x.
Notation 3.7. QNotAccept) = |q Q [ q / F; QAny) = Q\ |q
start
.
Denition 3.20. TConsistSeqSetx, S, ) =
qS
TConsistSeqSetx, q, ) for some set S of the
states of machine M.
3.2.2 Determining if there exists an accepting computation path
Proposition 3.2. Set
TArbitrarySeqx, q, )
is the disjoint union of sets
TConsistSeqx, q, )
and
TInconsistSeqx, q, ).
Proof. The following is to be shown:
TConsistSeqSetx, q, ) TInconsistSeqSetx, q, ) = and
TArbitrarySeqSetx, q, ) = TConsistSeqSetx, q, ) TInconsistSeqSetx, q, ).
The rst equality follows directly from the denitions of sequences of the computation steps.
Furthermore, inclusions
TConsistSeqSetx, q, ) TArbitrarySeqSetx, q, ) and
TInconsistSeqSetx, q, ) TArbitrarySeqSetx, q, )
also follow directly from the denitions of sequences of the computation steps.
The rest is to show that
TArbitrarySeqSetx, q, ) TConsistSeqSetx, q, ) TInconsistSeqSetx, q, ).
Let L = (t
1
, . . . t

) be a tape-arbitrary sequence of the computation steps. Then


1) if one of 3.1) and 3.2) in denition 3.15 holds for some t
i
L then L TInconsistSeqSetx, q, );
2) otherwise, L TConsistSeqSetx, q, ).
9
Proposition 3.2 is not used directly in the construction of machine MAcceptingPath); this
propostion is just used to show that the set of the tape-consistent sequences is considered as a subset
of more general set of the tape-arbitrary sequences.
Let MNP) be a non-deterministic single-tape Turing machine that decides language A and works
in time t(n). To determine if there exists a sequence of the computation steps that is a tape-consistent
sequence, the following steps are performed:
1) construct non-deterministic multi-tape Turing machine MTArbitrarySeqs) such that there is
one-to-one mapping from the set of the root-leaves paths in the computation tree of machine
MTArbitrarySeqs), denoted by TArbitrarySeqTree, to the set of the root-leaves paths in the

-length tape-arbitrary tree of the computation steps of machine MNP) on input x;


2) construct a direct acyclic graph TArbitrarySeqGraph of the nodes of tree TArbitrarySeqTree
as a result of deep-rst traversal of tree TArbitrarySeqTree such that there is one-to-one
mapping from the set of the s-t paths in graph TArbitrarySeqGraph onto the set of the root-
leaves paths in the -length tape-arbitrary tree of the computation steps of machine MNP)
on input x; the size of graph TArbitrarySeqGraph is polynomial in [x[ wherein [x[ is the length
of the input;
3) consider graph TArbitrarySeqGraph as direct acyclic control ow graph TArbSeqCFG of a
deterministic computer program that writes values to the tape cells and reads values from the
tape cells of machine MNP);
4) using reaching denitions analysis [20] on graph TArbSeqCFG and on the set of the assignments
to the tape cells and the set of the usages of the tape cells, compute the tape-consistent pairs
of the computation steps;
5) reduce the problem of determining if there exists an accepting tape-consistent sequence in the
control ow graph to problem LP; use polynomial time algorithm to solve problem LP [14, 15];
6) there is one-to-one mapping from the tape-consistent accepting paths to the accepting compu-
tation paths of machine MNP), so one can determine if there exists an accepting computation
path of machine MNP).
These steps are based on the following key idea.
To say informally, if a path in computation tree TArbitrarySeqTree starts in some node then the
segment of the path from the node to a leaf does not depend on the segment of the path from the
source to the node. Therefore, all the subtrees of computation tree TArbitrarySeqTree that start at
the equal nodes are the same, and the set of the paths in the tree can be respresented as the set of
the paths in a graph.
So, to construct graph TArbitrarySeqGraph, computation tree TArbitrarySeqTree is not built
explicitely; instead, the steps of machine MTArbitrarySeqs) are simulated to construct the nodes of
the tree and to construct the graph at the same time. If computation tree TArbitrarySeqTree has n
subtrees that start with a node u then (n1) subtrees are cut; therefore, the paths in the subtrees are
not duplicated in the graph. Because the number of the dierent nodes in tree TArbitrarySeqTree,
which contain computation steps, is polynomial, the size of graph TArbitrarySeqGraph is polynomial.
The construction of graph TArbitrarySeqGraph is explained in Figure 2; there
1) TAST is the shortened indication of TArbitrarySeqTree,
2) TASG is the shortened indication of TArbitrarySeqGraph,
3) subtree that is cut is orange-colored, and
4) new edge in graph TArbitrarySeqGraph is green-colored.
10
Figure 2: Construction of graph TArbitrarySeqGraph.
3.2.3 How machine MAcceptingPath works
Turing machine MAcceptingPath) works as follows. It performs a loop for , 1 t(n),
determining at each iteration if there
p (p TConsistSeqSetx, F, ))).
Since machine MNP) works in time t(n), one of the following happens:
1) if machine MNP) accepts input x, [x[ = n, then the loop stops at iteration (t(n) 1) such
that
p (p TConsistSeqSetx, F, )))
holds;
2) if machine MNP) rejects input x, [x[ = n, then the loop stops at iteration t(n) such that
[TConsistSeqSetx, QAny), ))[ = 0;
here, (as is usual) by means of [x[ the length of word x is specied.
If t(n) is a polynomial, then machine MAcceptingPath) works in polynomial time in t(n) and
therefore works in polynomial time in n wherein n = [x[.
The benet of using the tape-arbitrary sequences of the computation steps is as follows:
1) to compute the elements of a tape-consistent sequence of the computation steps of machine
MNP), one should keep all the symbols written on the tape of machine MNP); therefore in
that case one uses polynomial space and exponential time;
2) if one computes the elements of a tape-arbitrary sequence of computation steps of machine
MNP), one should know the current computation step only; therefore, in that case, one uses
logarithmic space and polynomial time.
3.3 Dierences from reduction L
P
m
3-CNF-SAT in detail
Let L be a language from class NP. The features of reduction L
P
m
3-CNF-SAT [21] in detail
compared to the solution suggested in the present paper are the following:
11
1) reduction L
P
m
3-CNF-SAT sets in fact one-to-one mapping between the set of the assign-
ments that satisfy a Boolean formula and the set of the tape-consistent sequences of computation
steps;
2) in reduction L
P
m
3-CNF-SAT, the set of the tape-consistent sequences of the computation
steps is a subset of the set of the paths in a graph which is implicitly constructed (P
j
s,t
[21, page
153] are some nodes of this graph);
3) an assignment that does not satisfy a Boolean formula can correspond to sequences of the
computation steps that do not correspond to computation paths, so there is no one-to-one
mapping between the set of such assignments and the set of the tape-inconsistent sequences of
the computation steps.
Thus, the dierence between the solution suggested in the present paper and reduction L
P
m
3-CNF-SAT is as follows.
Reduction L
P
m
3-CNF-SAT is in fact based on the notion of tape-consistent sequences of the
computation steps; in reduction L
P
m
3-CNF-SAT, tape-consistent sequences are not considered
as a subset of the more general set of tape-arbitrary sequences of the computation steps.
In contrast, the solution suggested in the present paper is based on the concept of the set of tape-
arbitrary sequences of the computation steps that consists of the set of tape-consistent sequences and
the set of tape-inconsistent sequences. It turns out it takes polynomial time to determine if there
exists an accepting computation path using this concept.
Regarding reduction of problem 3-CNF-SAT to integer linear programming (for example, prob-
lem 0-1 ILP [19], and problem Simple D2CIF [22]), exponential time algorithms for problem ILP
were only known for now.
3.4 Program of machine MAcceptingPath
3.4.1 Non-deterministic multi-tape Turing machine MTArbitrarySeqs
Turing machine MTArbitrarySeqs) is constructed as follows:
1) the input of the machine is a word (x, ), wherein x is a word in alphabet and is a binary
positive integer;
2) the machine has one accepting state q
A
and rejecting state q
R
, q
R
,= q
A
.
Program 1. Turing machine MTArbitrarySeqs)
Input: Word (x, )
1. ( declarations of variables )
2. integer
tape
3.
4. ( main loop )
5. for each
step
[1..( + 1)]
6. do
7. if
step
= 1
8. then
9. compute nondeterministically computation step
t
1
= (q
start
, s, q

, s

, m, 1, 1)
of machine MNP);
tape
:= 1
10. else
12
11. compute nondeterministically computation step
t

step = (q, s, q

, s

, m,
tape
,
step
)
of machine MNP) such that denition 3.2 holds
12. ( end of if )
13.
14. if there is no computation step t

step
15. then
16. if
step
= + 1
17. then
18. ( machine MNP) stops at step )
19. stop at accepting state q
A
20. else
21. ( machine MNP) stops at step
step
such that
step
< )
22. stop at rejecting state q
R
23. ( end of if )
24. else
25. if
step
= + 1
26. then
27. ( machine MNP) does not stop at step )
28. stop at rejecting state q
R
29. ( end of if )
30. ( end of if )
31. ( end of main loop )
32.
33. stop at accepting state q
A
Proposition 3.3. There is one-to-one mapping from the set of the root-leaves accepting paths in
computation tree TArbitrarySeqTree, which is the computation tree of machine MTArbitrarySeqs),
to the set of the root-leaves paths in the

-length tape-arbitrary tree of the computation steps of


machine MNP) on input x.
Proposition 3.4. The time complexity of non-deterministic Turing machine MTArbitrarySeqs)
is polynomial in , and the space complexity is logarithmic in .
Proof. Values
tape
and
step
, contained in the computation steps of a -length sequence of the
computation steps, are binary integers such that abs(
tape
) and
step
, so the proposition
holds.
3.4.2 Deterministic algorithm ConstructTArbitrarySeqGraph
To construct graph TArbitrarySeqGraph, the algorithm performs deep-rst traversal of computation
tree TArbitrarySeqTree. The constructed graph is a direct acyclic graph of polynomial size; it has
one source node and a set of bottom nodes. As it is explained in subsection 3.2, computation tree is
not build explicitely in the algorithm of the construction of graph TArbitrarySeqGraph.
Notation 3.8. The computation step of machine MNP) contained in node u of computation tree
TArbitrarySeqTree is denoted by u.step.
Algorithm 1. ConstructTArbitrarySeqGraph
Input: Source node s of tree TArbitrarySeqTree
Output: Graph TArbitrarySeqGraph
13
Figure 3: Removing the chains ending with a rejecting state.
1. ( initialization )
2. set V isitedNodeSet :=
3. graph G := (, )
4.
5. ( main block )
6. DFTConstructGraphFromNode(s)
7. using an iterative algorithm, remove all the simple chains in graph G that end with a rejecting
state as it is shown in Figure 3; there TASG is the shortened indication of TArbitrarySeqGraph,
q
A
is an accepting state, q
R
is a rejecting state, and the elements of the graph that are removed
are red-colored
8.
9. return (graph G)
Sub-algorithm. DFTConstructGraphFromNode
Input: Node u of tree TArbitrarySeqTree
Updates: Set V isitedNodeSet, graph G
1. ( check if node u is already visited )
2. if u

V isitedNodeSet such that u

.step = u.step
3. then
4. return
5. ( end of if )
6.
7. ( update variables )
8. add u to V isitedNodeSet
9. add u to NodesG)
10.
11. ( main loop )
12. for each edge (u, v)
+
(u)
13. do
14. DFTConstructGraphFromNode(v)
15. add edge (u, v) to EdgesG)
16. ( end of main loop )
14
Lets note that deep-rst traversal, which is a recursive algorithm, of tree TArbitrarySeqTree
can be simulated on a deterministic multi-tape Turing machine using a non-recursive algorithm.
Proposition 3.5. There is one-to-one mapping from the set of the s-t paths in direct acyclic graph
TArbitrarySeqGraph to the set of the root-leaves paths in the -length tape-arbitrary tree of the
computation steps of machine MNP) on input x.
Proposition 3.6. The count of the nodes in graph TArbitrarySeqGraph is polynomial in .
Proof. Values
tape
and
step
, contained in the computation steps of a -length sequence of the
computation steps, are binary integers such that abs(
tape
) and
step
. Therefore, the count
of the nodes in graph TArbitrarySeqGraph is O

2
Clog()

(total count of dierent computation


steps of -length sequences) which is O

. So the proposition holds.


So, the count of the nodes in computation TArbitrarySeqTree can be exponential in , but the
count of the nodes in graph TArbitrarySeqGraph is polynomial in .
Proposition 3.7. The time complexity of deterministic algorithm ConstructTArbitrarySeqGraph
is polynomial in .
3.4.3 Deterministic algorithm ComputeTConsistPairSet
Notation 3.9. The set of pairs (u, v) of the nodes of graph TArbitrarySeqGraph, such that pair
(u.step, v.step) is a tape-consistent pair of computation steps, is denoted by TConsistPairSet.
Algorithm ComputeTConsistPairSet computes set TConsistPairSet.
The algorithm considers graph TArbitrarySeqGraph as an acyclic control ow graph
TArbSeqCFG
of a deterministic computer program that writes values to the tape cells and reads values from the
tape cells of machine MNP). Namely, each computation step
t = (q, s, q

, s

, m,
tape
,
step
)
in NodesTArbSeqCFG) is treated as the usage of symbol s in the tape cell with number
tape
and
the assignment of symbol s

to this tape cell.


To be used further, graph TArbSeqCFG is preliminarily transformed as follows:
1) add a special assignment Init which is treated as the assignment of the blank symbol to each
cell of the tape of machine MNP) when the machine starts;
2) add node
InitTArbSeqCFG)
and edge
(InitTArbSeqCFG), RootNodeTArbSeqCFG))
to graph TArbSeqCFG; let source node s be InitTArbSeqCFG);
3) create in graph TArbSeqCFG sink node t;
4) connect t with the bottom nodes.
Algorithm 2. ComputeTConsistPairSet
Input: Graph TArbSeqCFG
Output: Set TConsistPairSet
1. ( initialization )
15
2. set TConsistPairSet :=
3.
4. ( main block )
5. enumerate all the assignments to the tape cells in nodes NodesTArbSeqCFG)
6. enumerate all the usages of the tape cells in nodes NodesTArbSeqCFG)
7. using the reaching denitions analysis on control ow graph TArbSeqCFG and on the sets of
assignments and usages, compute set DefUsePairSet of the def-use pairs;
8. call ProcessDefUsePairSet
9.
10. return TConsistPairSet
Sub-algorithm. ProcessDefUsePairSet
Uses: Graph TArbSeqCFG, set DefUsePairSet
Updates: Set TConsistPairSet
1. for each pair (def, use) DefUsePairSet
2. do
3. ( let node
def
and node
use
be nodes in NodesTArbSeqCFG) containing assignment
def and usage use )
4. if pair (node
def
, node
use
) is a pair such that denition 3.14 holds
5. then
6. add pair (node
def
, node
use
) to TConsistPairSet
7. ( end of if )
8. ( end of for loop )
Proposition 3.8. The time complexity of deterministic algorithm
ComputeTConsistPairSet
is polynomial in .
Proof. The time complexity of the reaching denition analysis is polynomial in the count of the nodes
and the count of the edges in the control ow graph, so the proposition holds.
3.4.4 Deterministic algorithm DetermineIfExistsTConsistSeq
Denition 3.21. The problem of determining if there
p (p TConsistSeqSetx, S, ))
is denoted by TCPEP (Tape-Consistent Path Existence Problem).
Algorithm DetermineIfExistsTConsistSeq solves problem TCPEP using linear program for-
mulation. The input of the algorithm is tuple (TArbSeqCFG, TConsistPairSet, S) wherein S is a
set of the states of machine MNP); the algorithm determines if there exists a sequence in graph
TArbSeqCFG that contains pairs from TConsistPairSet and does not contain tape-inconsistent
pairs.
To be used in the algorithm, the edges in graph TArbSeqCFG that do not connect node t with
the bottom nodes u such that u.step contains a state q S are deleted. This transformation is used
in such a way that the computation paths of machine MNP) ending with states q S are only
considered.
16
Figure 4: Excluding the denitions that hides u
i
.
Commodities for tape-consistent pairs. Let
1) integer k = [TConsistPairSet[;
2) integer segment ISeg be [1..k];
3) subgraphs
G
i
= SubgraphTArbSeqCFG, (u
i
, v
i
))
for each i ISeg wherein (u
i
, v
i
) TConsistPairSet;
4) V
i
be NodesG
i
) and E
i
be EdgesG
i
).
Commodities K
i
= (s
i
, t
i
), i ISeg, in graph TArbSeqCFG are dened as follows:
1) the set of the nodes and the set of the edges of commodity K
i
are V
i
and E
i
(excluding some
nodes and edges as explained below);
2) s
i
= u
i
and t
i
= v
i
.
Some nodes d in G
i
are excluded so that both of the following hold:
1) they are contained in the paths between nodes u
i
and v
i
;
2) computation step d.step contains an assignment to the cell that is assigned in computation step
u
i
.step.
Such nodes are excluded because the denition in d.step hides the denition in u
i
(it is shown in
Figure 4; the excluded elements of graph G
i
are red-colored). Graphs G
i
without the excluded nodes
can be easily computed using label propagate algorithm: It is sucient to do the following:
1) propagate a label from node u
i
to node v
i
, excluding nodes d that hides the denition in u
i
;
2) propagate another label from node v
i
to node u
i
in such a way;
3) get the intersection of the subgraphs such that their nodes are labeled.
17
Linear program formulation.
Notation 3.10. L(u) = |j [ ((j ISeg) (u V
j
)).
For each commodity K
i
, lets introduce network ows equations [23]:
1) dene function F
i
from V
i
to rationals and function H
i
from E
i
to rationals;
2) for each v V
i
, v ,= s
i
,
F
i
[v] =

(u,v)E
i
,(u,v)

(v)
H
i
[(u, v)]; (1)
3) for each v V
i
, v ,= s
i
, v ,= t
i
,

(u,v)E
i
,(u,v)

(v)
H
i
[(u, v)] =

(v,w)E
i
,(v,w)
+
(v)
H
i
[(v, w)]. (2)
Further, lets introduce the following linear equations for the whole set of the commodities:
1)
F
i
[s
i
] = F
j
[s
i
] for j L(s
i
), (3)
F
i
[t
i
] = F
j
[t
i
] for j L(t
i
), (4)
wherein i ISeg;
2)

jL(s)
F
j
[s] = 1,

jL(t)
F
j
[t] = 1. (5)
Lets dene linear program TCPELP (Tape-Consistent Path Existence Linear Program) with linear
equations 15:
minimize 1
subject to Ux = b and x O (x is a fractional vector).
(6)
Proposition 3.9. There exists a solution of linear program (6) i there exists a sequence
p TConsistSeqSetx, S, ).
Proof. At rst, lets prove ((there exists a solution of LP (6)) (there exists a tape-consistent
sequence p)).
By induction. Base case: It follows from equations (3)(5) that there exist
1) a tape-consistent pair (u
i
1
, v
i
1
) such that u
i
1
= s, F
i
1
[u
i
1
] > 0, and F
i
1
[v
i
1
] > 0, and
2) path
p = (u
i
1
, .., u
i
2
, .., u
i
m
, .., v
i
m
, .., v
i
2
, .., v
i
1
).
Inductive step: It follows from equations (3) that there exists path
p

= (u
j
r
, .., u
j
2
, .., u
j
1
, .., v
j
1
, .., v
j
2
, .., v
j
r
)
wherein |j
1
, .., j
r
|i
1
, .., i
m
. Repeating inductive step, one should reach the sink node t.
Further, lets prove ((there exists a tape-consistent sequence p) (there exists a solution of LP
(6))).
Let F
i
[u
i
] = 1 and F
i
[v
i
] = 1 for tape-consisten pairs (u
i
, v
i
) such that u
i
p, v
i
p; let
H
i
[(x, z)] = 1 for (x, z) p. In that case, all the equations are satised.
18
Figure 5: An explanation of proposition 3.9.
Proposition 3.10. The time complexity of deterministic algorithm
DetermineIfExistsTConsistSeq
is polynomial in .
Proof. It follows from the following:
1) there exist polynomial time algorithms to solve problem LP [14, 15];
2) these algorithms can be applied to linear programs in standard form [24] and for linear programs
such that their polyhedrons are not full-dimensional polyhedrons [25].
An explanation of proposition 3.9 is shown in Figure 5; there
1) TASG is the shortened indication of TArbSeqCFG;
2) F[u
i
] > 0, F[v
i
] > 0, for i = 1, .., 3.
3.4.5 Pseudocode of machine MAcceptingPath
Deterministic multi-tape Turing machine MAcceptingPath) is constructed using deterministic al-
gorithms
ConstructTArbitrarySeqGraph, ComputeTConsistPairSet, and
DetermineIfExistsTConsistSeq.
Program 2. The program of Turing machine MAcceptingPath)
Input: Word x
Output: If there exists an accepting computation path of machine MNP) on input x
1. ( initialization )
2. integer := 1
3.
4. ( main loop )
19
5. while true
6. do
7. graph TArbitrarySeqGraph := ConstructTArbitrarySeqGraph(x, )
8.
9. construct control ow graph TArbSeqCFG
10. set TConsistPairSet := ComputeTConsistPairSet(TArbSeqCFG)
11.
12. ( here F is the set of the accepting states of machine MNP) )
13. (
1
= (p TConsistSeqSetx, F, )) )
14.
1
:= DetermineIfExistsTConsistSeq(TArbSeqCFG, TConsistPairSet, F)
15.
16. (
2
= ([TConsistSeqSetx, QAny), )[ > 0) )
17.
2
:= DetermineIfExistsTConsistSeq(TArbSeqCFG, TConsistPairSet, QAny))
18.
19. if
1
20. then
21. write True to the output
22. stop
23. ( end of if )
24.
25. if (
2
)
26. then
27. there is no t(n)

computation paths write False to the output


28. stop
29. ( end of if )
30.
31. + := 1
32. ( end of main loop )
Proposition 3.11. If MNP) is a non-deterministic single-tape Turing machine that decides a
language A, then deterministic multi-tape Turing machine MAcceptingPath) determines if there
exists an accepting computation path of machine MNP) on input x.
Proof. Machine MAcceptingPath) works as explained in subsection 3.2, so the machine determines
if there exists an accepting computation path of machine MNP).
Proposition 3.12. The time complexity of machine MAcceptingPath) is polynomial in t(n).
Proof. The time complexity of the algorithms, used in the program of machine MAcceptingPath),
is polynomial in , and [1..t([x[)); therefore, the time complexity of the machine is polynomial
in t(n).
3.5 Time complexity of machine MAcceptingPath
Let n count be [NodesTArbitrarySeqGraph)[ and e count be [EdgesTArbitrarySeqGraph)[.
The estimations of the time and space complexities of the constructed Turing machines are shown
in gures 6. The following is taken into account in the estimations of the time and space complexities
of the machine:
1) the count n count of the nodes in graph TArbitrarySeqGraph is O(t(n)
2
log(t(n))) because the
number of steps that are needed to compute the next computation step is O(log(t(n)));
2) the count n count
1
of the nodes, that correspond to the computation steps of Turing machine
MNP), in graph TArbitrarySeqGraph is O(t(n)
2
);
20
Algorithm/machine Used algorithm Overall time and space
complexity
machine
MTArbitrarySeqs
(not run explicitly)
O(t(n) log(t(n))) TM steps,
O(log(t(n))) TM tape cells
algorithm
ConstructTArbitrarySeqGraph
O(t(n)
2
log(t(n))) VN oper.,
O(t(n)
2
log(t(n))
2
) VN m.cells
algorithm
ComputeTConsistPairSet
reaching deninitons
analysis with time compl.
O((n count
1
)
2
)
O(t(n)
4
) VN operations,
O(t(n)
4
) VN memory cells
algorithm
DetermineIfExistsTConsistSeq
Karmarkars algorithm
with time complexity
O

(v count)
3.5
L M(L)

O(
7
t(n)
11
) VN opererations,
O(
7
t(n)
11
) VN memory cells
machine
MAcceptingPath
O

14
t(n)
24

TM steps,
O

14
t(n)
24

TM tape cells
pseudocode of machine
MAcceptingPath
O

7
t(n)
12

VN operations,
O

7
t(n)
12

VN memory cells
Figure 6: The time and space complexity of machine MAcceptingPath.
3) the count e count of the edges in graph TArbitrarySeqGraph is O( n count) wherein is a
constant that depends on transition relation of Turing machine MNP)
4) value k = [TConsistPairSet[ is O((n count
1
)
2
);
5) the count r of the paths in graph ArbitrarySeqGraph is 2
O(n count)
;
6) the matrix of the equations of linear program TCPELP is O(n count) O(e count) matrix;
7) the count of the equations in linear program TCPELP is O

n count
2
k

;
8) the count v count of the variables in linear program TCPELP is O(e count);
9) the length L of the input of linear program TCPELP is O(n count e count);
10) Karmarkass algorithm performs O(v count
3.5
L) operations on O(L) digits numbers wherein
v count is the number of the variables and L is the length of the input of linear program
TCPELP;
11) O

p
2
q

steps of multi-tape Turing machine are needed to get the elements of an array with p
elements wherein the length of each element is O(q);
12) the number of the iterations in the main loop of machine MAcceptingPath) is O(t(n));
13) deep-rst traversal, which is a recursive algorithm, of computation tree TArbitrarySeqTree and
graph TArbitrarySeqGraph can be simulated on a deterministic multi-tape Turing machine
using a stack of depth O(t(n)).
here t(n) is an upper bound of the time complexity of machine MNP).
4 Main results
21
In this section, machine MAcceptingPath) is used to introduce the main results. Constant (in
the propositions) depends on transition relation of Turing machine MNP).
4.1 Main theorem
If M is a deterministic multi-tape Turing machine that computes a function f(x) and works in time
t(n), then one can construct a deterministic single-tape Turing machine M

that computes the same


function and works in time O

t(n)
2

[1]; therefore, the following proposition holds.


Proposition 4.1. Every language in a nite alphabet that is decidable by a non-deterministic single-
tape Turing machine in time t(n) is also decidable by a deterministic single-tape Turing machine in
time O

14
t(n)
24

, wherein t(n) is an upper bound of the time complexity of machine MNP), and
is a constant depending on relation of machine MNP).
If t(n) is a polynomial, then machine MAcceptingPath) works in polynomial time in n (n = [x[
wherein x is the input of the machine); therefore, the following main theorem holds.
Theorem 4.1.
P = NP.
4.2 Proof of FP=FNP based on machine MAcceptingPath
The following algorithm RetieveAcceptingPath is similar to the algorithm for problem FSAT using
an algorithm for problem SAT.
This possibility of nding an accepting computation path in an explicit way, using machine
MAcceptingPath), is consistent with the fact that FP=FNP i P=NP [17].
Algorithm RetieveAcceptingPath works with graph TArbSeqCFG that is created at the iteration
of the main loop of the program of machine MAcceptingPath) when the machine writes True to
the output.
Algorithm 3. RetieveAcceptingPath
Input: Graph TArbSeqCFG, set TConsistPairSet
Output: An accepting computation path of machine MNP) on input x or empty path it there are
no accepting paths
1. ( initialization )
2. node r := s (the source node of the graph)
3. path p := () in graph TArbSeqCFG
4.
5. ( check if there exists an accepting computation path )
6. ( here F is the set of the accepting states of machine MNP) )
7.
F
:= DetermineIfExistsTConsistSeq(TArbSeqCFG, TConsistPairSet, F)
8. if (
F
)
9. then
10. return (empty path ())
11. ( end of if )
12.
13. ( main loop )
14. while true
15. do
16. if length(p) > 0
17. then
18. let p = (u
1
, . . . , u
m
)
19. if computation step u
m
.step contains a state q F
22
Figure 7: Retrieving an accepting computation path.
20. then
21. return (the accepting path corresponding to path p)
22. ( end of if )
23. ( end of if )
24.
25. for each edge (r, u)
+
(r)
26. do
27. ( here t is the sink node of graph TArbSeqCFG )
28. let subgraph G
u
be SubgraphG, (u, t))
29.
30. let path p

be path p concatenated with edge (r, u)


31. let G
p,u
be subgraph (p

G
u
)
32.
33. ( here TConsistPairSubset is the set of tape-consistent pairs (u, v) such that
nodes u and v are in subgraph G
p,u
)
34.
35.
F
:= DetermineIfExistsTConsistSeq(G
p,u
, TConsistPairSubset, F)
36.
37. if (
F
)
38. then
39. add node u to path p
40. r := u
41. break
42. ( end of if )
43. ( end of for loop )
44. ( end of main loop )
45.
46. return (empty path ())
The construction of an accepting computation path by this algorithm is explained in Figure 7
(there TASG is the shortened indication of TArbSeqCFG).
Proposition 4.2. Deterministic algorithm RetieveAcceptingPath outputs an accepting computation
23
path of machine MNP) on input x.
Proposition 4.3. The time complexity of algorithm RetieveAcceptingPath is O

14
t(n)
26

steps
of deterministic single-tape Turing machine ( O

7
t(n)
13

VN operations).
4.3 Some consequences
From the construction of machine MAcceptingPath), one can conclude that the following propo-
sition holds.
Proposition 4.4. Every language in a nite alphabet that is decidable by a non-deterministic single-
tape Turing machine in space s(n) is also decidable by a deterministic single-tape Turing machine in
time 2
O(s(n))
.
This result is also obtained by simulating non-deterministic computations on a deterministic
Turing machine [1].
In addition, proposition 4.1 is consistent with the fact that if P=NP then the following equality
holds: EXPTIME=NEXPTIME [1, 17].
One of the most important consequences of theorem 4.1 is that P=PH.
5 Conclusion
This paper presents the program of deterministic multi-tape Turing machine MAcceptingPath)
that determines in polynomial time if there exists an accepting computation path of polynomial time
non-deterministic single-tape Turing machine MNP) that decides a language A over a nite alphabet
(machine MAcceptingPath) is dierent for each machine MNP)). As a result, the equality of
classes P and NP is proved.
The computations presented in this paper are not ordinary computations in the sense that
the tape-inconsistent sequences of the computation steps are used to determine if there exists an
accepting computation path of machine MNP). The author of this paper proposes denoting these
computations by one of the following:
1) using-complement computations;
2) superuous computations.
The concept suggested in the present paper can be applied in some a way not only for Turing
machine programs but also for computer programs written on imperative programming languages
like Pascal or C#.
The time complexity of the pseudocode algorithm of machine MAcceptingPath) is O

7
t(n)
12

operations on a computer with Von Neumann architecture; constant depends on the number of the
entries in relation which is expected to be low for reasonable problems.
Therefore, the algorithms proposed in the present paper can be used in practice to implement
non-deterministic algorithms using deterministic imperative programs.
References
[1] D. Du, K. Ko Theory of Computational Complexity. John Wiley and Sons, 2000. p.491.
[2] S. A. Cook The complexity of theorem proving procedures in Proc. of the Third Annual ACM
Symposium on Theory of Computing, 1971. pp.151158.
[3] L. A. Levin Universal search problems in Problemy Peredaci Informacii 9, pp.115116, 1973.
Translated in problems of Information Transmission 9, pp.265266.
[4] S. A. Cook The P versus NP Problem.
Internet: www.claymath.org/millennium/P_vs_NP/pvsnp.pdf
24
[5] M. F. Sipser The history and status of the P versus NP question in STOC 92 Proceedings of
the Twenty-fourth Annual ACM Symposium on Theory of Computing, 1992. pp.603-618.
[6] S. A. Cook The importance of the P versus NP question in Journal of the ACM (JACM), Vol. 50,
Issue 1, 2003. pp.27-29.
[7] A. Wigderson P, NP and Mathematics A computational complexity perspective. In: Proceedings
of the ICM 2006, Madrid, Vol. I, pp.665-712. EMS Publishing House, Zurich, 2007.
[8] L. Fortnow The status of the P versus NP problem in Communications of the ACM, Vol. 52,
Issue 9, 2009. pp.78-86.
[9] R. J. Lipton The P=NP Question and Godels Lost Letter. Springer, 2010. p.253.
[10] Cornell University Library Computational Complexity.
Internet: http://arxiv.org/list/cs.CC/recent
[11] G. J. Woeginger The P-versus-NP Page.
Internet: http://www.win.tue.nl/
~
gwoegi/P-versus-NP.htm
[12] M. R. Garey, D. S. Johnson Computers and Intractability: A Guide to the Theory of NP-
Completeness. Freeman, 1979. p.338.
[13] A. Schrijver Combinatorial Optimization (3 volumes). Springer, 2003. p.1800.
[14] N. Karmarkar A new polynomial time algorithm for linear programming in Combinatorica,
Vol. 4, nr. 4, 1984. pp.373395.
[15] L. G. Khachiyan Polynomial algorithms in linear programming in Zh. Vychisl. Mat. Mat. Fiz.,
20:1, 1980. pp.5168.
[16] S. Arora, B. Barak Computational Complexity: A Modern Approach. Cambridge University Press,
2009. p.594.
[17] C. H. Papadimitriou Computational Complexity. White Plains: Addison-Wesley, 1994. p.523.
[18] O. Goldreich Computational Complexity: A Conceptual Perspective. Cambridge University Press,
2008. p.632.
[19] R. M. Karp Reducibility among combinatorial problems in Complexity of Computer Computa-
tions. New York: Plenum, 1972. pp.85103.
[20] F. Nielson, H. R. Nielson, C. Hankin Principles of Program Analysis. Springer (2nd printing),
2005. p.452.
[21] S. A. Cook The Complexity of Theorem Proving Procedures in Proceedings of the third annual
ACM Symposium on Theory of Computing, 1971. pp.151158.
[22] S. Even, A. Itai, A. Shamir On the complexity of timetable and multicommodity ow problems
in SIAM Journal on Computing (SIAM) 5 (4), 1976. pp.691703.
[23] T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein Introduction to Algorithms, Third Edition.
The MIT Press, 2009. p.1312.
[24] D. M. Gay A variant of Karmarkars linear programming algorithm for problems in standard
form in Math. Program. journal, Springer-Verlag, Vol. 37, No. 1, 1987. pp.8190.
[25] A. Schrijver Theory of Linear and Integer Programming. John Wiley and Sons, 1998. p.484.
25

S-ar putea să vă placă și