To formulate a related decision problem for the independent-set problem and prove that it is NP-complete.
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
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.
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.
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
- Let G be a graph with n vertices. The k-coloring problem is to decide whether the vertices of G can be labeled from the set {1, 2, ..., k} such that for every edge (v,w) in the graph, the labels of v and w are different. Is the (n-4)-coloring problem in P or in NP? Give a formal proof for your answer. A 'Yes' or 'No' answer is not sufficient to get a non-zero mark on this question.arrow_forwarda. Explain how to prove that a problem is NP-Complete based onreduction from a known NP-Complete problem.b. An independent set of a graph G = (V, E) is a subset V’ V of verticessuch that each edge in E is incident on at most one vertex in V’. Theindependent-set problem is to find a maximum-size independent set in G.Formulate a related decision problem.c. Prove that this decision problem is NP-complete. (Hint: Reduce fromthe clique problem or from the vertex cover problem.)arrow_forwardPlease solve and show all work. 21.1-2 Professor Sabatier conjectures the following converse of Theorem 21.1. Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a subset of E that is included in some minimum spanning tree for G, let (S, V – S) be any cut of G that respects A, and let (u, v) be a safe edge for A crossing (S, V – S). Then, (u, v) is a light edge for the cut. Show that the professor’s conjecture is incorrect by giving a counterexample.arrow_forward
- The decision variant of the minimum vertex cover problem is stated as follows. Given an undirected graph G = (V, E) and an integer k. Is there a set V ′ ⊆ V of at most k nodes such that each edge is covered, i.e. e ∩ V ′ ̸= ∅, for all e ∈ E. Show that the decision variant of the minimum vertex cover problem is NP-complete. You may use that the decision variant of the maximum clique problem is NP-complete.arrow_forwardProblem 1 A jogger wants to follow the least undesirable cycle of roads starting at her home. Each road has an "index of undesirability" and can be traversed in either direction; the jogger must follow a nonempty cycle of roads and no road can be used twice. Formulated as a graph problem, the jogger has an undirected weighted graph G = (V, E), and must determine the nonempty cycle of minimum weight starting (and ending) at vertex s. 1. Show how to use multiple applications of Dijkstra's shortest path algorithm to obtain the optimum jogger's route in time O(|V | 2 log |V | + |E||V |). Be precise: each time you want to use Dijkstra's explain which graph is the input of the algorithm, 2. Let T be the shortest path tree constructed by Dijkstra's shortest path algorithm for starting vertex s in G. Prove that some optimum jogger's route has all but one of its edges in T , and furthermore, that s is the lowest common ancestor in T of the end points of that edge. 3. Use the result in…arrow_forwardA Hamiltonian path on a directed graph G = (V, E) is a path that visits each vertex in V exactly once. Consider the following variants on Hamiltonian path: (a) Give a polynomial-time algorithm to determine whether a directed graph G contains either a cycle or a Hamiltonian path (or both). Given a directed graph G, your algorithm should return true when a cycle or a Hamiltonian path or both and returns false otherwise. (b) Show that it is NP-hard to decide whether a directed graph G’ contains both a cycle and a Hamiltonian Path, by giving a reduction from the HAMILTONIAN PATH problem: given a graph G, decide whether it has a Hamiltonian path. (Recall that the HAMILTONIAN PATH problem is NP-complete.)arrow_forward
- Let G = (V,E) be a bipartite graph, but this time it is a weighted graph. The weight of acomplete matching is the sum of the weights of its edges. We are interested in finding aminimum-weight complete matching in G.a) Give a legitimate C for a branch-and-bound (B&B) algorithm that finds a minimum-weightcomplete matching in G, and prove that your C is valid. Your C cannot be just the cost sofar.b) Using your C, apply B&B to find a minimum-weight complete matching in the followingweighted bipartite graph G: A = (1,2,3), B = (4,5,6,7)E = (((1,4), 3]. [(1,5), 4]. [(1,7). 15]. ((2,4), 1]. |(2,5), 8]. [(2,6), 3]. |(3,4), 3]. [(3,5), 9]. [ (3,6). 51).Show the solution tree. the C of every tree node generated, and the optimal solution. Also,mark the order in which each node in the solution tree is visited.arrow_forwardGiven a directed graph with positive edge lengths and two distinct vertices uand v in the graph, the “all-pairs uv-constrained shortest path problem” is the problemof computing for each pair of vertices i and j the length of the shortest path from i toj that goes through the vertex u or through the vertex v. If no such path exists, theanswer is ∞. Describe an algorithm that takes a graph G = (V, E) and vertices u and v asinput parameters and computes values L(i, j) that represent the length of uv-constrainedshortest path from i to j for all 1 ≤ i, j ≤ |V|, i ! = u, j ! = u, i != v, j ! = v. Provide clearpseudocode solution. Prove your algorithm correct. Your algorithm must have runningtime in O(|V| ^2).arrow_forwardHall's theorem Let d be a positive integer. We say that a graph is d-regular if every node has degree exactly d. Show that every d-regular bipartite graph G = (L ∪ R, E) with bipartition classes L and R has |L| = |R|. Show that every d-regular bipartite graph has a perfect matching by (directly) arguing that a minimum cut of the corresponding flow network has capacity |L|arrow_forward
- Prove that the following problem is NP-complete: Given a graph G, and an integer k, find whether or not graph G has a spanning degree where the maximum degree of any node is k. (Hint: Show a reduction from one of the following known NP-complete problems: Vertex Cover, Ham Path or SAT.)arrow_forwardou are given a directed graph G = (V, E) and two vertices s and t. Moreover, each edge of this graph is colored either blue or red. Your goal is to find whether there is at least one path from s to t such that all red edges in this path appear after all blue edges (the path may not contain any blue edges or any red edges, but if it has both types of edges, all red edges should appear after all blue edges). Design and analyze an algorithm for solving this problem in O(n + m) time.arrow_forwardThe third-clique problem is about deciding whether a given graph G = (V, E) has a clique of cardinality at least |V |/3.Show that this problem is NP-complete.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education