Question: Write a program that, given a list of the edges in a connected graph G on the vertices 1,..., n, in polynomial time outputs
Write a program that, given a list of the edges in a connected graph G on the vertices 1,..., n, in polynomial time outputs a Boolean formula F that is satisfiable if and only if G has a Hamiltonian path. You can assume the list of edges looks something like (1, 2) (1, 3) (4, 2) (6, 5) (5, 3) with one pair per line, and your output should consist of a single line containing copies of space, (, ), AND, OR, NOT and variables that look something like x1, x2, etc.
Step by Step Solution
There are 3 Steps involved in it
Creating a Boolean formula that checks for the existence of a Hamiltonian path in a graph is a compl... View full answer
Get step-by-step solutions from verified subject matter experts
