To formulate a related decision problem for the independent-set problem and prove that it is NP-complete.
![Check Mark](/static/check-mark.png)
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:
Consider a graph containing 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 This problem is independent set problem having set
where
is 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 from
must 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.
To give an
![Check Mark](/static/check-mark.png)
Explanation of Solution
Given a black box subroutine to solve the decision problem defined in part (a) and a graph
To implement the algorithm for solving the problem consider black box as
Algorithm:
//perform search operation
Step 1: start binary search on B to determine the maximum size for the independent set.
//initialization step.
Step 2: Set the independent set I to be an empty set.
Step 3: For each
Construct by removal of
and its related edges from the graph
Step 4: If
Set
Else
Here is obtained by removal of all the vertices which are connected to
and the edges which are linked to it from the graph
//end
Here, step 1 has a time complexity of
Step2: it has a time complexity of
Step 3-4 : They have the number of iterations equal to
Hence it can be concluded that the time complexity is equal to
To give an efficient algorithm to solve the independent-set problem when each vertex in G has degree 2.
![Check Mark](/static/check-mark.png)
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-
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
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
To give an algorithm to solve the independent set problem when G is bipartite.
![Check Mark](/static/check-mark.png)
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 and
such that
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.
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?
Chapter 34 Solutions
Introduction To Algorithms, Third Edition (international Edition)
- D. S. Malik, Data Structures Using C++, 2nd Edition, 2010arrow_forwardMethods (Ch6) - Review 1. (The MyRoot method) Below is a manual implementation of the Math.sqrt() method in Java. There are two methods, method #1 which calculates the square root for positive integers, and method #2, which calculates the square root of positive doubles (also works for integers). public class SquareRoot { public static void main(String[] args) { } // implement a loop of your choice here // Method that calculates the square root of integer variables public static double myRoot(int number) { double root; root=number/2; double root old; do { root old root; root (root_old+number/root_old)/2; } while (Math.abs(root_old-root)>1.8E-6); return root; } // Method that calculates the square root of double variables public static double myRoot(double number) { double root; root number/2; double root_old; do { root old root; root (root_old+number/root_old)/2; while (Math.abs (root_old-root)>1.0E-6); return root; } } Program-it-Yourself: In the main method, create a program that…arrow_forwardI would like to know the main features about the following 3 key concepts:1. Backup Domain Controller (BDC)2. Access Control List (ACL)3. Dynamic Memoryarrow_forward
- In cell C21, enter a formula to calculate the number of miles you expect to drive each month. Divide the value of number of miles (cell A5 from the Data sheet) by the average MPG for the vehicle multiplied by the price of a gallon of gas (cell A6 from the Data sheet).arrow_forwardMicrosoft Excelarrow_forwardIn cell C16, enter a formula to calculate the price of the vehicle minus your available cash (from cell A3 in the Data worksheet). Use absolute references where appropriate—you will be copying this formula across the row what fomula would i use and how do i solve itarrow_forward
- What types of data visualizations or tools based on data visualizations have you used professionally, whether in a current or past position? What types of data did they involve? What, in your experience, is the value these data views or tools added to your performance or productivity?arrow_forwardQuestion: Finding the smallest element and its row index and column index in 2D Array: 1. Write a public Java class min2D. 2. In min2D, write a main method. 3. In the main method, create a 2-D array myArray with 2 rows and 5 columns: {{10, 21, 20, 13, 1}, {2, 6, 7, 8, 14}}. 4. Then, use a nested for loop to find the smallest element and its row index and column index. 5. Print the smallest element and its row index and column index on Java Consolearrow_forward(using R)The iris data set in R gives the measurements in centimeters of the variables sepal length and width andpetal length and width, respectively, for 50 flowers from each of 3 species of iris, setosa, versicolor, andvirginica. Use the iris data set and the t.test function, test if the mean of pepal length of iris flowers isgreater than the mean of sepal length.The iris data set in R gives the measurements in centimeters of the variables sepal length and width andpetal length and width, respectively, for 50 flowers from each of 3 species of iris, setosa, versicolor, andvirginica. Use the iris data set and the t.test function, test if the mean of pepal length of iris flowers isgreater than the mean of sepal length.arrow_forward
- Recognizing the Use of Steganography in Forensic Evidence (4e)Digital Forensics, Investigation, and Response, Fourth Edition - Lab 02arrow_forwardWrite a Java Program to manage student information of a university. The Javaprogram does the following steps:a) The program must use single-dimensional arrays to store the studentinformation such as Student ID, Name and Major.b) The program asks the user to provide the number of students.c) The program asks the user to enter the Student IDs for the number of studentsand stores them.d) The program asks the user to enter the corresponding names for the numberof students and stores them.e) The program then asks the user to provide the corresponding major for thestudents and stores them.f) The program then should display the following options:1. ID Search2. Major Enrollment3. Exitg) On selecting option 1, the user can search for a student using Student ID. Theprogram asks the user to enter a Student ID. It then should print thecorresponding student’s details such as Name and Major if the user providedStudent ID number is present in the stored data. If the user’s Student IDnumber does not…arrow_forward(a) Algebraically determine the output state |q3q2q1q0> (which is a 4-qubitvector in 16-dimensional Hilbert space). Show all steps of your calculations. (b) Run a Qiskit code which implements the circuit and append threemeasurement gates to measure the (partial) output state |q2q1q0> (which is a 3-qubit vector in 8-dimensional Hilbert space). this is for quantum soft dev class, you can use stuff like Deutsch Jozsa if u wantarrow_forward
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrFundamentals of Information SystemsComputer ScienceISBN:9781305082168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305082168/9781305082168_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)