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
EX:[AE00]=fa50h number of ones =1111 1010 0101 0000 Physical address=4AE00h=4000h*10h+AE00h Mov ax,4000 Mov ds,ax; DS=4000h mov ds,4000 X Mov ax,[AE00] ; ax=[ae00]=FA50h Mov cx,10; 16 bit in decimal Mov bl,0 *: Ror ax,1 Jnc ** Inc bl **:Dec cx Jnz * ;LSB⇒CF Cf=1 ; it jump when CF=0, will not jump when CF=1 HW1: rewrite the above example use another way
EX2: Write a piece of assembly code that can count the number of ones in word stored at 4AE00h
Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random response to a yes or no question. In the student sample programs for this book, you will find a text file named 8_ball_responses.txt. The file contains 12 responses, such as “I don’t think so”, “Yes, of course!”, “I’m not sure”, and so forth. The program should read the responses from the file into a list. It should prompt the user to ask a question, then display one of the responses, randomly selected from the list. The program should repeat until the user is ready to quit. Contents of 8_ball_responses.txt:  Yes, of course! Without a doubt, yes. You can count on it. For sure! Ask me later. I'm not sure. I can't tell you right now. I'll tell you after my nap. No way! I don't think so. Without a doubt, no. The answer is clearly NO. (You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning