Max Cut Problem Daniel Natapov.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

P, NP, NP-Complete Problems
Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
An NP-completeness Example. The graph CLIQUE problem Undirected Graph G = (V, E) –a clique is a complete subgraph of G Subset V’ of vertices that are.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity ©D.Moshkovits 1 Hardness of Approximation.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
CS21 Decidability and Tractability
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.
Clique Cover Cook’s Theorem 3SAT and Independent Set
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Lecture 22 More NPC problems
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
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.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
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.
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 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
CSC 413/513: Intro to Algorithms
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Instructor: Shengyu Zhang 1. Optimization Very often we need to solve an optimization problem.  Maximize the utility/payoff/gain/…  Minimize the cost/penalty/loss/…
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
P & NP.
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
Intro to Theory of Computation
ICS 353: Design and Analysis of Algorithms
Intro to NP Completeness
NP-Completeness Proofs
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
Hardness Of Approximation
NP-Complete Problems.
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Topics in Algorithms 2005 Max Cuts
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

Max Cut Problem Daniel Natapov

Problem Definition Given an undirected graph G(V,E), find a cut between the vertices, such that the number of edges crossing the cut is maximal.

Max Cut is NP-Hard! We show that it is NP-Hard by a reduction from the NAE-3-SAT Problem. The Not All Equal-3-SAT Problem is very similar to the 3-SAT problem, and can easily be shown to be NP-Hard by a reduction from Circuit SAT.

NAE-3-SAT Problem Not All Equal-3-SAT: A circuit consisting of a big AND of clauses Each clause is the OR of at most 3 literals Each literal is a variable or its negation. Each clause has at least one true literal and at least one false literal. does it have a satisfying assignment X? F T xoryorz AND xorwora AND …

The Reduction – Step 0 Max Cut NP Change problem to: “Is there a cut of size ≥ K?” We can easily check in poly-time, that the size of a given cut is ≥ K.

The Reduction – Step 1 What to reduce it to? Reduce to NAE-3-SAT NAE-3-SAT ≤ Max Cut

The Reduction – Step 2 What is what? Pnew = Max Cut Pis NP-comp = NAE-3-SAT Inew Snew Iis NP-comp Sis NP-comp F T xoryorz AND xoryory AND …

The Reduction – Step 3 Direction of Reduction and Code Want to show that Max Cut is hard NAE-3-SAT ≤ Max Cut Then, since we know NAE-3-SAT is hard, Max Cut must be hard too. Algalg=NAE-3-SAT Algoracle=Max Cut

The Reduction – Step 4 Look for Similarities NAE-3-SAT Max Cut Literals x X ¬X Y ¬Y Z z y Clauses ¬y (X v ¬Y v Z) ¬x Boolean Assignment F T

The Reduction – Step 5 Instance Maps For every clause Ci( A v B v C), i= 1..m, produce a triangle (A, B, C) in the graph. If two literals in the clause are the same, the “triangle” has a double edge. Finally, for each literal xi, create an edge between xi and ¬xi for each time xi or ¬xi appear.

The Reduction – Step 5 Instance Maps For example: (X1 v X2 v X2) AND (X1 v ¬X3 v ¬X3) AND (¬X1 v ¬X2 v X3) For every clause Ci( A v B v C), i= 1..m, produce a triangle (A,B, C) in the graph. X1 ¬X1 X2 ¬X2 X3 ¬X3

The Reduction – Step 5 Instance Maps For example: (X1 v X2 v X2) AND (X1 v ¬X3 v ¬X3) AND (¬X1 v ¬X2 v X3) For each literal xi, create an edge between xi and ¬xi for each time xi or ¬xi appear. X1 ¬X1 X2 ¬X2 X3 ¬X3

The Reduction – Step 5 Instance Maps For example: (X1 v X2 v X2) AND (X1 v ¬X3 v ¬X3) AND (¬X1 v ¬X2 v X3) We ask Max Cut, if there exists a cut of size K, where K ≥ 5(number of clauses). If yes, then there exists a valid assignment for NAE-3-SAT. X1 ¬X1 X2 ¬X2 X3 ¬X3

The Reduction – Step 6 Solution Map For example: (X1 v X2 v X2) AND (X1 v ¬X3 v ¬X3) AND (¬X1 v ¬X2 v X3)‏ Max Cut (The oracle) returns a cut. To find the solution to NAE-3-SAT, we assign all vertices on one side of the cut to True, and the ones on the other side to False. X1 ¬X1 X2 ¬X2 Here: X1=True, X2=False, X3=True X3 ¬X3

The Reduction – Step 7 Valid to Valid Assume the oracle (Max Cut), finds a cut of size 5(number of clauses). We can safely assume that for this cut, all Xi are separated from ¬Xi by the cut. If they are on the same side of the cut, they contribute at most 2n edges. Splitting them up would yield n edges from Xi to ¬Xi, plus at least half what they were contributing before, so there is no decrease. X1 ¬X1 X2 ¬X2 X3 ¬X3

The Reduction – Step 7 Valid to Valid For our example, we had 3 clauses. Here is one cut whose size is=15. (5*m) The number of edges in the cut that connect Xi to ¬Xi is 3m (in our case 9). Basically one edge for every literal. X1 ¬X1 The other 2m edges (in our case 6), must come from the triangles. X2 ¬X2 Each triangle can contribute at most 2 edges to a cut. Therefore, all m triangles are split by the cut. X3 ¬X3

The Reduction – Step 7 Valid to Valid All m triangles are split by the cut. Since a triangle is actually a clause of three literals, and every “clause” is split by the cut, by assigning True to one side of the cut and False to the other side of the cut, we ensure that every clause has at least one True and one False literal. X1 ¬X1 X2 ¬X2 This satisfies NAE-3-SAT, so if the cut returned my Max Cut is valid, our solution is valid. X3 ¬X3

The Reduction – Step 7 Valid to Valid For our example: (X1 v X2 v X2) AND (X1 v ¬X3 v ¬X3) AND (¬X1 v ¬X2 v X3) ( T v F v T ) AND (T v F v F) AND ( F v T v F ) X1 ¬X2 X3 ¬X1 ¬X2 ¬X3 X1 ¬X1 X1: T X2: F X3: T X2 ¬X2 X3 ¬X3

The Reduction – Steps 8&9 Reverse Solution Map Conversely, it is also possible for a valid solution for Max Cut to be found using a NAE-3-SAT oracle, (but it is not covered in this presentation).

The Reduction – Step 10 Working Algorithm We now have a working algorithm for the NAE-3-SAT problem. We translate the inputted list of clauses into a graph, and ask our Oracle: “Given this graph, is there a cut of size 5m?” If the Oracle says yes, and returns a cut, we assign True to all literals on one side of the cut, and False to all literals on the other side of the cut. We have a valid assignment.

The Reduction – Step 11 Running Time? We can create an instance map (clauses -> graph) in polynomial time. We can also create a solution map (cut -> Boolean assignment) in polynomial time. If our Max Cut Oracle can answer the question in polynomial time, we can solve NAE-3-SAT in poly time! (Of course, so far no known polynomial time algorithm for Max Cut is known).

Max Cut – Running Time The best known algorithm for finding an optimal solution for the Max Cut problem runs in 2θ(n) time. Is there a better way?

Max Cut – Randomized Algorithm Here is a simple approximation Max Cut Algorithm instead: The cut divides the vertices into two sets. For each vertex…

Max Cut – Randomized Algorithm Flip a coin! To see in which of the two sets the vertex lies. Each edge crosses over the cut with probability ½. The expected number of edges to cross over the cut is |E|/2. Since the optimal solution can not have more than all the edges cross over the cut, the expected solution is within a factor of 2. And the Randomized Algorithm runs in θ(n) time!

Questions? Comments? Praise? That’s it! Questions? Comments? Praise?