CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.

Slides:



Advertisements
Similar presentations
Max Cut Problem Daniel Natapov.
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
NP-Completeness: Reductions
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Graph Colouring Lecture 20: Nov 25.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Clique Cover Cook’s Theorem 3SAT and Independent Set
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
CS 2813 Discrete Structures
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 22.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 31.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 27.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Lecture 22 More NPC problems
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Chapter 10 Extending the Limits of Tractability Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
Final Code Generation and Code Optimization.
Hamiltonian Path Problem This girl do this presentation. :) Teddy bear work along with me. Jeff help me understand the topic. Are they both cute?
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
28.
NPC.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 32.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Intro to Theory of Computation
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Chapter 8 NP and Computational Intractability
Final Code Generation and Code Optimization
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
Prove this problem is in NP
More NP-complete problems
Lecture 23 NP-Hard Problems
Presentation transcript:

CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33

Graph Coloring Given a map, can it be colored using 3 colors so that no adjacent regions have the same color? YES instance

Graph Coloring Given a map, can it be colored using 3 colors so that no adjacent regions have the same color? NO instance

Graph Coloring We seek to assign a color to each node of a graph G so that if (u, v) is an edge, then u and v are assigned different colors; and the goal is to do this while using a small set of colors A k-coloring of G is a function f:V  {1, 2, …, k} so that for every edge (u, v), we have f(u)  f(v). If G has a k-coloring, we say that it is a k- colorable graph –When is a graph 2-colorable? Given a graph G and a bound k, does G have a k-coloring?

Applications: Scheduling Example: schedule final exams and, being very considerate, avoid having a student do more than one exam a day What is the least number of days you need to schedule all the exams? (DONE IN CLASS) c1c2c3c4c5c6c7 c1 ***** c2 *** c3 *** c4 **** c5 ** c6 **** c7 *** courses 7 and 2 have at least one student in common

Applications: Register Allocation Assign program variables to machine registers so that no more than k registers are used and no two program variables that are needed at the same time are assigned to the same register –Interference graph: Nodes are program variables names, edge between u and v if there exists an operation where both u and v are "live" at the same time –Observation: [Chaitin 1982] Can solve register allocation problem iff interference graph is k-colorable

3-Colorability 3-COLOR: Given an undirected graph G does there exists a way to color the nodes red, green, and blue so that no adjacent nodes have the same color? yes instance

3-Colorability Claim: 3-SAT  P 3-COLOR Pf: Given 3-SAT instance , we construct an instance of 3-COLOR that is 3-colorable iff  is satisfiable Construction –For each literal, create a node –Create 3 new nodes T, F, B; connect them in a triangle, and connect each literal to B –Connect each literal to its negation –For each clause, add gadget of 6 nodes and 13 edges T B F true false base

3-Colorability B 6-node gadget T F true false base