/*! 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 Devise a backtracking algorithm ... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Devise a backtracking algorithm for the RUDRATA PATH problem from a fixed vertex s. To fully specify such an algorithm you must define:

(a) What is a subproblem?

(b) How to choose a subproblem.

(c) How to expand a subproblem.

Argue briefly why your choices are reasonable

Short Answer

Expert verified

a).A subproblem for the RUDRATA PATH problem is given below.

b). Choosing a subproblem by backtracking algorithm is shown below.

c). Expand a sub problem is described.

Step by step solution

01

Step 1: Backtracking algorithm for the RUDRATA PATH problem.

The RUDRATA PATH problem NP complete hard problem.

A backtracking algorithm requires a test that looks at a subproblem and quickly declares one of three outcomes:

1. Failure: the subproblem has no solution.

2. Success: a solution to the subproblem is found.

3. Uncertainty.

In the case of SAT, this test declares failure if there is an empty clause, success if there are no clauses and uncertainty otherwise.

With the right test, expand, and choose routines, backtracking can be remarkably effective in practice. The backtracking algorithm we showed for SAT is the basis of many successful satisfiability programs.

02

Define subproblem.

a).

A polynomial-time reduction which given any graph G and integer any C>0 produces an instance I(G,C) of the TSP such that:

1)IfG has a Rudrata path, thenOPT(I(G,C))=n, the number of vertices in G.

2)If G has no Rudrata path, then OPT(I(G,C))≥n+C.

This means that even an approximate solution to TSP would enable us to solve RUDRATA PATH.

An approximation algorithm for TSP and let denote its approximation ratio. From any instanceof RUDRATA PATH, we will create an instance I(G,C) of TSP using the specific constantC=nαA.

In case

(i), it must output a tour of length at most αA â¶ÄŠOPT(I(G,C))=nαA,whereas in case

(ii) it must output a tour of length at least OPT(I(G,C))>nαA .

Thus we can figure out whetherGhas a Rudrata path! Here is the resulting procedure:

Given any graphG:

Compute I(G,C)(withC=n·αA) and run algorithm A on it ,

If the resulting tour has length≤nαA:

Conclude that G has a Rudrata path ;

Else: conclude that G has no Rudrata path;

This tells us whether or not G has a Rudrata path;

By calling the procedure a polynomial number of times, if TSP has a polynomial-time approximation algorithm, then there is a polynomial algorithm for the NP-complete RUDRATA PATH problem.

So, unless P=NP , there cannot exist an efficient approximation algorithm for the TSP.

03

Step 3: Choose a subproblem.

b).

Since the new vertex x has only two neighbors, sandt, any Rudrata cycle in G must consecutively traverse the edges {t,x}and{x,s}.

The rest of the cycle then traverses every other vertex en route fromsandt, . Thus deleting the two edges {t,x}and{x,s}.from the Rudrata cycle gives a Rudrata path from sandt,in the original graph G.

In the case of SAT, this test declares failure if there is an empty clause, success if there are no clauses, and uncertainty otherwise.

With the right test, expand, and choose routines, backtracking can be remarkably effective in practice. The backtracking algorithm we showed for SAT is the basis of many successful satisfiability programs.

As from this instance of RUDRATA CYCLE has a solution.

04

Step 4: Expand a subproblem.

c).

In this case we must show that the original instance of RUDRATA (s,t)-PATH cannot have a solution either. It is usually easier to prove the contra positive, that is, to show that if there is a Rudrata (s,t)-PATH in G, then there is also a Rudrata cycle in . But this is easy: just add the two edges {t,x}and{x,s}.to the Rudrata path to close the cycle.

And here all the crucial but typically easy to check, is that the pre- and postprocessing functions take time polynomial in the size of the instance (G,s,t).It is also possible to

go in the other direction and reduce RUDRATA CYCLE to RUDRATA (s,t)-PATH

Together, these reductions demonstrate that the two Rudrata variants are in essence the same problem that their descriptions are almost the same.

An approximation algorithm A for TSP and let αA denote its approximation ratio. From any instanceGof RUDRATA PATH, we will create an instance I(G,C) of TSP using the specificconstantC=nαA.

But most of the other reductions are between pairs of problems that, on the face of it, look quite different. they are essentially the same, our reductions will have to cleverly translate between them.

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

In the MAX SAT problem, we are given a set of clauses, and we want to find an assignment that satisfies as many of them as possible.

(a) Show that if this problem can be solved in polynomial time, then so can SAT.

(b) Here’s a very naive algorithm.

for each variable:

set its value to either0or1 by flipping a coin

Suppose the input has m clauses, of which thejth haskj literals. Show that the expected number of clauses satisfied by this simple algorithm is

∑j=1m1-12k â¶ÄŠâ€Šâ‰¥m2

In other words, this is a 2-approximation in expectation! And if the clauses all contain literals, then this approximation factor improves to 1+1/2k−1.

(c) Can you make this algorithm deterministic? (Hint: Instead of flipping a coin for each variable, select the value that satisfies the most of the as of yet unsatisfied clauses. What fraction of the clauses is satisfied in the end?)

In the MULTIWAY CUT problem, the input is an undirected graphG=(V,E) and a set of terminal nodess1,s2,...,sk∈V. The goal is to find the minimum set of edges in whose removal leaves all terminals in different components.

(a) Show that this problem can be solved exactly in polynomial time when k=2.

(b) Give an approximation algorithm with ratio at most2 for the case k=3.

(c) Design a local search algorithm for multiway cut.

Given an undirected graphG=(V,E) in which each node hasdegree≤d , show how to efficiently find an independent set whose size is at least1d+1times that of the largest independent set.

In the backtracking algorithm for SAT, suppose that we always choose a subproblem (CNF formula) that has a clause that is as small as possible; and we expand it along a variable that appears in this small clause. Show that this is a polynomial-time algorithm in the special case in which the input formula has only clauses with two literals (that is, it is an instance of 2SAT).

Let us call a local search algorithm exact when it always produces the optimum solution. For example, the local search algorithm for the minimum spanning tree problem introduced in Problem 9.5 is exact. For another example, simplex can be considered an exact local search algorithm for linear programming.

(a) Show that the2- change local search algorithm for the TSP is not exact.

(b) Repeat for the [n2]- change local search algorithm, where is the number of cities.

(c) Show that (n-1)-change local search algorithm is exact.

(d) If A is a optimization problem, define A-IMPROVEMENT to be the following search problem: Given an instancexof A and a solutionsof A, find another solution ofxwith better cost ( or report that none exists, and thus is optimum). For example, in TSP IMPROVEMENT we are given a distance matrix and a tour, and we are asked to find a better tour. It turns out that TSP IMPROVEMENT is NP-complete, and so is SET COVER IMPROVEMENT. (Can you prove this?).

(e) We say that a local search algorithm has polynomial iterationif each execution of the loop requires polynomial time. For example, the obvious implementation of the (n-1) -change local search algorithm for the TSP defined above does not have polynomial iteration. Show that, unless , there is no exact local search algorithm with polynomial iteration for the TSP and SET COVER problems.

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.