Optimized Longest Path is NP Complete (original) (raw)

Last Updated : 15 Jul, 2025

**Optimized Longest Path Problem : The optimized longest path problem states that given a graph **G, of a set of vertices **V and edges **E, the task is to prove that there is a path of length **at least K between a set of nodes **V s and V e.

**Problem Statement : Given a graph **G(V, E, K) and a set of nodes **V s and V e with the sequence of nodes, of length **≥ K.

**Explanation :
An instance of the problem is an input specified to the problem. An instance of the optimized-longest path problem is **G(V, E, V s , V e , K). Since an NP-complete problem is a problem which is both in **NP and **NP-Hard, the proof for the statement that a problem is NP-Complete consists of two parts:

  1. The problem itself is in NP class.
  2. All other problems in NP class can be polynomial-time reducible to that.
    (B is polynomial-time reducible to C is denoted as B≤PC)

If the 2nd condition is only satisfied then the problem is called **NP-Hard.

But it is not possible to reduce every NP problem into another NP problem to show its NP-Completeness all the time. That is why if we want to show a problem is NP-Complete we just show that the problem is in NP and any NP-Complete problem is reducible to that then we are done, i.e. if B is NP-Complete and B ≤ PC For C in NP, then C is NP-Complete. Thus, we can verify that the **Optimized Longest Path Problem is NP-Complete using the following two propositions: