In the context of Hamiltonian problems, which of the following are correct?
A. The Hamiltonian cycle problem is NP-complete.
B. If G is an undirected bipartite graph with an odd number of vertices, then G is Hamiltonian.
C. The Hamiltonian path problem cannot be solved in polynomial time on a directed acyclic graph.
D. If G is a connected undirected graph with at least three vertices, then G³ (the graph obtained by connecting all pairs of vertices joined by a path of length at most 3 in G) is Hamiltonian.
E. If any NP-complete problem is polynomial-time solvable, then P = NP.
Choose the most appropriate answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. A, D, E only
Explanation
A and E are standard results, and D is a known theorem (the cube of a connected graph is Hamiltonian). A bipartite graph with an odd number of vertices can never be Hamiltonian (B false). On a DAG a Hamiltonian path can be found in linear time via topological sort (C false).More Data Structures and Algorithms questions
- For matrix multiplication using the simple divide-and-conquer algorithm: A. The running time is T(n) = Θ(n³) B. The running time is T(n) =…
- Match List I with List IIList I List II A. Linear Program I. Prim's Algorithm B. Predicate Logic II. In order C. Tree Traversal III. Simple…
- Match List I with List IIList I List II A. 8-Queens problem I. Divide and conquer B. Closest pair of points II. Dynamic Programming C. Stri…
- Arrange the following search and sort algorithms in ascending order of their worst-case complexities: A. Merge sort B. Linear search C. Bub…
- Find the optimal solution of the fractional knapsack problem when the maximum capacity is 15.
- What is the maximum value of the items you can carry if the maximum weight allowed is 25 (fractional knapsack)?