Questions on Hamiltonian paths, that is, paths that visit each vertex exactly once in a graph.
Questions tagged [hamiltonian-path]
95 questions
9
votes
0 answers
How can the shortest traveling salesman tour be found in $O(2^n poly(n))$ time and less than exponential space?
I'm stuck on problem 9.4 from The Nature of Computation which reads:
Dynamic Salesman. A naive search algorithm for TSP takes $O(n!)$ time to check all tours. Use dynamic programming to reduce this to a simple exponential, i.e., to solve TSP in…
Sebastian Oberhoff
- 1,058
- 5
- 11
8
votes
3 answers
Constructing a random Hamiltonian Cycle (Secret Santa)
I was programming a little Secret Santa tool for my extended family's gift exchange. We had a few constraints:
No recipients within the immediate family
Nobody should get who they got last year
The whole thing should be a cycle (Sandy gives to…
Mark Peters
- 193
- 7
7
votes
2 answers
What TSP variant doesn't return to start point?
For my case I have starting point and several cities.
I want the shortest route to visit all cities without returning starting point.
I have read several TSP algorithm and all include the return a full cycle.
So what TSP variation should I look for…
Juan Carlos Oropeza
- 171
- 1
- 1
- 3
6
votes
0 answers
Upper bound on the number of hamiltonian cycles on a $n \times n $ grid graph
What is the best upper bound that is known for the number of hamiltonian cycles on a $n \times n $ grid graph?
I did some searching and found that the number of hamiltonian cycles on a planar graph with $n$ vertices is $O(\sqrt[4]{30}^n)$ where $n$…
Gaganpreet
- 161
- 4
6
votes
2 answers
Greedy and backtracking solutions to an arrangement problem with constraints
I'm revising for my finals. I have found a pattern in past papers in terms of a recurring question, reworded coming up every year. But I've no idea what the marker actually wants... I've asked class mates but they all seemed to be confused. One gave…
user26288
- 79
- 1
- 3
6
votes
3 answers
Proof that Hamiltonian cycle/circuit with a specified edge is NP-complete
I'm a little stuck on this question, any help would be appreciated!
Given that the Hamiltonian Path (HP) and the Hamiltonian Circuit/Cycles (HC) problems are known to be NP-complete, show that HCE is NP-complete.
HCE: Given an undirected graph G and…
Lawliet
- 71
- 1
- 5
6
votes
2 answers
Find a simple path visiting all marked vertices
Let $G = (V, E)$ be a connected graph and let $M\subseteq V$. We say that a vertex $v$ is marked if $v\in M$. The problem is to find a simple path in $G$ that visits the maximum possible number of marked vertices. The associated decision problem…
Mark Dominus
- 1,567
- 14
- 22
5
votes
3 answers
Rearranging strings so that the Hamming distance between them is 1
This is a question from CodeFights.com:
Given an array of equal-length strings, check if it is possible to rearrange the strings in such a way that after the rearrangement the strings at consecutive positions would differ by exactly one…
Ron Inbar
- 163
- 6
5
votes
3 answers
How to generate graphs with a Hamiltonian path?
I need to create a graph generator for my next project. Generally algorithms are trying to find a Hamiltonian path in a graph. So I can create a graph generator, generate a graph, and then I can decide whether the graph has a Hamiltonian path or…
Always Newbie
- 153
- 4
5
votes
3 answers
Find hamilton cycle in a directed graph reduced to sat problem
I need to find a Hamiltonian cycle in a directed graph using propositional logic, and to solve it by sat solver. So after I couldn't find a working solution, I found a paper that describes how to construct a CNF formula to find an Hamiltonian…
Dor Cohen
- 53
- 1
- 5
5
votes
1 answer
Does the Bondy-Chvátal theorem have algorithmic applications beyond Ore's theorem?
I'm toying around with graph properties and I want to make some effort to check whether a given graph is Hamiltonian. I understand that the general problem is NP-complete, but I'm looking for simple checks that are easy to implement and…
Fasermaler
- 242
- 2
- 6
5
votes
1 answer
Hamiltonian circuit for a family of graphs
For $\Sigma = \{a,b\}$, let $S_n = \{w\mid w \in \Sigma^{*} \land |w| = n\}$.
Let $C_n \subset \Sigma^{*}$ be the language of circular strings that contain as substrings all elements of $S_n$.
For instance, $bbaaaababaabbbba \in C_4$
I have…
André Souza Lemos
- 3,296
- 1
- 16
- 30
5
votes
1 answer
Easy infinite subclass of cubic graphs for Hamiltonian cycle problem
I know that Hamiltonian cycle problem is $NP$-complete for 2-connected planar bipartite cubic graphs.
I'm interested in non-trivial infinite subclass of cubic graphs where the Hamiltonian cycle (path) problem is efficiently solvable. I tried the…
Mohammad Al-Turkistany
- 4,477
- 1
- 28
- 37
5
votes
1 answer
Is Hamiltonian path NP-hard on graphs of diameter 2?
Let $G$ be a graph of diameter 2 ($\forall u,v\in V: d(u,v)\leq2$).
Can we decide if $G$ has Hamiltonian path in poly time? What about digraphs?
Perhaps some motivation is in place:
the question arises from Dirac's theorem which states that if…
R B
- 2,644
- 17
- 35
5
votes
1 answer
Why is Adleman's molecular algorithm for Hamiltonian Path linear?
In Adleman's 1994 paper (archived), he describes a method of manipulating DNA molecules in a lab that results in a solution to the Hamiltonian Path problem with high probability.
He claims that "The number of different oligonucleotides required…
idoby
- 151
- 4