Preprint
Article

This version is not peer-reviewed.

On the P Versus NP Problem

Submitted:

07 December 2024

Posted:

11 December 2024

Read the latest preprint version here

Abstract
The P versus NP problem is a cornerstone of theoretical computer science, asking whether problems that are easy to check are also easy to solve. "Easy" here means solvable in polynomial time, where the computation time grows proportionally to the input size. While this problem's origins can be traced to John Nash's 1955 letter, its formalization is credited to Stephen Cook and Leonid Levin. Despite decades of research, a definitive answer remains elusive. Central to this question is the concept of NP-completeness. If even one NP-complete problem, like SAT, could be solved efficiently, it would imply that all NP problems could be solved efficiently, proving P=NP. This research proposes a groundbreaking claim: SAT, traditionally considered NP-complete, can be solved in polynomial time, establishing the equivalence of P and NP.
Keywords: 
;  ;  ;  ;  

1. Introduction

The P versus NP problem is a fundamental question in computer science that asks whether problems whose solutions can be easily checked can also be easily solved [1]. “Easily” here means solvable in polynomial time, where the computation time grows proportionally to the input size [1,2]. Problems solvable in polynomial time belong to the class P, while NP includes problems whose solutions can be verified efficiently given a suitable “certificate” [2].
The central question is whether P and NP are the same. Most researchers believe that P is a strict subset of NP, meaning that some problems are inherently harder to solve than to verify. Resolving this problem has profound implications for fields like cryptography and artificial intelligence [3,4]. The P versus NP problem is widely considered one of the most challenging open questions in computer science. Techniques like relativization and natural proofs have yielded inconclusive results, suggesting the problem’s difficulty [5,6].
Resolving the P versus NP problem is often described as a “holy grail” of computer science. A positive resolution could revolutionize our understanding of computation and potentially lead to groundbreaking algorithms for critical problems. The problem is listed among the Millennium Prize Problems. While recent years have seen progress in related areas, such as finding efficient solutions to specific instances of NP-complete problems, the core question of P versus NP remains unanswered [3]. A polynomial-time algorithm for any NP-complete problem would directly imply P equals NP [7]. Our work focuses on presenting such an algorithm for a well-known NP-complete problem.

2. Background and Ancillary Results

NP-complete problems are the Everest of computational challenges. Despite the ease of verifying proposed solutions with a succinct certificate, finding these solutions efficiently remains an elusive goal. A problem is classified as NP-complete if it satisfies two stringent criteria within computational complexity theory:
  • Efficient Verifiability: Solutions can be quickly checked using a concise proof [7].
  • Universal Hardness: Every problem in the class NP can be reduced to this problem without significant computational overhead [7].
The implications of finding an efficient algorithm for a single NP-complete problem are profound. Such a breakthrough would serve as a master key, unlocking efficient solutions for all problems in NP, with transformative consequences for fields like cryptography, artificial intelligence, and planning [3,4].
Illustrative examples of NP-complete problems include:
  • Boolean Satisfiability (SAT) Problem: Given a logical expression in conjunctive normal form, determine if there exists an assignment of truth values to its variables that makes the entire expression true [8].
  • Boolean 3-Satisfiability (3SAT) Problem: Given a Boolean formula in conjunctive normal form with exactly three literals per clause, determine if there exists a truth assignment to its variables that makes the formula evaluate to true [8].
  • Not-All-Equal 3-Satisfiability (NAE-3SAT) Problem: Given a Boolean formula in conjunctive normal form with exactly three literals per clause, decide if there exists a satisfying truth assignment such that each clause has at least one true variable and at least one false variable [8].
  • Exact K-Coloring Problem: Given a graph G and a positive integer k, determine if there exists a valid coloring of G such that exactly k vertices have the same color and no adjacent vertices have the same color. This problem is equivalent to finding an independent set of size k, an NP-complete problem [8].
The provided examples represent a small subset of the extensively studied NP-complete problems relevant to our current work. The following problem is in P [8]:
Definition 1. 
Exact Cover Packing by 2-Sets (X2SCP) Problem
INSTANCE: A universe set U, a collection of C = S 1 , , S n of 2-elements sets with S i U and a positive integer k n , where every element in U appears exactly twice in the collection C and the induced graph on U with edges defined by the sets in C is bipartite.
QUESTION: Is there a partition of k sets S 1 , , S k such that S i S j = for 1 i j k and S 1 S k = U ?
REMARKS: By employing matching techniques, both the Set Packing and Exact Cover problems, where each set contains exactly two elements, can be efficiently solved in polynomial time [8].
An independent set V is a subset of vertices in a graph G where no two vertices in the set are connected by an edge. In addition, a vertex cover (sometimes called a node cover) of a graph G is a subset of its vertices, denoted by V , such that every edge in G has at least one endpoint in V . A bipartite graph, denoted as B = ( U , V , E ) , is an undirected graph characterized by the existence of two node sets U , V and edges in E that only connect nodes from opposite sets.
Definition 2. 
Exact Independent Vertex Cover (XIVC) Problem
INSTANCE: An undirected graph G = ( V , E ) and a positive integer k.
QUESTION: Is there set V of exactly k vertices such that V is both a vertex cover and an independent set in G?
REMARKS: The XIVC problem is reducible to the problem of finding a 2-coloring of a bipartite graph with a specified color class size of k. Given the polynomial-time solvability of the 2-coloring problem for bipartite graphs, the XIVC problem can also be solved in polynomial time.
Formally, a Boolean formula ϕ is composed of:
  • Boolean variables: x 1 , x 2 , , x n ;
  • Boolean connectives: Any Boolean function with one or two inputs and one output, such as ∧(AND), ∨(OR), ¬(NOT), ⇒(IMPLICATION), ⇔(IF AND ONLY IF);
  • and parentheses.
A truth assignment for a Boolean formula ϕ is a mapping from the variables of ϕ to the Boolean values { true , false } . A truth assignment is satisfying if it makes ϕ evaluate to true. A Boolean formula is satisfiable if it has at least one satisfying truth assignment. A literal is a Boolean variable or its negation. A Boolean formula is in Conjunctive Normal Form ( C N F ) if it is a conjunction (AND) of clauses, where each clause is a disjunction (OR) of one or more literals [7]. The SAT problem asks whether a given Boolean formula in C N F is satisfiable [8]. A 3 C N F formula is a C N F formula in which each clause contains exactly three distinct literals [7]. For example, the following formula is in 3 C N F :
( x 1 ¬ x 2 x 3 ) ( ¬ x 1 x 3 x 2 ) ( ¬ x 1 ¬ x 3 x 2 )
The first clause, ( x 1 ¬ x 2 x 3 ) , contains the three literals x 1 , ¬ x 2 and x 3 . The version of SAT where formulas are in 3 C N F is called 3SAT [7]. We formally define the following problem:
Definition 3. 
Monotone Not-All-Equal 3-Satisfiability (NAE-3MSAT) Problem
INSTANCE: A Boolean formula in 3 C N F with monotone clauses (meaning the variables are never negated).
QUESTION: Is there exists a satisfying truth assignment such that each clause has at least one true variable and at least one false variable?
REMARKS: This problem is complete for NP [9]. Here, the certificate is an appropriate satisfying truth assignment, meaning it satisfies the NAE-3MSAT condition for each clause.
In addition, a 2 C N F formula is a Boolean formula in conjunctive normal form with exactly two distinct literals per clause. Now, we introduce the last problem:
Definition 4. 
Exact Monotone XOR 2-Satisfiability (XX2MSAT) Problem
INSTANCE: An n-variable 2 C N F formula with monotone clauses (meaning the variables are never negated) using XOR logic operators ⊕ (instead of using the operator ∨) and a positive integer k.
QUESTION: Is there exists a satisfying truth assignment in which exactly k of the variables are true?
By presenting the NP-completeness and a polynomial time algorithm to SAT, we would establish a proof that P equals NP.

3. Main Result

Even though the following reductions are widely known, we will rely on them as supporting results in our analysis [8].
Theorem 1. 
The problem SAT can be reduced to 3SAT in polynomial time.
Proof. 
We will not delve into the specific steps of this reduction, as it is a standard technique in computer science [7]. To reduce a general SAT instance to a 3SAT formula, we can follow these steps:
  • Expand Clauses with Few Literals: To ensure that all clauses contain exactly three literals, we introduce two new variables and expand clauses with at most two literals into clauses with three literals by considering all possible combinations of the new variables, both negated and positive. For instance, consider the two new variables A and B. A single-literal clause ( x ) can be equivalently expressed as:
    ( x A B ) ( x ¬ A ¬ B ) ( x A ¬ B ) ( x ¬ A B ) .
    Similarly, a two-literal clause ( x y ) is equivalent to:
    ( x y A ) ( x y ¬ A ) ( x y B ) ( x y ¬ B ) .
    Note that the same variables A and B are used in both cases.
  • Identify Long Clauses: Find all clauses with more than three literals.
  • Introduce New Variables: For a clause with n literals (where n > 3 ), introduce n 3 new variables.
  • Create New Clauses: Create a chain of clauses with three literals each, using the original literals and the new variables. Ensure that the satisfiability of the original clause is preserved in this chain of new clauses. To exemplify, consider a clause containing four literals, ( x y z w ) . By introducing a single additional variable, D, this clause can be logically represented as the conjunction of the following two clauses:
    ( x y ¬ D ) ( D z w ) .
By systematically applying this reduction to each clause, we can transform any SAT instance into an equivalent 3SAT formula. This reduction demonstrates that 3SAT is at least as hard as the general SAT problem, and thus, it is an NP-complete problem. □
Theorem 2. 
The problem 3SAT can be reduced to NAE-3SAT in polynomial time.
Proof. 
Any 3SAT formula ϕ can be reduced to an equivalent NAE-3SAT instance. This reduction involves the following steps:
  • Variable Introduction:
    • Global Variable: Introduce a new variable w that does not appear in ϕ .
    • Clause Variables: For each clause c i = ( x y z ) in ϕ , introduce a new variable a i .
  • Clause Construction:
    Clause Reduction: For each clause c i = ( x y z ) , construct two NAE-3SAT clauses:
    • ( x y a i ) ( z ¬ a i w ) .
By construction, a satisfying truth assignment for ϕ corresponds to an appropriate satisfying truth assignment for the NAE-3SAT instance when w is assigned the value false, and vice versa. When w is true, we can obtain a satisfying truth assignment for ϕ by negating all the values in an appropriate satisfying truth assignment for the NAE-3SAT instance. This reduction demonstrates that NAE-3SAT is NP-complete. □
Theorem 3. 
The problem NAE-3SAT can be reduced to NAE-3MSAT in polynomial time.
Proof. 
It is well-known that any Boolean formula ϕ in NAE-3SAT can be reduced to an equivalent NAE-3MSAT instance. This reduction involves the following steps:
  • Variable Introduction:
    • Literal Variables: For each variable x in ϕ , introduce two variables: x + representing the positive literal x and x representing the negative literal ¬ x . Additionally, we introduce three new variables a x , b x , and c x for each variable x in ϕ .
  • Clause Construction:
    • Clause Reduction: For each clause c i = ( x y z ) , construct one NAE-3MSAT clause:
      ( x s x y s y z s z ) , where s v is + if literal v { x , y , z } is positive and − otherwise.
    • Variable Consistency: For each variable x in ϕ , construct four NAE-3MSAT clauses:
      ( x + x a x ) , ( x + x b x ) , ( x + x c x ) , and ( a x b x c x ) . These clauses ensure that exactly one of x + and x is true.
By construction, an appropriate satisfying truth assignment for ϕ corresponds to an appropriate satisfying truth assignment for the NAE-3MSAT instance, and vice versa. Thus, this reduction proves that NAE-3MSAT is NP-complete. □
This is a significant result.
Theorem 4. 
The problem NAE-3MSAT can be reduced to X2SCP in polynomial time.
Proof. 
To better visualize this polynomial time reduction, we will use a graphical representation of the sets involved. To represent a NAE-3MSAT formula ϕ as a collection of sets C over a universe U, we introduce a gadget for each variable x in ϕ . To enforce consistency, we connect all positive literals of a variable x to the logical constraints of the clauses where they appear. This ensures that if a positive literal of x is chosen in one clause, all other positive literals of x must also be selected, effectively "covering" all occurrences of x. The connection between variable x and clauses c h , c i , and c j is illustrated in Figure 1 and Figure 2. These figures correspond to selecting the sets
{ ¬ x h , v h , i } , { ¬ x i , v i , j } , { ¬ x j , v j , h } , { ¬ v h , i , x i } , { ¬ v i , j , x j } , { ¬ v j , h , x h } , { v h , i , w h , j } , { w h , j , ¬ v i , j } , { v i , j , w i , h } , { w i , h , ¬ v j , h } , { v j , h , w j , i } , { w j , i , ¬ v h , i } ,
after of introducing the new elements v h , i , v i , j , v j , h , ¬ v h , i , ¬ v i , j , ¬ v j , h , w h , j , w i , h , and w j , i , where dashed vertices correspond to the literals of x that are absent from clauses c h , c i , c j in ϕ .
The topology of the gadget ensures consistency. The construction (e.g., Figure 1 and Figure 2) guarantees that if any positive vertex is matched with some vertices outside of the gadget then all negative vertices can only be matched inside this gadget, and vice versa. Thus, the "availability" of a vertex to be matched by an outside vertex corresponds to the truth assignment.
To represent each clause c i = ( x y z ) in ϕ , we define three sets:
{ ¬ x i , y i } , { ¬ y i , z i } , { ¬ z i , x i } .
By ensuring that exactly one of these sets is chosen, we satisfy the NAE-3MSAT condition for clause c i . If all variables in c i have the same truth assignment, none of these sets can be selected. Conversely, if c i is satisfied under the NAE-3MSAT condition, then exactly one of these sets can be covered.
A Boolean formula ϕ satisfies the NAE-3MSAT constraints if and only if its corresponding collection of sets C can be partitioned into 7 · m disjoint sets, where m is the number of clauses in ϕ . This equivalence follows directly from the construction of C, which is designed to faithfully represent the logical structure of ϕ over the universe U.
The collection of sets C incorporates two types of set:
  • Variable Sets: The construction depicted in Figure 1 and Figure 2 enables the selection of two sets for each variable occurrence within a clause of ϕ . Since each clause comprises three distinct variables, there are precisely 6 · m such sets.
  • Clause Sets: The final step enforces the NAE-3MSAT condition by requiring each clause in ϕ to choose exactly one set. This guarantees the existence of precisely m clause sets that induce an appropriate satisfying truth assignment for ϕ .
Hence, an appropriate satisfying truth assignment for ϕ directly corresponds to a partition of C into 7 · m disjoint sets: 6 · m variable sets and m clause sets. Conversely, any such partition of C can be interpreted as an appropriate satisfying truth assignment for ϕ . This one-to-one correspondence establishes the equivalence between the appropriate satisfiability of ϕ and the existence of 7 · m disjoint sets in C covering U, where each element in U belongs to exactly two sets in C. Additionally, the graph constructed from U and the sets in C is bipartite, as there are no cycles of odd length in this graph. The proof is hereby concluded. □
This is a main insight.
Theorem 5. 
The problem X2SCP can be reduced to XX2MSAT in polynomial time.
Proof. 
We present a reduction from the X2SCP problem to the XX2MSAT problem. Given an instance ( U , C , k ) of X2SCP, we construct an equivalent XX2MSAT instance as follows:
  • Formula Construction:
    • Variables: For each set S i C , introduce a Boolean variable x i .
    • Clauses: For every pair of sets S i , S j C that share a common element u U , create a clause ( x i x j ) .
  • Equivalence of Solutions:
    • A solution to the X2SCP instance, consisting of k mutually disjoint sets that cover U, directly corresponds to a truth assignment to the XX2MSAT instance where k variables are true.
    • Conversely, a truth assignment to the XX2MSAT instance with k true variables corresponds to a selection of k sets in C that are mutually disjoint and cover U.
    To see why, consider the following:
    • Covering the Universe: The clause structure ensures that every element in U is covered by exactly one selected set. If an element is not covered, then the corresponding clause would be unsatisfied.
    • Mutual Disjointness: The XOR clauses between pairs of intersecting sets enforce mutual disjointness. If two sets with a common element are both selected, the corresponding clause would be unsatisfied.
    • Satisfiability Criterion: Given that the induced graph on U with edges defined by the sets in C is bipartite, the constructed 2CNF formula employing XOR operators is satisfiable.
Therefore, the X2SCP problem and the XX2MSAT problem are equivalent, and a solution to one can be efficiently transformed into a solution to the other. □
These are the main theorems.
Theorem 6. 
X I V C P .
Proof. 
Given the efficient solvability of the 2-coloring problem in bipartite graphs, we claim that the XIVC problem can be accomplished within polynomial time. This is a straightforward dynamic programming algorithm similar to solve subset sum: Let ( A 1 , B 1 ) , ( A 2 , B 2 ) , ( A p , B p ) be the sides of partitions A i and B i in a connected component i of the bipartite graph B = ( U , V , E ) , such that every vertex in a single partition has the same color.
Now, we create a dynamic programming table D P [ i , t ] that stores whether it is possible to have a bipartite graph with exactly t vertices on one color using the i first components. The bi-dimensional boolean array D P , having dimensions ( p + 1 ) by ( k + 1 ) and zero-based indexing. All elements are assigned the value false , with the exception of the element at index ( 0 , 0 ) which is assigned the value true (i.e., D P [ 0 , 0 ] = true ). Using the recurrence
D P [ i , t ] = D P [ i 1 , t A i ] D P [ i 1 , t B i ] ,
we correctly decide whether there exists an entire partitioning of exactly k vertices with the same color after by examining D P [ p , k ] , where is the cardinality set function. The recurrence evaluates D P [ i , t ] as false for any i and t that do not satisfy 0 i p and 0 t k . This is a polynomial time algorithm since the running time is bounded by O ( U + V + E + p · ( k + 1 ) ) . Identifying 2-color partitions takes O ( U + V + E ) time using breadth-first search algorithm (BFS), while finding k vertices of the same color requires O ( p · ( k + 1 ) ) iterations. We can easily determine if a graph is two-colorable by performing a breadth-first search and assigning alternating colors to the nodes. Every connected component is partitioned into two sets using two colors. For isolated vertices, one of the sets is empty. Similarly, the dynamic programming algorithm to solve subset sum (in this specific variation) can be solved by systematically checking all possible values from 0 to k using each pair of partitions for every connected component. □
Theorem 7. 
X X 2 M S A T P .
Proof. 
There is a connection between finding a satisfying truth assignment in XX2MSAT with exactly k true variables and finding a set of k vertices that is both a vertex cover and an independent set in a specific graph construction.
Here’s a breakdown of the equivalence:
  • Graph Construction:
    • Each vertex in the new graph represents a variable in the XX2MSAT formula.
    • Edges are created between variables based on the structure of the 2 C N F clauses: If two variables appear in a clause (e.g., ( x y ) ), then an edge is drawn between the corresponding vertices in the graph.
  • XX2MSAT and the Graph:
    • A truth assignment in XX2MSAT where exactly k variables are true directly translates to a set of k vertices in the constructed graph where true variables correspond to the vertices included in the set.
    • The properties of XX2MSAT clauses ensure that:
      Vertex Cover: The chosen vertices cover all the edges (due to the structure of the clauses and the way edges are formed). This satisfies the vertex cover condition.
      Independent Set: The chosen vertices don’t have any edges connecting them (because the variables are connected in the graph, and only one variable from each clause can be true). This satisfies the independent set condition.
Therefore, finding a satisfying truth assignment with exactly k true variables in XX2MSAT is indeed equivalent to finding a set of k vertices that fulfills both vertex cover and independent set requirements in the corresponding graph. However, we know the problem of finding a set of k vertices that is both a vertex cover and an independent set can be solved in polynomial time. Consequently, the instances of the problem XX2MSAT can be solved in polynomial time as well. □
This is a key finding.
Theorem 8. 
S A T P .
Proof. 
This follows directly from Theorems 1, 2, 3, 4, 5, 6, and 7. □
This is the definitive result.
Theorem 9. 
P = N P .
Proof. 
Cook’s Theorem states that every NP problem can be reduced to SAT in polynomial time [8]. Given that SAT is an NP-complete problem, a polynomial time algorithm for it, as presented here, would directly imply P equals NP. □

4. Conclusions

A definitive proof that P equals NP would fundamentally reshape our computational landscape. The implications of such a discovery are profound and far-reaching:
  • Algorithmic Revolution.
    The most immediate impact would be a dramatic acceleration of problem-solving capabilities. Complex challenges currently deemed intractable, such as protein folding, logistics optimization, and certain cryptographic problems, could become efficiently solvable [10]. This breakthrough would revolutionize fields from medicine to cybersecurity. Moreover, everyday optimization tasks, from scheduling to financial modeling, would benefit from exponentially faster algorithms, leading to improved efficiency and decision-making across industries [10].
  • Scientific Advancements.
    Scientific research would undergo a paradigm shift. Complex simulations in fields like physics, chemistry, and biology could be executed at unprecedented speeds, accelerating discoveries in materials science, drug development, and climate modeling [10]. The ability to efficiently analyze massive datasets would provide unparalleled insights in social sciences, economics, and healthcare, unlocking hidden patterns and correlations [10].
  • Technological Transformation.
    Artificial intelligence would be profoundly impacted. The development of more powerful AI algorithms would be significantly accelerated, leading to breakthroughs in machine learning, natural language processing, and robotics [10]. While the cryptographic landscape would face challenges, it would also present opportunities to develop new, provably secure encryption methods [10].
  • Economic and Societal Benefits.
    The broader economic and societal implications are equally significant. A surge in innovation across various sectors would be fueled by the ability to efficiently solve complex problems. Resource optimization, from energy to transportation, would become more feasible, contributing to a sustainable future [10].
In conclusion, a proof of P = N P would usher in a new era of computational power with transformative effects on science, technology, and society. While challenges and uncertainties exist, the potential benefits are immense, making this a compelling area of continued research.

References

  1. Cook, S.A. The P versus NP Problem, Clay Mathematics Institute. 2022. Available online: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf (accessed on 7 December 2024).
  2. Sudan, M. The P vs. NP problem. 2010. Available online: http://people.csail.mit.edu/madhu/papers/2010/pnp.pd (accessed on 7 December 2024).
  3. Fortnow, L. Fifty years of P vs. NP and the possibility of the impossible. Communications of the ACM 2022, 65, 76–85. [Google Scholar] [CrossRef]
  4. Aaronson, S. P=?NP. Open Problems in Mathematics 2016, 1–122. [Google Scholar] [CrossRef]
  5. Baker, T.; Gill, J.; Solovay, R. Relativizations of the P=?NP Question. SIAM Journal on Computing 1975, 4, 431–442. [Google Scholar] [CrossRef]
  6. Razborov, A.A.; Rudich, S. Natural Proofs. Journal of Computer and System Sciences 1997, 1, 24–35. [Google Scholar] [CrossRef]
  7. Cormen, T.H.; Leiserson, C.E.; Rivest, R.L.; Stein, C. Introduction to Algorithms, 3rd ed.; The MIT Press, 2009. [Google Scholar]
  8. Garey, M.R.; Johnson, D.S. Computers and Intractability: A Guide to the Theory of NP-Completeness, 1 ed.; W. H. Freeman and Company: San Francisco, 1979. [Google Scholar]
  9. Schaefer, T.J. The complexity of satisfiability problems. In STOC ’78: Proceedings of the tenth annual ACM symposium on Theory of computing; 1978; pp. 216–226. [Google Scholar] [CrossRef]
  10. Fortnow, L. The status of the P versus NP problem. Communications of the ACM 2009, 52, 78–86. [Google Scholar] [CrossRef]
Figure 1. x-gadget for the occurrences of x in clauses c h , c i , c j of ϕ .
Figure 1. x-gadget for the occurrences of x in clauses c h , c i , c j of ϕ .
Preprints 142160 g001
Figure 2. Covering all occurrences of x.
Figure 2. Covering all occurrences of x.
Preprints 142160 g002
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated