Question: [30] 1. Recall the following optimization problem: LONGEST PATH INSTANCE: A directed graph G = (V,E); vertices s, t E V. SOLUTION: A simple path

 [30] 1. Recall the following optimization problem: LONGEST PATH INSTANCE: A

[30] 1. Recall the following optimization problem: LONGEST PATH INSTANCE: A directed graph G = (V,E); vertices s, t E V. SOLUTION: A simple path p from s to t such that the length of p is maxi- mum. Also, recall that we converted LONGEST PATH to this decision problem DECISION LONGEST PATH INSTANCE: A directed graph G-V, E); vertices s,t E V; and integer K 2 0 QUESTION: Is there a simple path p from s to t such that the length of p is at least K? Suppose you have a subroutine DLP-ALGORITHM(G, s, t, K) that returns TRUE if G contains a simple path from s to t of length at least K and that re- turns FALSE otherwise; in other words, DLP-ALGoRITHM(G, s,t, K) solves DECI- SION LONGEST PATH. Give pseudocode for an algorithm LP-ALGORITHM(G, s, t) that solves LONGEST PATH on instance G, s,t by using no more than 2M +2E1 calls to DLP-ALGORITHM

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!