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](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4f324cc09b_06066f4f32447203.jpg)
[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
Get step-by-step solutions from verified subject matter experts
