Professional Documents
Culture Documents
11/10/2012
NP-Complete Problems - II
11/10/2012
11/10/2012
11/10/2012
Independent Set
Problem - A subset of nodes S V is an independent set of graph G = (V, E) if there are no edges between them An Example:
{1, 5} is an independent set {1, 4, 5} - ? {2, 3, 6} - ?
11/10/2012
Vertex Cover
A Vertex Cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set The problem of finding a Minimum Vertex Cover is a classical optimization problem in algorithms
Clique
A Clique in an undirected graph is a subset of its vertices such that every two vertices in the subset are connected by an edge finding whether there is a clique of a given size in a graph (the Clique problem) is NPcomplete
11/10/2012
Clique
A graph with 23 1-vertex cliques (its vertices), 42 2-vertex cliques (its edges), 19 3-vertex cliques (the light blue triangles), and 2 4-vertex cliques (dark blue). the clique number of the graph is 4
Reduction
A B (A is Polynomial Time Reducible to B)
Efficient Problems: If B is efficient then A is also efficient Hard Search Problems (NP Complete): If A is hard then B is also hard
So if A is NP-complete,
a new search problem B is also NP-complete, simply by reducing A to B This is how the set of NP-Complete problems has grown since then
11/10/2012
RUDRATA PATH
RUDRATA CYCLE
RUDRATA (s, t) PATH RUDRATA CYCLE ? RUDRATA CYCLE problem: given a graph, is there a cycle that passes through each vertex exactly once? RUDRATA (s, t)- PATH problem: given a graph with two vertices s and t, and we want a path starting at s and ending at t that goes through each vertex exactly once
RUDRATA PATH
RUDRATA CYCLE
11/10/2012
RUDRATA PATH
RUDRATA CYCLE
11/10/2012
Graph Coloring
Map Coloring
The three-colour map colouring problem asks if we can colour a map so that no adjoining countries have the same colour. Once a solution has been guessed, then it is readily proved This problem is easily answered if there are only 2 colours - there must be no point at which an odd number of countries meet - or 4 colours - there is a proof that 4 colours suffice for any map This problem has a graph equivalent: each vertex represents a country and an edge is drawn between two vertices if they share a common border. Its solution has a more general application. If we are scheduling work in a factory: each vertex can represent a task to be performed - they are linked by an edge if they share a common resource, eg require a particular machine. A colouring of the vertices with 3 colours then provides a 3-shift schedule for the factory.
Reduction Again!
Many problems are reducible to others:
Map colouring can be reduced to graph colouring. A solution to a graph colouring problem is effectively a solution to the equivalent map colouring or scheduling problem. The map or graph-colouring problem may be reduced to the boolean satisfiability problem. To give an informal description of this process, assume the three colours are red, blue and green. Denote the partial solution, "A is red" by ar so that we have a set of boolean variables:
11/10/2012
Reduceability
ar ab ag br Now a solution to the problem may be found by finding values for ar, ab, etc which make the expression true: ((ar and not ab and not ag) and ( (bb and (cb and (dg .... bb bg cr ... A is red A is blue A is green B is red B is blue B is green C is red ...
Reduceability
Thus solving the map colouring problem is equivalent to finding an assignment to the variables which results in a true value for the expression - the Boolean Satisfiability problem
10
11/10/2012
References
Chapter 8, Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani
11