Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 34, Problem 1P
Program Plan Intro

To formulate a related decision problem for the independent-set problem and prove that it is NP-complete.

Expert Solution
Check Mark

Explanation of Solution

Independent set of a graph G represents the set or collection of vertices that are not adjacent to one another. It is a concept in graph theory according to which there should not be any edge connecting the two vertices of a set.

  • It is also known as a stable set in which an edge can have at most single endpoint in the graph.
  • Thus, the vertices contained in the independent set represent the subset of the vertices of a graph.

Consider the figure or the graph given below containing an independent set of size 3:

  Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  1

Consider a graph Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  2containing V vertices and set of edges E. Here, it is required to devise a decision problem for the independent−set problem and proving that it is NP-complete.

Decision problem:

  • It is a way of asking the question in order to determine that whether a solution or answer of a particular question exists or not.
  • It is a type of problem in a formal system in which the answer or solution of the problem comes out to be in two definite forms as either yes or no.

Consider the following example:

Graph coloring, Hamiltonian cycle or graph. Travelling salesperson Problem (TSP) is some of the common examples of the decision problems (all these can also be expressed as an optimization problem).

Now, it is also asked to show that independent set problem is NP complete.

NP Hard: To show that the problem is NP Hard, the concept of reducing or transforming the instance of the clique problem to an instance of an independent set S.

Consider the instance of the clique problem as Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  3This problem is independent set problem having set Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  4where Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  5is the complement of E.

The set of vertices V represents a clique having size x is in the graph G only in case if V’ is an independent set of graph G’ having the size x and it is also following the fact that the construction of Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  6from Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  7must be done in polynomial time.

In this regard, it can be concluded that independent set problem is also NP hard. Thus it has been proved that an independent set problem is NP as well as NP-hard so it can be said that it is always NP complete.

Program Plan Intro

To give an algorithm to find an independent set of maximum size.

Expert Solution
Check Mark

Explanation of Solution

Given a black box subroutine to solve the decision problem defined in part (a) and a graph Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  8

To implement the algorithm for solving the problem consider black box as Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  9

Algorithm:

//perform search operation

Step 1: start binary search on B to determine the maximum size Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  10for the independent set.

//initialization step.

Step 2: Set the independent set I to be an empty set.

Step 3: For each Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  11

Construct Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  12by removal of Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  13and its related edges from the graph Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  14

Step 4: If Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  15

Set Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  16

Else Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  17

Here Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  18is obtained by removal of all the vertices which are connected to Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  19and the edges which are linked to it from the graph Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  20

//end

Here, step 1 has a time complexity of Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  21

Step2: it has a time complexity of Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  22

Step 3-4 : They have the number of iterations equal to Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  23

Hence it can be concluded that the time complexity is equal to Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  24

Program Plan Intro

To give an efficient algorithm to solve the independent-set problem when each vertex in G has degree 2.

Expert Solution
Check Mark

Explanation of Solution

Given that the degree of the graph is 2, which implies that each vertex in the graph has a cardinality or degree 2.

Here, it is required to give an algorithm that can solve the independent set problem of a graph having degree 2.

Also, it is required to analyze the running time and the correctness of an algorithm.

Consider the graphs containing a simple cycle-

  Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  25

Thus, from the above graphs it can be observed that generally the graph containing the vertices of degree 2 is a simple cycle.

Therefore, the independent set problem is such a case can be achieved by initiating at any vertex and start choosing the alternate vertex on the cycle till the size obtained for the independent set to be Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  26

Hence, it can also be concluded that that the running time of the algorithm to solve the problem of independent set having V vertices, E edges and degree of each vertex as 2 is Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  27

Program Plan Intro

To give an algorithm to solve the independent set problem when G is bipartite.

Expert Solution
Check Mark

Explanation of Solution

A bipartite graph commonly known as the biograph is an undirected graph whose vertex set can be partitioned or arranged into two disjoint sets that are independent.

It is possible to color this type of graph by using the two colors only so it is 2 colorable or bichromatic.

There are several applications of these graphs by using graphs like in case of matching problems.

For example:

Consider a bipartite graph given below containing two set of vertices Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  28and Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  29such that Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  30

First find the maximum-matching of the graph by using an algorithm such as augmenting path algorithm or much faster and an improved algorithm known as Hopcroft-Karp bipartite matching algorithm. (Refer section 26-6)

? Repeat the process

¦ for all vertices which are not present in the maximum-matching set (set with largest number of edges), run BFS to find the augmenting path.

¦ Alternate unmatched/matched edges to select the edge which is in the maximum matching and are not connected from the vertices that are not a part maximum matching set.

¦ Reverse or flip the matched edges with unmatched edges and vice-versa.

? Stop the process if no augmenting path is found and return the last matching set.

  Introduction to Algorithms, Chapter 34, Problem 1P , additional homework tip  31

The running time or running complexity of the algorithm to solve the independent set problem is. The algorithm works correctly if there does not exist any augmenting path with respect to the maximal matching M as obtained by applying the bipartite matching algorithm.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
An independent set of a graph G = (V, E) is a subset V’ Í V of vertices such that each edge in E is incident on at most one vertex in V’. The independent-set problem is to find a maximum-size independent set in G . Analyse the complexity of the approximation algorithm for solving the independent-set problem
Please show written work with answer!! An independent set in a graph is a set of vertices no two of which are adjacent to each other. A clique is a complete subgraph of a given graph. This means that there is an edge between any two nodes in the subgraph. The maximal clique is the complete subgraph of a given graph which contains the maximum number of nodes. We know that independent set is a NP complete problem. Transform the independent set to max clique (in polynomial time) to show that Max Clique is also NP
Recall the Clique problem: given a graph G and a value k, check whether G has a set S of k vertices that's a clique. A clique is a subset of vertices S such that for all u, v € S, uv is an edge of G. The goal of this problem is to establish the NP-hardness of Clique by reducing VertexCover, which is itself an NP-hard problem, to Clique. Recall that a vertex cover is a set of vertices S such that every edge uv has at least one endpoint (u or v) in S, and the VertexCover problem is given a graph H and a value 1, check whether H has a vertex cover of size at most 1. Note that all these problems are already phrased as decision problems, and you only need to show the NP-Hardness of Clique. In other words, we will only solve the reduction part in this problem, and you DO NOT need to show that Clique is in NP. Q4.1 Let S be a subset of vertices in G, and let C be the complement graph of G (where uv is an edge in C if and only if uv is not an edge in G). Prove that for any subset of vertices…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education