{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# 02_npc_II - Chapter 2 NP Completeness II By Sariel...

This preview shows pages 1–3. Sign up to view the full content.

Chapter 2 NP Completeness II By Sariel Har-Peled , September 17, 2007 Version: 1.02 2.1 Max-Clique Figure 2.1: A clique of size 4 inside a graph with 8 vertices. We remind the reader, that a clique is a complete graph, where every pair of vertices are connected by an edge. The MaxClique problem asks what is the largest clique appearing as a subgraph of G . See Figure 2.1. Problem: MaxClique Instance: A graph G Question: What is the largest number of nodes in G forming a complete subgraph? Note that MaxClique is an optimization problem, since the output of the algorithm is a number and not just true / false. The first natural question, is how to solve MaxClique . A naive algorithm would work by enumerating all subsets S V ( G ), checking for each such subset S if it induces a clique in G (i.e., all pairs of vertices in S are connected by an edge of G ). If so, we know that G S is a clique, where G S denotes the induced subgraph on S defined by G ; that is, the graph formed by removing all the vertices are not in S from G (in particular, only edges that have both endpoints in S appear in G S ). Finally, our algorithm would return the largest S encountered, such that G S is a clique. The running time of this algorithm is O 2 n n 2 as can be easily verified. T IP Suggestion 2.1.1 When solving any algorithmic problem, always try first to find a simple (or even naive) solution. You can try optimizing it later, but even a naive solution might give you useful insight into a problem structure and behavior. This work is licensed under the Creative Commons Attribution-Noncommercial 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
We will prove that MaxClique is NP-H  . Before dwelling into that, the simple algorithm we devised for MaxClique shade some light on why intuitively it should be NP-H  : It does not seem like there is any way of avoiding the brute force enumeration of all possible subsets of the vertices of G . Thus, a problem is NP-H  or NP-C  , intuitively , if the only way we know how to solve the problem is to use naive brute force enumeration of all relevant possibilities. How to prove that a problem X is NP-H  ? Proving that a given problem X is NP-H  is usually done in two steps. First, we pick a known NP-C  problem A . Next, we show how to solve any instance of A in polynomial time, assuming that we are given a polynomial time algorithm that solves X . Proving that a problem X is NP-C  requires the additional burden of showing that is in NP . Note, that only decision problems can be NP-C  , but optimization problems can be NP-H  ; namely, the set of NP-H  problems is much bigger than the set of NP-C  problems.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}