Submit Search
Upload
Np complete reductions
•
Download as PPTX, PDF
•
0 likes
•
108 views
Wael Badawy
Follow
Np complete reductions
Read less
Read more
Education
Report
Share
Report
Share
1 of 47
Download now
Recommended
Classical access structures of ramp secret sharing based on quantum stabilize...
Classical access structures of ramp secret sharing based on quantum stabilize...
Ryutaroh Matsumoto
Time complexity
Time complexity
Wael Badawy
Regular pumping
Regular pumping
Wael Badawy
N F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite Automata
Wael Badawy
Regular expressions
Regular expressions
Wael Badawy
Regular properties
Regular properties
Wael Badawy
Turing variations
Turing variations
Wael Badawy
Computer Vision panoramas
Computer Vision panoramas
Wael Badawy
Recommended
Classical access structures of ramp secret sharing based on quantum stabilize...
Classical access structures of ramp secret sharing based on quantum stabilize...
Ryutaroh Matsumoto
Time complexity
Time complexity
Wael Badawy
Regular pumping
Regular pumping
Wael Badawy
N F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite Automata
Wael Badawy
Regular expressions
Regular expressions
Wael Badawy
Regular properties
Regular properties
Wael Badawy
Turing variations
Turing variations
Wael Badawy
Computer Vision panoramas
Computer Vision panoramas
Wael Badawy
Turing Machine
Turing Machine
Wael Badawy
Universal turing
Universal turing
Wael Badawy
Boosting Vertex-Cut Partitioning for Streaming Graphs
Boosting Vertex-Cut Partitioning for Streaming Graphs
Hooman Peiro Sajjad
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
Waqas Tariq
Computer Vision RANSAC
Computer Vision RANSAC
Wael Badawy
CEM Workshop Lectures (6/11): FVTD Method in CEM
CEM Workshop Lectures (6/11): FVTD Method in CEM
Abhishek Jain
HTML introduction
HTML introduction
Wael Badawy
Parsers -
Parsers -
Wael Badawy
Computer Vision Cameras
Computer Vision Cameras
Wael Badawy
Computer Vision Gans
Computer Vision Gans
Wael Badawy
Computer Vision image classification
Computer Vision image classification
Wael Badawy
Computer Vision Structure from motion
Computer Vision Structure from motion
Wael Badawy
Regular pumping examples
Regular pumping examples
Wael Badawy
Pushdown Automota
Pushdown Automota
Wael Badawy
Pda accept context free
Pda accept context free
Wael Badawy
Computer Vision sfm
Computer Vision sfm
Wael Badawy
Computer vision - photometric
Computer vision - photometric
Wael Badawy
Computer vision - light
Computer vision - light
Wael Badawy
Computer vision - two view geometry
Computer vision - two view geometry
Wael Badawy
Computer Vision - Stereo Vision
Computer Vision - Stereo Vision
Wael Badawy
Computer Vision - Single View
Computer Vision - Single View
Wael Badawy
Computer Vision single view Modelling
Computer Vision single view Modelling
Wael Badawy
More Related Content
Similar to Np complete reductions
Turing Machine
Turing Machine
Wael Badawy
Universal turing
Universal turing
Wael Badawy
Boosting Vertex-Cut Partitioning for Streaming Graphs
Boosting Vertex-Cut Partitioning for Streaming Graphs
Hooman Peiro Sajjad
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
Waqas Tariq
Computer Vision RANSAC
Computer Vision RANSAC
Wael Badawy
CEM Workshop Lectures (6/11): FVTD Method in CEM
CEM Workshop Lectures (6/11): FVTD Method in CEM
Abhishek Jain
Similar to Np complete reductions
(6)
Turing Machine
Turing Machine
Universal turing
Universal turing
Boosting Vertex-Cut Partitioning for Streaming Graphs
Boosting Vertex-Cut Partitioning for Streaming Graphs
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
A Fast Near Optimal Vertex Cover Algorithm (NOVCA)
Computer Vision RANSAC
Computer Vision RANSAC
CEM Workshop Lectures (6/11): FVTD Method in CEM
CEM Workshop Lectures (6/11): FVTD Method in CEM
More from Wael Badawy
HTML introduction
HTML introduction
Wael Badawy
Parsers -
Parsers -
Wael Badawy
Computer Vision Cameras
Computer Vision Cameras
Wael Badawy
Computer Vision Gans
Computer Vision Gans
Wael Badawy
Computer Vision image classification
Computer Vision image classification
Wael Badawy
Computer Vision Structure from motion
Computer Vision Structure from motion
Wael Badawy
Regular pumping examples
Regular pumping examples
Wael Badawy
Pushdown Automota
Pushdown Automota
Wael Badawy
Pda accept context free
Pda accept context free
Wael Badawy
Computer Vision sfm
Computer Vision sfm
Wael Badawy
Computer vision - photometric
Computer vision - photometric
Wael Badawy
Computer vision - light
Computer vision - light
Wael Badawy
Computer vision - two view geometry
Computer vision - two view geometry
Wael Badawy
Computer Vision - Stereo Vision
Computer Vision - Stereo Vision
Wael Badawy
Computer Vision - Single View
Computer Vision - Single View
Wael Badawy
Computer Vision single view Modelling
Computer Vision single view Modelling
Wael Badawy
Computer Vision panoramas
Computer Vision panoramas
Wael Badawy
Computer Vision - cameras
Computer Vision - cameras
Wael Badawy
Computer Vision - RANSAC
Computer Vision - RANSAC
Wael Badawy
Computer Vision alignment
Computer Vision alignment
Wael Badawy
More from Wael Badawy
(20)
HTML introduction
HTML introduction
Parsers -
Parsers -
Computer Vision Cameras
Computer Vision Cameras
Computer Vision Gans
Computer Vision Gans
Computer Vision image classification
Computer Vision image classification
Computer Vision Structure from motion
Computer Vision Structure from motion
Regular pumping examples
Regular pumping examples
Pushdown Automota
Pushdown Automota
Pda accept context free
Pda accept context free
Computer Vision sfm
Computer Vision sfm
Computer vision - photometric
Computer vision - photometric
Computer vision - light
Computer vision - light
Computer vision - two view geometry
Computer vision - two view geometry
Computer Vision - Stereo Vision
Computer Vision - Stereo Vision
Computer Vision - Single View
Computer Vision - Single View
Computer Vision single view Modelling
Computer Vision single view Modelling
Computer Vision panoramas
Computer Vision panoramas
Computer Vision - cameras
Computer Vision - cameras
Computer Vision - RANSAC
Computer Vision - RANSAC
Computer Vision alignment
Computer Vision alignment
Recently uploaded
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
SafetyChain Software
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
JemimahLaneBuaron
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
misteraugie
9548086042 for call girls in Indira Nagar with room service
9548086042 for call girls in Indira Nagar with room service
discovermytutordmt
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
Dr. Mazin Mohamed alkathiri
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
RaunakKeshri1
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
chloefrazer622
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Celine George
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
National Information Standards Organization (NISO)
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
Shobhayan Kirtania
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
Association for Project Management
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
chloefrazer622
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
anjaliyadav012327
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
GaneshChakor2
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
Thiyagu K
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
VS Mahajan Coaching Centre
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
Recently uploaded
(20)
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
9548086042 for call girls in Indira Nagar with room service
9548086042 for call girls in Indira Nagar with room service
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Np complete reductions
1.
© 2020 Wael
Badawy 1 More NP-complete Problems 1 DISCLAIMER: This video is optimized for HD large display using patented and patent-pending “Nile Codec”, the first Egyptian Video Codec for more information, PLEASE check https://NileCodec.com Also available as a PodCast
2.
© 2020 Wael
Badawy Copyright © 2020 Wael Badawy. All rights reserved This video is subject to copyright owned by Wael Badawy “WB”. Any reproduction or republication of all or part of this video is expressly prohibited unless WB has explicitly granted its prior written consent. All other rights reserved. This video is intended for education and information only and is offered AS IS, without any warranty of the accuracy or the quality of the content. Any other use is strictly prohibited. The viewer is fully responsible to verify the accuracy of the contents received without any claims of costs or liability arising . The names, trademarks service marked as logos of WB or the sponsors appearing in this video may not be used in any any product or service, without prior express written permission from WB and the video sponsors Neither WB nor any party involved in creating, producing or delivering information and material via this video shall be liable for any direction, incidental, consequential, indirect of punitive damages arising out of access to, use or inability to use this content or any errors or omissions in the content thereof. If you will continue to watch this video, you agree to the terms above and other terms that may be available on http://nu.edu.eg & https://caiwave.net 2
3.
© 2020 Wael
Badawy
4.
© 2020 Wael
Badawy 4 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible to A A B B Then: is NP-completeB (proven in previous class)
5.
© 2020 Wael
Badawy 5 Using the previous theorem, we will prove that 2 problems are NP-complete: Vertex-Cover Hamiltonian-Path
6.
© 2020 Wael
Badawy Vertex Cover S 6 Vertex cover of a graph is a subset of nodes such that every edge in the graph touches one node in S S = red nodes Example:
7.
© 2020 Wael
Badawy 7 |S|=4Example: Size of vertex-cover is the number of nodes in the cover
8.
© 2020 Wael
Badawy 8 graph contains a vertex cover of size } VERTEX-COVER = { :kG, G k Corresponding language: Example: G COVER-VERTEX4, G
9.
© 2020 Wael
Badawy 9 Theorem: 1. VERTEX-COVER is in NP 2. We will reduce in polynomial time 3CNF-SAT to VERTEX-COVER Can be easily proven VERTEX-COVER is NP-complete Proof: (NP-complete)
10.
© 2020 Wael
Badawy 10 Let be a 3CNF formula with variables and clauses m l Example: )()()( 431421321 xxxxxxxxx 4m 3l Clause 1 Clause 2 Clause 3
11.
© 2020 Wael
Badawy 11 Formula can be converted to a graph such that: G is satisfied if and only if G Contains a vertex cover of size lmk 2
12.
© 2020 Wael
Badawy 12 )()()( 431421321 xxxxxxxxx 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x Clause 1 Clause 2 Clause 3 Clause 1 Clause 2 Clause 3 Variable Gadgets Clause Gadgets m2 nodes l3 nodes
13.
© 2020 Wael
Badawy 13 )()()( 431421321 xxxxxxxxx 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x Clause 1 Clause 2 Clause 3 Clause 1 Clause 2 Clause 3
14.
© 2020 Wael
Badawy 14 If is satisfied, then contains a vertex cover of size G lmk 2 First direction in proof:
15.
© 2020 Wael
Badawy 15 )()()( 431421321 xxxxxxxxx Satisfying assignment 1001 4321 xxxx Example: We will show that contains a vertex cover of size 103242 lmk G
16.
© 2020 Wael
Badawy 16 )()()( 431421321 xxxxxxxxx 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x 1001 4321 xxxx Put every satisfying literal in the cover
17.
© 2020 Wael
Badawy 17 )()()( 431421321 xxxxxxxxx 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x 1001 4321 xxxx Select one satisfying literal in each clause gadget and include the remaining literals in the cover
18.
© 2020 Wael
Badawy 18 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x This is a vertex cover since every edge is adjacent to a chosen node
19.
© 2020 Wael
Badawy 19 Explanation for general case: 1x 1x 2x 2x 3x 3x 4x 4x Edges in variable gadgets are incident to at least one node in cover
20.
© 2020 Wael
Badawy 20 1x 2x 3x 1x 2x 4x 1x 3x 4x Edges in clause gadgets are incident to at least one node in cover, since two nodes are chosen in a clause gadget
21.
© 2020 Wael
Badawy 21 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x Every edge connecting variable gadgets and clause gadgets is one of three types: Type 1 Type 2 Type 3 All adjacent to nodes in cover
22.
© 2020 Wael
Badawy 22 If graph contains a vertex-cover of size then formula is satisfiable G lmk 2 Second direction of proof:
23.
© 2020 Wael
Badawy 23 Example: 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x
24.
© 2020 Wael
Badawy 24 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x exactly one literal in each variable gadget is chosen exactly two nodes in each clause gadget is chosen To include “internal’’ edges to gadgets, and satisfy lmk 2 m chosen out of m2 l2 l3chosen out of
25.
© 2020 Wael
Badawy 25 For the variable assignment choose the literals in the cover from variable gadgets 1x 1x 2x 2x 3x 3x 4x 4x 1001 4321 xxxx )()()( 431421321 xxxxxxxxx
26.
© 2020 Wael
Badawy 26 1x 1x 2x 2x 3x 3x 4x 4x 1x 2x 3x 1x 2x 4x 1x 3x 4x 1001 4321 xxxx )()()( 431421321 xxxxxxxxx since the respective literals satisfy the clauses is satisfied with
27.
© 2020 Wael
Badawy 27 1x 1x 1x 2x 3x It is impossible to have this scenario because one edge wouldn’t be covered 3x 3x2x 2x
28.
© 2020 Wael
Badawy 28 End of proof The proof can be generalized for arbitrary we have reduced in polynomial time 3CNF-SAT to VERTEX-COVER Therefore: The graph is constructed in polynomial time with respect to the size of G
29.
© 2020 Wael
Badawy 29 Theorem: 1. HAMILTONIAN-PATH is in NP 2. We will reduce in polynomial time 3CNF-SAT to HAMILTONIAN-PATH Can be easily proven HAMILTONIAN-PATH is NP-complete Proof: (NP-complete)
30.
© 2020 Wael
Badawy 30 )()( 2121 xxxx Consider an arbitrary CNF formula Whatever we will do applies to 3CNF formulas as well
31.
© 2020 Wael
Badawy 31 Gadget for variable 1x 33 lNumber of nodes in row: for clausesl )()( 2121 xxxx
32.
© 2020 Wael
Badawy 32 )()( 2121 xxxx )( 21 xx )( 21 xx Gadget for variable 1x clause node clause node A pair of nodes in gadget for each clause node; Pairs separated by a node pair 1 pair 2
33.
© 2020 Wael
Badawy 33 )()( 2121 xxxx Gadget for variable )( 21 xx clause node If variable appears as is in clause: first edge from gadget outgoing (left to right) second edge from gadget incoming pair 1 1x
34.
© 2020 Wael
Badawy 34 )()( 2121 xxxx )( 21 xx Gadget for variable 1x the directions change clause node pair 2 If variable appears inverted in clause: first edge from gadget incoming (left to right) second edge from gadget outgoing
35.
© 2020 Wael
Badawy 35 )()( 2121 xxxx )( 21 xx )( 21 xx Gadget for variable 1x clause node clause node pair 1 pair 2
36.
© 2020 Wael
Badawy 36 )()( 2121 xxxx )( 21 xx )( 21 xx Gadget for variable clause node clause node pair 1 pair 2 2x
37.
© 2020 Wael
Badawy 37 )( 21 xx )( 21 xx 1x 2x )()( 2121 xxxx Complete Graph
38.
© 2020 Wael
Badawy 38 1)()( 2121 xxxx Satisfying assignment: 11 x 12 x Satisfying assignment: 01 x 12 x
39.
© 2020 Wael
Badawy 39 )( 21 xx )( 21 xx 11 x 1)()( 2121 xxxx Hamiltonian path If variable is set to 1 traverse its gadget from left to right Visit clauses satisfied from the variable assignment Gadget for 1x
40.
© 2020 Wael
Badawy 40 )( 21 xx )( 21 xx 01 x 1)()( 2121 xxxx Hamiltonian path If variable is set to 0 traverse its gadget from right to left Visit clauses satisfied from the variable assignment Gadget for 1x
41.
© 2020 Wael
Badawy 41 )( 21 xx )( 21 xx 11 x 12 x 1)()( 2121 xxxx A satisfying assignment Hamiltonian path
42.
© 2020 Wael
Badawy 42 )( 21 xx )( 21 xx 01 x 12 x 1)()( 2121 xxxx Another satisfying assignment Hamiltonian path
43.
© 2020 Wael
Badawy 43 For each clause pick one variable that satisfies it and visit respective node once from that variable gadget )( 21 xx )( 21 xx 11 x 12 x 1)()( 2121 xxxx
44.
© 2020 Wael
Badawy 44 if the graph has a Hamiltonian path, then the formula has a satisfying assignment Each clause node is visited exactly once from some variable gadget, and that variable satisfies the clause Symmetrically, it can also be shown: Basic idea:
45.
© 2020 Wael
Badawy 45 )( 21 xx )( 21 xx It is impossible a clause node to be traversed from different variable gadgets Node not visited Node repeated
46.
© 2020 Wael
Badawy 46 Therefore: The formula is satisfied if and only if the respective graph has a Hamiltonian path
47.
© 2020 Wael
Badawy 47 End of proof The proof can apply to any 3CNF formula we have reduced in polynomial time 3CNF-SAT to HAMILTONIAN-PATH Therefore: The graph is constructed in polynomial time with respect to the size of the formula
Editor's Notes
1
Download now