Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Size: px
Start display at page:

Download "Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not."

Transcription

1 Decision Problems Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Definition: The class of problems that can be solved by polynomial-time algorithms is called P. Contrary to P, we also have the notion of NP problems, which describes the hardness of a problem. However, NP NotP. A problem is called a decision problems if it has a yes/no solution. Sometimes we also call it a language-recognition problem. Many problems can be cast as decision problems by imposing simple constraints. Let U be the set of all possible inputs to the decision problem, let L U be the set of inputs for which the answer to the problem is yes. L is called the language corresponding to the problem. Jiming Peng, AdvOL, CAS, McMaster 1

2 Polynomial Reduction Definition: Let L 1 and L 2 be two languages from the input spaces U 1 and U 2. We say L 1 is polynomial reducible to L 2 if there is a polynomial-time algorithm that converts each input u 1 U 1 to another input u 2 U 2 such that u 1 L 1 if and only if u 2 L 2. Remark: In the above definition, we assume the algorithm is polynomial in the size of u 1, which implies the size u 2 is also polynomial in the size of u 1. Theorem If L 1 is polynomial reducible to L 2 and there is a polynomial algorithm for L 2, then there is a polynomial algorithm for L 1. Theorem If L 1 is polynomially reducible to L 2, and L 2 to L 3, then L 1 is polynomially reducible to L 3. Jiming Peng, AdvOL, CAS, McMaster 2

3 NP Problems Definition: NP denotes the class of problems that a positive answer has a certificate so that the correctness of a positive answer can be derived in polynomial time. The algorithm to verify the correctness of the positive answer is called a nondeterministic algorithm. L 1 L 1 Examples: := {G G, a graph with a perfect matching} := {(G, M) a Graph and a perfect Matching in G}. L 1 is polynomially solvable, thus L 1 NP! L 2 L 2 := {G G, a Hamiltonian graph}, := (G, M) a Graph and a Hamilton cycle (M) in G}. L 2 P, therefore L 2 NP. Clearly, P NP. The relation between P and NP has become one of the open mysteries in computer science and math. It is one of seven open Million questions in the new century. Jiming Peng, AdvOL, CAS, McMaster 3

4 NP-Completeness Question: Does P equal to NP? Answer: Seems NP is much larger than P. However, we have not found a single problem in NP that is not in P!! We next introduce two classes of problems that have not been proven to be P yet. Definition: A problem X is called an NPhard problem if every problem in NP is polynomial reducible to X. Conclusion: If we can solve a NP-hard problem in polynomial time, then we can solve all the problems in NP in polynomial time! Definition: A problem X is called an NPcomplete problem if it is NP-hard and belongs to NP. Conclusion: NP-complete problems are the hardest problems in NP. If we can prove one NP-complete problem is P, then P=NP. Jiming Peng, AdvOL, CAS, McMaster 4

5 SAT: An NP-Complete Problem The following lemma by Cook (1971) is fundamental in the theory of NP-Completeness (NPC). Lemma: A problem X is an NPC problem if (1) X belongs NP and (2) Y is polynomially reducible to X for some NPC Y. In his seminar paper, Cook gave the first example of NPC problem. Satisfiability (SAT): Let S be a Boolean expression, such as S = (x+y+z) ( x+y+ z) here addition denotes or and multiplication means and. A Boolean expression is said to be satisfiable if there is an assignment of 0s and 1s such that the value of the expression is 1. The SAT problem is to determine whether a given expression is satisfiable. A detailed proof can be found in Cook s paper, which used the similarity between Turing machine and the Boolean expression. From now on we use the fact that SAT is NPC. Jiming Peng, AdvOL, CAS, McMaster 5

6 Other NPC Problems Definition: An instance of 3SAT is a Boolean expression in which each clause contains exactly three variables. 3SAT Problem: Given a Boolean expression in which each clause contains exactly three variables, determine whether it is satisfiable. Theorem: 3SAT is NPC. Proof: Obviously 3SAT belongs to NP because we can verify whether an assignment is satisfiable in polynomial time. We next construct a polynomial reduction that transforms a general SAT into 3SAT. Let E be an arbitrary instance of SAT. We try to replace each clause of E by several 3-clauses. We first consider a clause C = (x 1 + x x k ) with k 4. Let y 1,..., y k 3 be new variables. By using these new variables, we can define C =(x 1 +x 2 +y 1 ) (x 3 +ȳ 1 +y 2 ) (x 4 +ȳ 2 +y 3 ) (x k 1 +x k +ȳ k 3 ). Jiming Peng, AdvOL, CAS, McMaster 6

7 Proof of NPC 3SAT Statement: C is satisfiable if and only if C is satisfiable. To prove the statement, observe that if C is satisfiable, then at least one of the x i s must be 1. For instance, if x i = 1 for some i > 2, then we set y 1,, y i 2 to be 1 and the rest be 0, which satisfies C. If x 1 or x 2 is 1, then we can set all y j to zero. Conversely, if C is satisfiable, then at least x i must be 1. Otherwise, if all x i s are 0, then C = y 1.(ȳ 1 + y 2 ) (ȳ 2 + y 3 ) (ȳ k 3 ). This expression is clearly unsatisfiable. Other cases: If C = (x 1 + x 2 ), then C = (x 1 + x 2 + z) (x 1 + x 2 + z), where z is a new variable. If C = x 1, then C = (x 1 +y+z) (x 1 +ȳ+z) (x 1 +y+ z) (x 1 +ȳ+ z). This reduction can be done in polynomial time. Therefore, SAT can be reduced to 3SAT in polynomial time. Since SAT is NPC, so is 3SAT. Jiming Peng, AdvOL, CAS, McMaster 7

8 3-Coloring Problem Let G = (V, E) be an undirected graph. A valid coloring of G is an assignment of colors to the vertices such that no two adjacent vertices have the same color. Problem: Given a graph G = (V, E), determine whether G can be colored with three colors. Theorem: 3-coloring is NP-complete. Proof: Obviously 3-coloring is in NP. To prove it is NP-complete, we reduce 3SAT to 3-coloring. Let E = (x + y + z) be an clause of 3SAT. We want to construct a graph G such that E is satisfiable if and only if G can be 3- colored. First we construct the main triangle, denote by M and labelled with colors T,F,A. These colors are used only for proof. For each variable x, we then build another triangle M x whose vertices are A, x, x. Jiming Peng, AdvOL, CAS, McMaster 8

9 From 3-SAT to 3-coloring y x x z y A z T F Basic (or Main) Trangle Jiming Peng, AdvOL, CAS, McMaster 9

10 Impose Satisfiability We now try to impose the condition that at least one variable in the clause must be 1.We introduce 6 new vertices and connect them to the new graph. Let s call the three new vertices connected to T and x, y, z by O (Outer vertices), and the other three new vertices in a triangle as I (Inner vertices). x T I1 O1 I3 I2 O3 O2 y T z T Constructing the graph Jiming Peng, AdvOL, CAS, McMaster 10

11 Reduce 3-SAT to 3-coloring We claim that if this graph can be colored with no more than 3 colors, then at least one of x, y, z must be colored T. Since otherwise all the outer vertices must be colored with A, and then we can not color the inner triangle. Now we consider the converse case. Suppose that E is satisfiable and we want to color the graph by 3 colors. Because E is satisfiable, we can assume w.l.g. that x is 1. Then we can color the vertex connected to x in the outer vertices as F, and the rest outer vertices with A. Correspondingly we can color the inner triangle. This is a polynomial reduction from 3-SAT to 3-Coloring problem. Because 3-SAT is NP-complete, so is 3-Coloring. Jiming Peng, AdvOL, CAS, McMaster 11

12 A graph for x+y+z=1 x x y y A z z O1 T F O2 O3 x+y+z=1 if and only if this graph can be colored with three colors Jiming Peng, AdvOL, CAS, McMaster 12

13 NP-Complete Clique Problem Problem: A clique C is a subgraph of G such that all the vertices in it are connected to each other. The clique problem is to determine, for a given G and constant k, whether G has a clique of size k. Theorem: The clique problem is NP-complete. Proof: Obviously the clique problem belongs to NP. It suffices if we can reduce SAT to the clique problem. Let E = E 1 E m be an arbitrary Boolean expression. We construct a graph in the following way: 1 Cast each variable in one clause as a vertex in the graph; 2 Add edges to link the vertices from different clauses unless they are complements to each other; 3 Vertices from the same clause are not connected. Jiming Peng, AdvOL, CAS, McMaster 13

14 A Graph for Boolean Clause x x y y z y z z A graph for the expression (x+y+z).(x+y+z).(y+z) Jiming Peng, AdvOL, CAS, McMaster 14

15 NP-completeness of Clique Statement: G has a clique m if and only if E is satisfiable. Proof: The construction guarantees that the maximal clique size does not exceed m. Suppose E is satisfiable, then there is a true assignment such that each clause has at least one true variable. We claim all these true vertices in G are connected because the chosen vertices can not have a complement pair. This means the resulting subgraph is a clique. Conversely, assume that G contains a clique of size m. The clique must consists of m vertices from distinct column of clauses. We assign the corresponding variable a value of 1, and their complements 0, and the rest variables arbitrarily. Since all the vertices in the clique are connected, and we know a complementary pair is never connected. This assignment is consistent. Jiming Peng, AdvOL, CAS, McMaster 15

16 Vertex Covering Problem Definition: Let G = (V, E) be a graph. A vertex set S of G is called vertex cover if each edge in G is incident to at least one of the vertices in S. Problem: Given an undirected graph G = (V, E) and an integer k, decide whether G has a vertex cover containing k vertices. Definitely set covering problem belongs to the set of NP-problems. Recall that Clique is NP-complete. Only if we can reduce any clique problem into a set covering problem. The idea is to construct the complement Ḡ of G with the same vertex set. However, all the edges in G are broken, while all the disjoint vertices in G are connected in Ḡ. Now we can show that a clique of size k in G matches a vertex covering of size n k in Ḡ, versa via. Jiming Peng, AdvOL, CAS, McMaster 16

17 From Clique to Set Cover V2 V3 V1 V4 V5 V6 A graph with clique (v2,v5,v6) V2 V3 V1 V4 V5 V6 The complement has a vertex cover (v1,v3,v4) Jiming Peng, AdvOL, CAS, McMaster 17

18 NP-complete family SAT Clique 3-SAT Set Cover 3- Coloring Dominati ng Set Hamilton Cycle Partition Independ ent Set TSP NP-complete Family Jiming Peng, AdvOL, CAS, McMaster 18

19 Branch and Bound for NPCPs Consider the 3-coloring problem. Note that if a vertex v is colored, then there are two ways to color its neighbor. This fits into the structure of a binary tree. We can start with any two vertices and explore all the possibilities for the rest vertices. Let pick one child in the tree, and continue this process until the whole graph is colored or a No answer is reported. In the later case, we track back and try other children. Algorithm 3-coloring (G, Var U); Input: G=(V,E), an empty set U; Output: a coloring. Begin If U=V, then G is colored, stop. else pick v not in U; for C := 1 to 3 do if no neighbor of v is colored with C U := U + v, v is colored by C, 3-coloring (G,U) End Jiming Peng, AdvOL, CAS, McMaster 19

20 Backtrack for 3-Coloring We use the colors R(ed), G(reen) and B(lue). v5 v1 v2 v3 v4 1B 2G 3R 3B 4G 4B 4R 4G No No No 5R Yes Branch and Bound for 3-coloring Jiming Peng, AdvOL, CAS, McMaster 20

21 Branch and Bound for ILP The technique of branch and bound is frequently used in integer linear programming where we usually want to minimize or maximize a linear objective subject to some constraints. The heuristics in ILP is to fix some variables temporarily, and then solve the resulting ILP which is usually smaller and relatively easier than the original problem. We can also use the relaxed linear program to solve ILP. If the solution of the relaxed LP is integer, then it solves ILP. Example: min x 1 2x 2 x 1, x 2 {0,1}. We first set x 1 to 0, and then solve the subproblem min 2x 2 x 2 {0,1}, which has a solution at x 2 = 1 with value -2. Then we set x 1 to 1, and solve min1 2x 2 x 2 {0,1}. The minimal solution of the above problem has a value -1. Comparing these two values, we get the solution to the original problem as x 1 = 0, x 2 = 1. Jiming Peng, AdvOL, CAS, McMaster 21

22 ILP for Clique Problem Problem: Find a clique C in graph G = (V, E) with the maximal size. We try to model the problem as an integer linear programming problem. Let us define n variables corresponding to vertices as follows: x i = 1 if the vertex v i is in C, 0 otherwise. Therefore, we can formulate the maximal clique problem as the following max z = n i=1 x i ; x i {0,1}; x i + x j 1, (v i, v j ) E. Jiming Peng, AdvOL, CAS, McMaster 22

23 ILP for Clique V2 V3 V1 V4 V5 V6 A graph with clique (v2,v5,v6) For the above problem, the ILP model reads max z = 6 i=1 x i ; x i {0,1}; x 1 + x 3 1, x 1 + x 4 1; x 1 + x 5 1, x 1 + x 6 1; x 2 + x 3 1, x 2 + x 4 1; x 3 + x 5 1, x 4 + x 5 1. The final solution is x 1 = 0, x 2 = 1, x 3 = 0, x 4 = 0, x 5 = 1, x 6 = 1. Jiming Peng, AdvOL, CAS, McMaster 23

24 LP Relaxation for ILP Note that in our ILP example for clique problem, if we relax the constraints x i {0,1} to 0 x i 1, then we get a LP problem that could be solved efficiently. By solving the relaxed problem, we can get a solution to the original problem! However, this is not true for general ILPs. Nevertheless, the LP relaxation provides us a useful approach for solving ILP. For example, we can employ the backtracking technique, and use the values of the easily solvable relaxed LP problems to drop some children. For instance, we have already a feasible solution and thus a value z 1. After fixing some variables, we solve the relaxed LP. If the resulting optimal value is worse than z 1, then we can throw away the whole branch, and thus avoid unnecessary work. The worst case of this branch-bound algorithm is exponential. But by exploring the special structure of the underlying problem, special heuristics can be developed and many results have been reported. Jiming Peng, AdvOL, CAS, McMaster 24

25 Approximation Algorithms Definition: An algorithm that may not lead to the optimal result but yet give a good feasible solution is called an approximation algorithm. If NCPs are so hard to solve, why not try approximate algorithms? Definition: For a given problem, an approximate algorithm is called an ρ-approximate algorithm if it always give a solution satisfying C /C ρ or C/C ρ, depending on the underlying problem is minimizing or maximizing, where C is the exact solution of the underlying problem. Question: If we do not know the exact solution C of the problem, how to estimate the approximate ratio ρ? Jiming Peng, AdvOL, CAS, McMaster 25

26 Approximate Bin Packing Bin Packing: Let X be a set of elements x i [0,1], i = 1,, n. Partition these elements into subsets such that the summation of elements in each subset is less than or equal to 1. This is a variant of Knapsack problem. A direct is to fit each bin until there is no room in all the previous bins for the next item. This is called first fit algorithm, which requires at most 2OPT bins. The proof is trivial, because first fit can not leave two bins less than half full. A better idea is to do ordering first, and then using first fit again, and the solution can be improved to 1.22OPT. The proof can be found in the main textbook. Jiming Peng, AdvOL, CAS, McMaster 26

27 Approximate Vertex Cover Definition: Vertex Cover is a set of vertices that each edge in G = (V, E) is incident to it. Problem: Find the minimal vertex cover in a graph. The problem is NPC. So we try to find an approximate solution. We can use method for maximal matching to approach it. The set of all vertices in a maximal matching forms a vertex cover, which is at most 2OPT, where OPT is the number of vertices in the best vertex cover. But we need to know how to find a maximal matching in a graph first. Jiming Peng, AdvOL, CAS, McMaster 27

28 Euclidean TSP Problem: Let c i, i = 1,, n are n points on the plane. Find the Hamilton cycle with minimal distance. The problem is NP-hard, but since the graph is on the plane, it satisfies the triangle inequality. We can start with a minimal cost spanning tree, which can be obtained in polynomial time. Therefore, the cost of the tree is less than or equal to the cycle (Note that by removing one edge in the cycle we get a spanning tree). We can construct a circuit which traverse each vertex twice, by using depth first algorithm. The length of this circuit is at most twice as that of the minimal TSP tour. Now we can construct a cycle from this circuit. Instead of backtracking, we can move to the first new vertex. This gives a cycle whose length is less than 2OPT for TSP. Jiming Peng, AdvOL, CAS, McMaster 28

29 TSP tour VS Spanning Tree A spanning tree A TSP Tour expanded from the spanning tree Jiming Peng, AdvOL, CAS, McMaster 29

30 Further improvement We can use the idea of Eulerian circuit to construct a better TSP tour. This can be done by adding edges to link all nodes with an odd degree. Note that the number of odddegree nodes should be even! (Why?) Suppose in total there are 2k odd-degree nodes, we can use k edges to connect them. We want to use the edges whose total distance is minimal. This gives rise to a minimumdistance matching problem which can be solved in n 3 time. We can prove that the total distance of the minimum matching is less than half of the distance in the final TSP tour. This can be shown in the following way. We construct two disjoint paths that link all the odd-degree nodes together such that the total length of these two paths is less that that of the TSP tour. Jiming Peng, AdvOL, CAS, McMaster 30

31 Eulerian Circuit to TSP A spanning tree + Matching A TSP Tour derived from Eulerian Circuit Two different matchings that link all the odd-degree nodes together Jiming Peng, AdvOL, CAS, McMaster 31

32 Matching Problem in Graph Definition: Let G = (V, E) be a graph. 1 A matching is a set of edges such that no two of which have a vertex in common; 2 A perfect matching is a matching in which all the vertices are matched; 3 A matching is called Maximal Matching if it has the maximal cardinality. Sometimes, finding a perfect matching in a graph is impossible. However, if the graph is very dense, for example, V = 2n and the degree of each vertex in the graph is greater than n, then we can use induction and greedy algorithm to find a perfect matching in such a dense graph. The algorithm takes a procedure as follows. First take any edge in the graph, and remove the corresponding two vertices and the edges linked to these two. Then we have a smaller graph with V 1 = 2n 2. Since the original graph is very dense, so is the reduced graph. Jiming Peng, AdvOL, CAS, McMaster 32

33 Maximal matching Theorem: A matching is maximal if and only if it has no augmenting path. Finding a maximal matching Start with M = φ; Finding an augmenting path P relative to M and replace M by M + P Repeat the process until no augmenting path exists. Idea: From two matchings M, N, we can obtain an augmenting path for M or N. Consider the graph G = (V, M + N): Each vertex is an endpoint of at most one edge from M and one edge from N; Each connected component of G form a path with edges alternating between M and N; Each path that is not a cycle form an augmenting path for M or N. Jiming Peng, AdvOL, CAS, McMaster 33

34 Finding augmenting path Level 0: Count all unmatched vertices from V ; At Odd Level i: Add new vertices that are adjacent to a vertex at level i 1 by a non-matching edge (edge is also added); At Even Level i: Add new vertices that are adjacent to a vertex at level i 1 because of an edge in the matching M, together with that edge; Continue the process until an unmatched vertex is added at an odd level, or no more vertices can be added; Remove all the edges in the original matching. Jiming Peng, AdvOL, CAS, McMaster 34

35 Augmenting path: 1 V1 V2 V3 V5 V4 V6 Unmatched vertices V5, V8 V7 V8 v1 V2 v3 v5 V4 V6 Add V5 and (v5,v4) to the matching v7 V8 Jiming Peng, AdvOL, CAS, McMaster 35

36 Augmenting path: 2 V1 V2 V3 V5 V4 V6 Add v3 and (v4,v3) V7 V8 v1 V2 v3 v5 V4 V6 Add v6 and (v3,v6) to the matching v7 V8 Jiming Peng, AdvOL, CAS, McMaster 36

37 Augmenting path: 3 V1 V2 V3 V5 V4 V6 Add v7 and (v6,v7) V7 V8 v1 V2 v3 v5 V4 V6 Add v8 and (v7,v8) to the matching v7 V8 Jiming Peng, AdvOL, CAS, McMaster 37

38 Augmenting path: 4 V1 V2 V3 V5 V4 V6 Remove edges in the original matching V7 V8 v1 V2 v3 v5 V4 V6 The final maximal matching v7 V8 Jiming Peng, AdvOL, CAS, McMaster 38

39 Computing with DNA So far we are working on digital computers. How about DNA-based computers? In 1994, Len Adleman (computer scientist) showed an NP-complete problem can be solved using DNA! This is impossible in the classic way. Adleman s work is based on biochemical process work on huge numbers of molecules in parallel. The problem Adleman tackled is Hamilton path problem (HP) in directed graph G = (V, E) with designated start v 0 and end v n vertices. The problem is to decide whether there is a path from v 0 to v n with n = V such that it pass all the other vertices in G exactly once. This is an NP-hard problem. Let w 0, w 1,, w q be any path in G, we can check whether it is HP by determining if it satisfies the following properties 1: w 0 = v 0, w q = v n ; 2: q = n 3: Every vertex in V appear once in the path This can be done in polynomial time, but the problem is that too many possible paths... Jiming Peng, AdvOL, CAS, McMaster 39

40 Background knowledge on DNA Using the DNA model, we can perform the following process Generate DNA strands to represent paths in G; Use biochemical processes to extract strands satisfying 1-3, and discard all others a: Extract strands that start at v 0 and end at v n ; b: Extract strands that include n vertices; c: Extract strands that contain every vertex. Any strand that remains represents a HP. If no, then there is no HP in G. DNA is deoxyribonucleic acid, the genetic material that encodes the characteristics of living things. It consists of strings of chemicals called nucleotides denoted by: adenine (A), cytosine (C), guanine (G) and thymine (T). Thus we can encode any information using this four-letter alphabet, different from the binary 0-1 coding. Jiming Peng, AdvOL, CAS, McMaster 40

41 Background knowledge on DNA Two noble winners, J. Watson and F. Crick found the double helix structure of DNA: A and T are complements, C and G are complements. Two strands of nucleotides will attach to each other if they have complementary components in corresponding positions. But it is also possible that DNA strands might attach to each other without the complementary elements. We associate a string R i = d i,1 d i,2 d i,20 of 20 letters from alphabet A,C, G,T with each vertex v i in the graph G. The recipe for generating DNA strands uses two ingredients for edges and vertices. For each edge v i v j v 0 v n, make a strand S i,j of 20 letters, where the first half is the same as last part d i,11 d i,20 of R i, and the second half is as the first half d j,1 d j,10 of R j. For edges start from v 0 or end at v n we use all of R 0 and R n, added the corresponding half of another vertex. Thus for these edges, we get 30 letters. Jiming Peng, AdvOL, CAS, McMaster 41

42 DNA model A large number of the edge strands, about copies of each for the graph are synthesized and put into pot. For each of R i (except R 0 and R n ), create its complement R i and put a large amount of copies. For a path S 4,5, S 5,2, S 2,1, by the construction we know it contains the substring R 5 R 2, we can attach their complement R 5 R 2 to it. Now we can get all the paths in the graph. We can verify strands with correct start and end. A DNA molecule representing a path has a complete copy of R i for each vertex v i in the path. Thus we can extract DNA strands with length n 20 by biochemical process. For each v i (except v 0 and v n ), we mix in copies of R i, extract the strands to which they attach, and discard others. Then the R i molecules are separated from the strands and removed. Now the remaining strands represents paths that pass through v i. When this process is finished for all vertices, then the remaining path is the desired HP path. Jiming Peng, AdvOL, CAS, McMaster 42

43 Comments on DNA model Theoretically, all these steps can be done in linear time of the problem size. But it also depends on the volume of the involved material in the biochemical process. What is the increase speed of this volume regarding the size of the underlying problem? It is also possible that some errors happen in the biochemical process. Then we won t get the exact solution. Like the probabilistic methods, fast but no guarantee of correctness! Extensive research on this direction is going on... Jiming Peng, AdvOL, CAS, McMaster 43

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W. : Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity

More information

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices Hard Problems Euler-Tour Problem Undirected graph G=(V,E) An Euler Tour is a path where every edge appears exactly once. The Euler-Tour Problem: does graph G have an Euler Path? Answerable in O(E) time.

More information

Lecture 8: The Traveling Salesman Problem

Lecture 8: The Traveling Salesman Problem Lecture 8: The Traveling Salesman Problem Let G = (V, E) be an undirected graph. A Hamiltonian cycle of G is a cycle that visits every vertex v V exactly once. Instead of Hamiltonian cycle, we sometimes

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined

More information

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu P, NP-Problems Class

More information

NP-Completeness. Algorithms

NP-Completeness. Algorithms NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient

More information

1 The Traveling Salesperson Problem (TSP)

1 The Traveling Salesperson Problem (TSP) CS 598CSC: Approximation Algorithms Lecture date: January 23, 2009 Instructor: Chandra Chekuri Scribe: Sungjin Im In the previous lecture, we had a quick overview of several basic aspects of approximation

More information

val(y, I) α (9.0.2) α (9.0.3)

val(y, I) α (9.0.2) α (9.0.3) CS787: Advanced Algorithms Lecture 9: Approximation Algorithms In this lecture we will discuss some NP-complete optimization problems and give algorithms for solving them that produce a nearly optimal,

More information

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions. CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT

More information

Some Hardness Proofs

Some Hardness Proofs Some Hardness Proofs Magnus Lie Hetland January 2011 This is a very brief overview of some well-known hard (NP Hard and NP complete) problems, and the main ideas behind their hardness proofs. The document

More information

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 397 E-mail: natarajan.meghanathan@jsums.edu Optimization vs. Decision

More information

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms Module 6 P, NP, NP-Complete Problems and Approximation Algorithms Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu

More information

Graphs and Algorithms 2015

Graphs and Algorithms 2015 Graphs and Algorithms 2015 Teachers: Nikhil Bansal and Jorn van der Pol Webpage: www.win.tue.nl/~nikhil/courses/2wo08 (for up to date information, links to reading material) Goal: Have fun with discrete

More information

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 97 E-mail: natarajan.meghanathan@jsums.edu Optimization vs. Decision

More information

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 3 Definitions an undirected graph G = (V, E)

More information

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions Introduction Chapter 9 Graph Algorithms graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 2 Definitions an undirected graph G = (V, E) is

More information

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017 CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017 Reading: Section 9.2 of DPV. Section 11.3 of KT presents a different approximation algorithm for Vertex Cover. Coping

More information

COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section (CLRS)

COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section (CLRS) COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section 35.1-35.2(CLRS) 1 Coping with NP-Completeness Brute-force search: This is usually only a viable option for small

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can

More information

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch] NP Completeness Andreas Klappenecker [partially based on slides by Jennifer Welch] Overview We already know the following examples of NPC problems: SAT 3SAT We are going to show that the following are

More information

Prove, where is known to be NP-complete. The following problems are NP-Complete:

Prove, where is known to be NP-complete. The following problems are NP-Complete: CMPSCI 601: Recall From Last Time Lecture 21 To prove is NP-complete: Prove NP. Prove, where is known to be NP-complete. The following problems are NP-Complete: SAT (Cook-Levin Theorem) 3-SAT 3-COLOR CLIQUE

More information

CSE 417 Branch & Bound (pt 4) Branch & Bound

CSE 417 Branch & Bound (pt 4) Branch & Bound CSE 417 Branch & Bound (pt 4) Branch & Bound Reminders > HW8 due today > HW9 will be posted tomorrow start early program will be slow, so debugging will be slow... Review of previous lectures > Complexity

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Other NP-Complete Problems Haniel Barbosa Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Sections 7.4 and 7.5. The 3SAT

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

NP-complete Reductions

NP-complete Reductions NP-complete Reductions 1. Prove that 3SAT P DOUBLE-SAT, i.e., show DOUBLE-SAT is NP-complete by reduction from 3SAT. The 3-SAT problem consists of a conjunction of clauses over n Boolean variables, where

More information

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 4: Matching and other stuff

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 4: Matching and other stuff Institute of Operating Systems and Computer Networks Algorithms Group Network Algorithms Tutorial 4: Matching and other stuff Christian Rieck Matching 2 Matching A matching M in a graph is a set of pairwise

More information

P and NP (Millenium problem)

P and NP (Millenium problem) CMPS 2200 Fall 2017 P and NP (Millenium problem) Carola Wenk Slides courtesy of Piotr Indyk with additions by Carola Wenk CMPS 2200 Introduction to Algorithms 1 We have seen so far Algorithms for various

More information

GRAPH THEORY and APPLICATIONS. Matchings

GRAPH THEORY and APPLICATIONS. Matchings GRAPH THEORY and APPLICATIONS Matchings Definition Matching of a graph G: Any subset of edges M E such that no two elements of M are adjacent. Example: {e} {e,e5,e0} {e2,e7,e0} {e4,e6,e8} e4 e7 e8 e e2

More information

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 9.1 Linear Programming Suppose we are trying to approximate a minimization

More information

Partha Sarathi Mandal

Partha Sarathi Mandal MA 515: Introduction to Algorithms & MA353 : Design and Analysis of Algorithms [3-0-0-6] Lecture 39 http://www.iitg.ernet.in/psm/indexing_ma353/y09/index.html Partha Sarathi Mandal psm@iitg.ernet.in Dept.

More information

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS Subhas C. Nandy (nandysc@isical.ac.in) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 70010, India. Organization Introduction

More information

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}. Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 11/23/99 NP-completeness of 3SAT, Minimum Vertex Cover, Maximum Independent Set, Boolean Formulae A Boolean formula is an expression that we can build starting from Boolean

More information

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures Chapter 9 Graph s 2 Definitions Definitions an undirected graph is a finite set

More information

Basic Approximation algorithms

Basic Approximation algorithms Approximation slides Basic Approximation algorithms Guy Kortsarz Approximation slides 2 A ρ approximation algorithm for problems that we can not solve exactly Given an NP-hard question finding the optimum

More information

Solutions for the Exam 6 January 2014

Solutions for the Exam 6 January 2014 Mastermath and LNMB Course: Discrete Optimization Solutions for the Exam 6 January 2014 Utrecht University, Educatorium, 13:30 16:30 The examination lasts 3 hours. Grading will be done before January 20,

More information

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 21 Dr. Ted Ralphs IE411 Lecture 21 1 Combinatorial Optimization and Network Flows In general, most combinatorial optimization and integer programming problems are

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Frank de Zeeuw EPFL 2012 Today Introduction Graph problems - What combinatorial things will we be optimizing? Algorithms - What kind of solution are we looking for? Linear Programming

More information

Math 776 Graph Theory Lecture Note 1 Basic concepts

Math 776 Graph Theory Lecture Note 1 Basic concepts Math 776 Graph Theory Lecture Note 1 Basic concepts Lectured by Lincoln Lu Transcribed by Lincoln Lu Graph theory was founded by the great Swiss mathematician Leonhard Euler (1707-178) after he solved

More information

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition. 18.433 Combinatorial Optimization Matching Algorithms September 9,14,16 Lecturer: Santosh Vempala Given a graph G = (V, E), a matching M is a set of edges with the property that no two of the edges have

More information

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017 1 W[1]-hardness Dániel Marx Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017 2 Lower bounds So far we have seen positive results: basic algorithmic techniques for fixed-parameter

More information

CS 4407 Algorithms. Lecture 8: Circumventing Intractability, using Approximation and other Techniques

CS 4407 Algorithms. Lecture 8: Circumventing Intractability, using Approximation and other Techniques CS 4407 Algorithms Lecture 8: Circumventing Intractability, using Approximation and other Techniques Prof. Gregory Provan Department of Computer Science University College Cork CS 4010 1 Lecture Outline

More information

The complement of PATH is in NL

The complement of PATH is in NL 340 The complement of PATH is in NL Let c be the number of nodes in graph G that are reachable from s We assume that c is provided as an input to M Given G, s, t, and c the machine M operates as follows:

More information

Graphs and Algorithms 2016

Graphs and Algorithms 2016 Graphs and Algorithms 2016 Teachers: Nikhil Bansal and Jesper Nederlof TA: Shashwat Garg (Office Hours: Thursday: Pick??) Webpage: www.win.tue.nl/~nikhil/courses/2wo08 (for up to date information, links

More information

Vertex Cover Approximations

Vertex Cover Approximations CS124 Lecture 20 Heuristics can be useful in practice, but sometimes we would like to have guarantees. Approximation algorithms give guarantees. It is worth keeping in mind that sometimes approximation

More information

Introduction to Approximation Algorithms

Introduction to Approximation Algorithms Introduction to Approximation Algorithms Dr. Gautam K. Das Departmet of Mathematics Indian Institute of Technology Guwahati, India gkd@iitg.ernet.in February 19, 2016 Outline of the lecture Background

More information

Steiner Trees and Forests

Steiner Trees and Forests Massachusetts Institute of Technology Lecturer: Adriana Lopez 18.434: Seminar in Theoretical Computer Science March 7, 2006 Steiner Trees and Forests 1 Steiner Tree Problem Given an undirected graph G

More information

Coping with NP-Completeness

Coping with NP-Completeness Coping with NP-Completeness Siddhartha Sen Questions: sssix@cs.princeton.edu Some figures obtained from Introduction to Algorithms, nd ed., by CLRS Coping with intractability Many NPC problems are important

More information

The Structure of Bull-Free Perfect Graphs

The Structure of Bull-Free Perfect Graphs The Structure of Bull-Free Perfect Graphs Maria Chudnovsky and Irena Penev Columbia University, New York, NY 10027 USA May 18, 2012 Abstract The bull is a graph consisting of a triangle and two vertex-disjoint

More information

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19: CS270 Combinatorial Algorithms & Data Structures Spring 2003 Lecture 19: 4.1.03 Lecturer: Satish Rao Scribes: Kevin Lacker and Bill Kramer Disclaimer: These notes have not been subjected to the usual scrutiny

More information

9.1 Cook-Levin Theorem

9.1 Cook-Levin Theorem CS787: Advanced Algorithms Scribe: Shijin Kong and David Malec Lecturer: Shuchi Chawla Topic: NP-Completeness, Approximation Algorithms Date: 10/1/2007 As we ve already seen in the preceding lecture, two

More information

NP-Complete Problems

NP-Complete Problems 1 / 34 NP-Complete Problems CS 584: Algorithm Design and Analysis Daniel Leblanc 1 1 Senior Adjunct Instructor Portland State University Maseeh College of Engineering and Computer Science Winter 2018 2

More information

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0). CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 29 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/7/2016 Approximation

More information

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet 6.006- Introduction to Algorithms Lecture 24 Prof. Patrick Jaillet Outline Decision vs optimization problems P, NP, co-np Reductions between problems NP-complete problems Beyond NP-completeness Readings

More information

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario Coping with the Limitations of Algorithm Power Tackling Difficult Combinatorial Problems There are two principal approaches to tackling difficult combinatorial problems (NP-hard problems): Use a strategy

More information

Chapter 10 Part 1: Reduction

Chapter 10 Part 1: Reduction //06 Polynomial-Time Reduction Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Chapter 0 Part : Reduction Reduction. Problem X

More information

1 Variations of the Traveling Salesman Problem

1 Variations of the Traveling Salesman Problem Stanford University CS26: Optimization Handout 3 Luca Trevisan January, 20 Lecture 3 In which we prove the equivalence of three versions of the Traveling Salesman Problem, we provide a 2-approximate algorithm,

More information

Approximation Algorithms

Approximation Algorithms Chapter 8 Approximation Algorithms Algorithm Theory WS 2016/17 Fabian Kuhn Approximation Algorithms Optimization appears everywhere in computer science We have seen many examples, e.g.: scheduling jobs

More information

Greedy algorithms Or Do the right thing

Greedy algorithms Or Do the right thing Greedy algorithms Or Do the right thing March 1, 2005 1 Greedy Algorithm Basic idea: When solving a problem do locally the right thing. Problem: Usually does not work. VertexCover (Optimization Version)

More information

Slides on Approximation algorithms, part 2: Basic approximation algorithms

Slides on Approximation algorithms, part 2: Basic approximation algorithms Approximation slides Slides on Approximation algorithms, part : Basic approximation algorithms Guy Kortsarz Approximation slides Finding a lower bound; the TSP example The optimum TSP cycle P is an edge

More information

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures 3 Definitions an undirected graph G = (V, E) is a

More information

Foundations of Computing

Foundations of Computing Foundations of Computing Darmstadt University of Technology Dept. Computer Science Winter Term 2005 / 2006 Copyright c 2004 by Matthias Müller-Hannemann and Karsten Weihe All rights reserved http://www.algo.informatik.tu-darmstadt.de/

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

Lecture 1. 2 Motivation: Fast. Reliable. Cheap. Choose two.

Lecture 1. 2 Motivation: Fast. Reliable. Cheap. Choose two. Approximation Algorithms and Hardness of Approximation February 19, 2013 Lecture 1 Lecturer: Ola Svensson Scribes: Alantha Newman 1 Class Information 4 credits Lecturers: Ola Svensson (ola.svensson@epfl.ch)

More information

Introduction III. Graphs. Motivations I. Introduction IV

Introduction III. Graphs. Motivations I. Introduction IV Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg

More information

1 Matchings in Graphs

1 Matchings in Graphs Matchings in Graphs J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 Definition Two edges are called independent if they are not adjacent

More information

Math 170- Graph Theory Notes

Math 170- Graph Theory Notes 1 Math 170- Graph Theory Notes Michael Levet December 3, 2018 Notation: Let n be a positive integer. Denote [n] to be the set {1, 2,..., n}. So for example, [3] = {1, 2, 3}. To quote Bud Brown, Graph theory

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation-6: Hardness of Inference Contents 1 NP-Hardness Part-II

More information

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

Chapter 8. NP-complete problems

Chapter 8. NP-complete problems Chapter 8. NP-complete problems Search problems E cient algorithms We have developed algorithms for I I I I I finding shortest paths in graphs, minimum spanning trees in graphs, matchings in bipartite

More information

Lecture 7. s.t. e = (u,v) E x u + x v 1 (2) v V x v 0 (3)

Lecture 7. s.t. e = (u,v) E x u + x v 1 (2) v V x v 0 (3) COMPSCI 632: Approximation Algorithms September 18, 2017 Lecturer: Debmalya Panigrahi Lecture 7 Scribe: Xiang Wang 1 Overview In this lecture, we will use Primal-Dual method to design approximation algorithms

More information

Conflict Graphs for Combinatorial Optimization Problems

Conflict Graphs for Combinatorial Optimization Problems Conflict Graphs for Combinatorial Optimization Problems Ulrich Pferschy joint work with Andreas Darmann and Joachim Schauer University of Graz, Austria Introduction Combinatorial Optimization Problem CO

More information

Assignment 5: Solutions

Assignment 5: Solutions Algorithm Design Techniques Assignment 5: Solutions () Port Authority. [This problem is more commonly called the Bin Packing Problem.] (a) Suppose K = 3 and (w, w, w 3, w 4 ) = (,,, ). The optimal solution

More information

8 Matroid Intersection

8 Matroid Intersection 8 Matroid Intersection 8.1 Definition and examples 8.2 Matroid Intersection Algorithm 8.1 Definitions Given two matroids M 1 = (X, I 1 ) and M 2 = (X, I 2 ) on the same set X, their intersection is M 1

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A 4 credit unit course Part of Theoretical Computer Science courses at the Laboratory of Mathematics There will be 4 hours

More information

Approximation Algorithms

Approximation Algorithms 15-251: Great Ideas in Theoretical Computer Science Spring 2019, Lecture 14 March 5, 2019 Approximation Algorithms 1 2 SAT 3SAT Clique Hamiltonian- Cycle given a Boolean formula F, is it satisfiable? same,

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite

More information

Graph Algorithms. Tours in Graphs. Graph Algorithms

Graph Algorithms. Tours in Graphs. Graph Algorithms Graph Algorithms Tours in Graphs Graph Algorithms Special Paths and Cycles in Graphs Euler Path: A path that traverses all the edges of the graph exactly once. Euler Cycle: A cycle that traverses all the

More information

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem CS61: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem Tim Roughgarden February 5, 016 1 The Traveling Salesman Problem (TSP) In this lecture we study a famous computational problem,

More information

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2 Graph Theory S I I S S I I S Graphs Definition A graph G is a pair consisting of a vertex set V (G), and an edge set E(G) ( ) V (G). x and y are the endpoints of edge e = {x, y}. They are called adjacent

More information

CMPSCI611: The SUBSET-SUM Problem Lecture 18

CMPSCI611: The SUBSET-SUM Problem Lecture 18 CMPSCI611: The SUBSET-SUM Problem Lecture 18 We begin today with the problem we didn t get to at the end of last lecture the SUBSET-SUM problem, which we also saw back in Lecture 8. The input to SUBSET-

More information

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements. Desiderata Reductions Desiderata. Classify problems according to their computational requirements. Frustrating news. Huge number of fundamental problems have defied classification for decades. Desiderata'.

More information

6.2. Paths and Cycles

6.2. Paths and Cycles 6.2. PATHS AND CYCLES 85 6.2. Paths and Cycles 6.2.1. Paths. A path from v 0 to v n of length n is a sequence of n+1 vertices (v k ) and n edges (e k ) of the form v 0, e 1, v 1, e 2, v 2,..., e n, v n,

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

Exact Algorithms for NP-hard problems

Exact Algorithms for NP-hard problems 24 mai 2012 1 Why do we need exponential algorithms? 2 3 Why the P-border? 1 Practical reasons (Jack Edmonds, 1965) For practical purposes the difference between algebraic and exponential order is more

More information

The k-center problem Approximation Algorithms 2009 Petros Potikas

The k-center problem Approximation Algorithms 2009 Petros Potikas Approximation Algorithms 2009 Petros Potikas 1 Definition: Let G=(V,E) be a complete undirected graph with edge costs satisfying the triangle inequality and k be an integer, 0 < k V. For any S V and vertex

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Given an NP-hard problem, what should be done? Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one of three desired features. Solve problem to optimality.

More information

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 600.363 Introduction to Algorithms / 600.463 Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14 23.1 Introduction We spent last week proving that for certain problems,

More information

Algorithm and Complexity of Disjointed Connected Dominating Set Problem on Trees

Algorithm and Complexity of Disjointed Connected Dominating Set Problem on Trees Algorithm and Complexity of Disjointed Connected Dominating Set Problem on Trees Wei Wang joint with Zishen Yang, Xianliang Liu School of Mathematics and Statistics, Xi an Jiaotong University Dec 20, 2016

More information

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Note 13 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite to writing a

More information

W[1]-hardness. Dániel Marx 1. Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary

W[1]-hardness. Dániel Marx 1. Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary W[1]-hardness Dániel Marx 1 1 Institute for Computer Science and Control, Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary School on Parameterized Algorithms and Complexity Będlewo, Poland

More information

Lecture 24: More Reductions (1997) Steven Skiena. skiena

Lecture 24: More Reductions (1997) Steven Skiena.   skiena Lecture 24: More Reductions (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that subgraph isomorphism

More information

Matching Theory. Figure 1: Is this graph bipartite?

Matching Theory. Figure 1: Is this graph bipartite? Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to

More information

Graph Theory and Optimization Approximation Algorithms

Graph Theory and Optimization Approximation Algorithms Graph Theory and Optimization Approximation Algorithms Nicolas Nisse Université Côte d Azur, Inria, CNRS, I3S, France October 2018 Thank you to F. Giroire for some of the slides N. Nisse Graph Theory and

More information