- Notifications
You must be signed in to change notification settings - Fork0
Polynomial-Time Algorithm for MVC (P = NP)
frankvegadelgado/mvc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Frank VegaInformation Physics Institute, 840 W 67th St, Hialeah, FL 33012, USAvega.frank@gmail.com
TheMinimum Vertex Cover (MVC) problem is a cornerstone of graph theory and computer science. Given an undirected graph
In an undirected graph
Conventional methods for solving MVC depend on approximations, such as a factor-2 greedy algorithm, or exact solutions that require exponential time. In this study, we introduce a novel polynomial-time algorithm for the Minimum Vertex Cover (MVC) problem, which delivers an exact solution in
The algorithm transforms the input graph
importnetworkxasnxdeffind_vertex_cover(graph):ifnotisinstance(graph,nx.Graph):raiseValueError("Input must be an undirected NetworkX Graph.")ifgraph.number_of_nodes()==0orgraph.number_of_edges()==0:returnset()isolated_nodes=list(nx.isolates(graph))graph.remove_nodes_from(isolated_nodes)ifgraph.number_of_nodes()==0:returnset()chordal_graph=nx.Graph()foriingraph.nodes():forjingraph.neighbors(i):ifi<j:chordal_graph.add_edge((i,i), (i,j))chordal_graph.add_edge((j,j), (i,j))chordal_graph.add_edge((i,i), (j,i))chordal_graph.add_edge((j,j), (j,i))foriingraph.nodes():forjingraph.nodes():ifi<j:chordal_graph.add_edge((i,i), (j,j))tuple_nodes=minimum_dominating_set_in_chordal_graph(chordal_graph)optimal_vertex_cover= {nodefortuple_nodeintuple_nodesfornodeintuple_node}returnoptimal_vertex_cover
- Transformation:
$G'$ has Type 1 nodes$(i, i)$ for each vertex$i$ in$G$ (forming a clique) and Type 2 nodes$(i, j)$ and$(j, i)$ for each edge$(i, j)$ in$G$ , connected to$(i, i)$ and$(j, j)$ . - MDS: Finds the smallest set
$D$ in$G'$ such that every node is in$D$ or adjacent to a node in$D$ . - Extraction: Maps
$D$ back to vertices in$G$ .
- Chordal Property:
$G'$ is chordal (every cycle of length 4+ has a chord), enabling efficient MDS computation. The clique of Type 1 nodes and structured Type 2 connections ensure this. The Type 1 nodes form a clique, which is trivially chordal. Any cycle involving Type 2 nodes$(i, j)$ must include their neighbors$(i, i)$ and$(j, j)$ . Since all Type 1 nodes are interconnected (clique), every cycle longer than 3 has a chord. Thus,$G'$ is chordal. - Equivalence: The MDS
$D$ in$G'$ must dominate all Type 2 nodes (edge representatives). Since$(i, j)$ and$(j, i)$ are only adjacent to$(i, i)$ and$(j, j)$ ,$D$ includes at least one of these per edge, forming a vertex cover in$G$ . - Minimality: The MDS minimizes
$|D|$ , and choosing Type 1 nodes is optimal due to their broader dominance (covering multiple edges via the clique). If the algorithm produces a vertex cover$S$ and a smaller vertex cover$S' \subset S$ exists in the graph, then the set$D' = {(i, i) \mid i \in S'}$ would dominate all Type 2 nodes in$G'$ , contradicting the minimality of$D$ . - Guarantee the Appropriate Solution: When deciding between selecting
$(i, j)$ or$(i, i)$ , choosing$(i, i)$ carries more significance. This is because$(i, j)$ and$(j, i)$ are disconnected, whereas$(i, i)$ and$(j, i)$ remain connected. This ensures that the MDS$D$ solution is derived from tuple nodes of the form$(a, b)$ where$a = b$ . Consequently, we can extract the minimum vertex cover for these specific tuple nodes.
- Graph:
$V = {0, 1, 2}$ ,$E = {(0, 1), (1, 2)}$ (path) - MVC:
${1}$ (size 1) $G'$ :- Nodes:
$(0, 0), (1, 1), (2, 2), (0, 1), (1, 0), (1, 2), (2, 1)$ - Edges:
$(0, 0)-(1, 1)-(2, 2)$ and$(0, 0)-(2, 2)$ (clique), plus$(0, 0)-(0, 1), (1, 1)-(0, 1), (0, 0)-(1, 0), (1, 1)-(1, 0)$ , and$(1, 1)-(1, 2), (2, 2)-(1, 2), (1, 1)-(2, 1), (2, 2)-(2, 1)$
- Nodes:
- MDS:
$D = {(1, 1)}$ dominates all nodes (size 1). - Output:
${1}$ , correct.
For all cases (e.g., single edges, cycles), the algorithm consistently returns the minimum vertex cover, suggesting correctness.
- Preprocessing: Removing isolates is
$O(|V|)$ . $G'$ Construction:- Nodes
$V'$ :$O(|V| + |E|)$ (Type 1:$|V|$ , Type 2:$2|E|$ with$i < j$ ). - Edges
$E'$ :$O(|V|^2 + |E|)$ (clique:$|V|(|V|-1)/2$ , 4 edges per$|E|$ ).
- Nodes
- MDS Computation: In chordal graphs, MDS is solvable in linear time relative to
$|V'| + |E'|$ , here$O(|V|^2)$ . - Extraction:
$O(|V|)$ . - Total:
$O(|V|^2)$ , polynomial time.
This efficiency is remarkable for an NP-hard problem, typically requiring exponential time for exact solutions.
- P=NP: MVC is NP-complete, so a polynomial-time exact solution implies
$P = NP$ . This would mean all NP problems (e.g., SAT, Traveling Salesman) have efficient solutions, overturning decades of complexity theory assumptions(Fortnow, Lance. "Fifty years of P vs. NP and the possibility of the impossible." Communications of the ACM 65, no. 1 (2022): 76–85. doi: 10.1145/3460351). - Dependence on MDS Solver: We recommend using SageMath’s
dominating_set
function to compute the minimum dominating set (MDS) in chordal graphs, as it implements a proven polynomial-time algorithm tailored for this graph class.
- Optimization: Faster MVC solutions could enhance network design, scheduling, and bioinformatics workflows.
- Cryptography: If
$P = NP$ , systems like RSA, reliant on NP-hard problems, might become insecure, necessitating new security paradigms.
This algorithm resolves MVC in