Define the optimization problem LONGEST-PATH-LENGTH as the relation thatassociates each instance of an undirected graph and two vertices with the num-ber of edges in a longest simple path between the two vertices. Define the de-cision problem LONGEST-PATH D fhG; u; ; ki W G D .V; E/ is an undi-rected graph, u; 2 V , k 0 is an integer, and there exists a simple pathfrom u to in G consisting of at least k edgesg. Show that the optimization prob-lem LONGEST-PATH-LENGTH can be solved in polynomial time if and only ifLONGEST-PATH 2 P.
Question
Define the optimization problem LONGEST-PATH-LENGTH as the relation thatassociates each instance of an undirected graph and two vertices with the num-ber of edges in a longest simple path between the two vertices. Define the de-cision problem LONGEST-PATH D fhG; u; ; ki W G D .V; E/ is an undi-rected graph, u; 2 V , k 0 is an integer, and there exists a simple pathfrom u to in G consisting of at least k edgesg. Show that the optimization prob-lem LONGEST-PATH-LENGTH can be solved in polynomial time if and only ifLONGEST-PATH 2 P.
Solution
Para demostrar que el problema de optimización LONGEST-PATH-LENGTH puede resolverse en tiempo polinómico si y solo si LONGEST-PATH pertenece a P, sigamos los siguientes pasos:
-
Definiciones:
- Problema de optimización LONGEST-PATH-LENGTH: Dado un grafo no dirigido y dos vértices , encontrar el número de aristas en el camino simple más largo entre y .
- Problema de decisión LONGEST-PATH: Dado un grafo no dirigido , dos vértices y un entero , determinar si existe un camino simple desde hasta en que consista en al menos aristas.
-
Demostración de que LONGEST-PATH-LENGTH puede resolverse en tiempo polinómico si LONGEST-PATH pertenece a P:
- Supongamos que LONGEST-PATH pertenece a P, es decir, existe un algoritmo que puede decidir si hay un camino simple de al menos aristas entre y en tiempo polinómico.
- Para resolver LONGEST-PATH-LENGTH, podemos usar una búsqueda binaria sobre el valor de . El rango de va desde 0 hasta (el número máximo de aristas en un camino simple en un grafo con vértices).
- En cada paso de la búsqueda binaria, usamos el algoritmo de decisión de LONGEST-PATH para verificar si existe un camino simple de longitud al menos .
- La búsqueda binaria requiere consultas al algoritmo de decisión, y cada consulta se resuelve en tiempo polinómico. Por lo tanto, el problema de optimización LONGEST-PATH-LENGTH se puede resolver en tiempo polinómico.
-
Demostración de que LONGEST-PATH pertenece a P si LONGEST-PATH-LENGTH puede resolverse en tiempo polinómico:
- Supongamos que existe un algoritmo que resuelve LONGEST-PATH-LENGTH en tiempo polinómico.
- Para resolver LONGEST-PATH, dado un grafo , dos vértices y , y un entero , simplemente ejecutamos el algoritmo de LONGEST-PATH-LENGTH para encontrar la longitud del camino simple más largo entre y .
- Si la longitud del camino más largo es al menos , entonces la respuesta a LONGEST-PATH es "sí". De lo contrario, la respuesta es "no".
- Dado que el algoritmo de LONGEST-PATH-LENGTH se ejecuta en tiempo polinómico, esto implica que LONGEST-PATH también se puede resolver en tiempo polinómico.
Por lo tanto, hemos demostrado que el problema de optimización LONGEST-PATH-LENGTH puede resolverse en tiempo polinómico si y solo si LONGEST-PATH pertenece a P.
Similar Questions
The longest-simple-cycle problem is the problem of determining a simple cycle(no repeated vertices) of maximum length in a graph. Formulate a related decisionproblem, and show that the decision problem is NP-complete.
The critical pathIs a path that operates from the starting node to the end nodeIs a mixture of all paths.Is the longest pathIs the shortest path
The edge connectivity of an undirected graph is the minimum number k of edgesthat must be removed to disconnect the graph. For example, the edge connectivityof a tree is 1, and the edge connectivity of a cyclic chain of vertices is 2. Showhow to determine the edge connectivity of an undirected graph G D .V; E/ byrunning a maximum-flow algorithm on at most jV j flow networks, each havingO.V / vertices and O.E/ edges.
Suppose I have a directed graph whose edges have all positive weights. My graph is not a tree. I want to find the longest path from a starting node s to an ending node v. I can modify Bellman-Ford to solve this problem. True or False?
Describe, in plain English, an algorithm that given a weighted, directed, acyclic graph G=(V,E,w) (with integer weights) and a vertex s in V calculates the length of the longest path from s to every other vertex v (if a vertex is unreachable from s, then the length of the longest path for that vertex should be infinity). Your algorithm should run in O( |V| + |E| ) time in total, assuming that G is implemented with an adjacency list, as usual. Explain why your algorithm has this running time.[Hint: you might want to consider a new graph G', more or less similar to G, and reduce the problem for G to a problem for G' that we have solved in the lectures]
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.