/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q2E Search versus decision. Suppose ... [FREE SOLUTION] | 91影视

91影视

Search versus decision. Suppose you have a procedure which runs in polynomial time and tells you whether or not a graph has a Rudrata path. Show that you can use it to develop a polynomial-time algorithm for RUDRATA PATH (which returns the actual path, if it exists).

Short Answer

Expert verified

It has been shown that the above process can be used to develop a polynomial time set of rules and it keeps the RUDRATA direction inside the graph till the end.

Step by step solution

01

Algorithm

Polynomial-time algorithm for RUDRATA route:

The quest problem within the textbook contains a manner 鈥C鈥, which includes inputs.

One is the example 鈥I鈥 and a proposed solution 鈥S鈥 which runs in the polynomial time .

This seek trouble incorporates RUDRATA course, if it satisfies the relation 鈥 鈥

Similar to this search hassle, the subsequent set of rules is developed and it runs in polynomial time and it carries RUDRATA route in it:

Algorithm:

Feature to check the graph includes Rudrata route

function Rudrata path (G)

Take a look at whether the graph G carries Rudrata direction,

if now not D(G) then return 鈥渘o route鈥

Assign the brink

E'E

Execute the for loop for all the edges for each do remove the threshold e from the graph

G'(V,E'-e)

Check whether D(G') includes Rudrata course and get rid of the edge from the graph */

if then

go back the rudrata direction

Return E'

02

Explanation of Algorithm

Inside the above set of rules anticipate that during given graph , the procedure 鈥淒(G)鈥 returns the Boolean value 鈥済enuine鈥 whilst the graph 鈥G鈥 carries Rudrata path otherwise, it returns the Boolean price 鈥渇ake鈥.

Define the process Rudrata path (G) to check whether the path exists or not.

If the graph 鈥淒(G)鈥 carries no RUDRATA course then return the authentic price.

If no longer execute for loop for all the rims within the graph and check still if the graph contains the Rudrata route after disposing of 鈥渆鈥 completely from the graph.

If the received new graph no longer exist with the RUDRATA route, then upload the 鈥渆鈥 returned to the graph.

For this reason, maintaining the invariance within the graph exists with the RUDRATA course, because it is regarded that, it is possible to eliminate all the rims except the unmarried RUDRATA direction and it is left in the end.

The above set of rules runs in polynomial time, due to the fact all the edges are carried out in 鈥渇or鈥 loop most effective as soon as in a graph G.

Therefore, the above process is the polynomial time set of rules and it keeps the RUDRATA direction inside the graph till the end.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91影视!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Proving NP-completeness by generalization. For each of the problems below, prove that it is NP-complete by showing that it is a generalization of some NP-complete problem we have seen in this chapter.

  1. SUBGRAPH ISOMORPHISM: Given as input two undirected graphsG and H, determine whetherG is a subgraph of H (that is, whether by deleting certain vertices and edges ofH we obtain a graph that is, up to renaming of vertices, identical toG ), and if so, return the corresponding mapping ofV(G) intoV(H) .
  2. LONGEST PATH: Given a graph role="math" localid="1658141805147" Gand an integerg find inG a simple path of lengthg .
  3. MAX SAT: Given a CNF formula and an integer g, find a truth assignment that satisfies at least gclauses.
  4. DENSE SUBGRAPH: Given a graph and two integersa and b, find a set of a vertices ofG such that there are at leastb edges between them.
  5. SPARSE SUBGRAPH: Given a graph and two integersa andb , find a set of a vertices ofG such that there are at most bedges between them.
  6. SET COVER. (This problem generalizes two knownNP-complete problems.)
  7. RELIABLE NETWORK: We are given twonn matrices, a distance matrixdij and a connectivity requirement matrixrij , as well as a budgetb ; we must find a graph G=({1,2,.....,n},E)such that (1) the total cost of all edges isb or less and (2) between any two distinct verticesi andj there arerij vertex-disjoint paths.

Determine which of the following problems are NP-complete and which are solvable in polynomial time. In each problem you are given an undirected graph G=(V,E), along with:

(a)A set of nodesLV , and you must find a spanning tree such that its set of leaves includes the set L.

(b)A set of nodes LV, and you must find a spanning tree such that its set of leaves is precisely the set L.

(c)A set of nodesLV , and you must find a spanning tree such that its set of leaves is included in the set L.

(d)An integer k, and you must find a spanning tree withk or fewer leaves.

(e)An integer k, and you must find a spanning tree withk or more leaves.

(f)An integer k, and you must find a spanning tree with exactlyk leaves.

Give a simple reduction from 3D MATCHING to SAT, and another from RUDRATA CYCLE to SAT.

(Hint: In the latter case you may use variables xijwhose intuitive meaning is 鈥渧ertex i is the j th vertex of the Hamilton cycle鈥; you then need to write clauses that express the constraints of the problem.)

In task scheduling, it is common to use a graph representation with a node for each task and a directed edge from task i to j task if i is a precondition for j. This directed graph depicts the precedence constraints in the scheduling problem. Clearly, a schedule is possibe if and only if the graph is acyclic; if it isn鈥檛, we鈥檇 like to identify the smallest number of constraints that must be dropped so as to make it acyclic.

Given a directed graph G=(V,E), a subset E'Eis called a feedback arc set if the removal of edges E' renders G acyclic.

FEEDBACK ARC SET (FAS): Given a directed graph G=(V,E)and a budget , find a feedback arc set of role="math" localid="1658907144825" bedges, if one exists.

(a)Show that FAS is in NP.

FAS can be shown to be NP-complete by a reduction from VERTEX COVER. Given an instance (G,b)of VERTEX COVER, where G is an undirected graph and we want a vertex cover of size b, we construct a instance (G',b)of FAS as follows. If G=(V,E)has vertices v1,K,vnthen make G'=(V',E')a directed graph with 2n verticesw1,w1',k,wn,wn',andn+2|E|(directed) edges:

  • (wi,wi')foralli=1,2,k,n
  • (wi',wj)and(wj',wi)forevery(vi,vj)E.
  • Show that if G contains a vertex cover of size b, then G' contains a feedback arc set of size b .
  • Show that if G' contains a feedback arc set of size b, then G contains a vertex cover of size (at most) b. (Hint: Given a feedback arc set of size b in G', you may need to first modify it slightly to obtain another one which is of a more convenient form, but is of the same size or smaller. Then, argue that G must contain a vertex cover of the same size as the modified feedback arc set.)

STINGY SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer K , find a satisfying assignment in which at most K variables are true, if such an assignment exists. Prove that isNP -complete.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.