Questions tagged [hamiltonian-path]
24 questions
0
votes
0 answers
Hamiltonian Path in a simple DAG
I am trying to implement a recursive search for a Hamiltonian Path in a simple DAG. Here's my toy data and code:
DAG in edge-list format
4 5
1 2
3 1
3 2
4 3
4 2
DAG in dictionary format after converting
{1: [2], 3: [1, 2], 4: [3, 2]}
Code: G is…

nosense
- 180
- 1
- 6
- 16
0
votes
1 answer
Show np-completeness of Disjoint Hamiltonian Path
Consider the problem of Disjoint Hamiltonian Path:
Input: A graph which may be directed or undirected
Output: Does this graph exist at least 2 Hamiltonian Paths that are edge-disjoint?
Edge-disjoint means that no single edge is shared by two…

Falanke
- 69
- 5
0
votes
0 answers
Recommend a good heuristic for longest Hamiltonian path in polynomial time
I have a complete weighted graph with 1000 nodes and need to find the longest possible Hamiltonian path in the graph (the sequence of nodes, to be more precise). I am supposed to fit in 5 sec (for Java), the memory limit is big enough.
Finding the…

Rnam
- 65
- 1
- 7
0
votes
1 answer
Which of the following problems can be reduced to the Hamiltonian path problem?
I'm taking the Algorithms: Design and Analysis II class, one of the questions asks:
Assume that P ≠ NP. Consider undirected graphs with nonnegative edge
lengths. Which of the following problems can be solved in polynomial
time?
Hint: The…

Abhijit Sarkar
- 21,927
- 20
- 110
- 219
0
votes
1 answer
Hamiltonian path- can I cover an edge twice when every vertex can be covered only once?
From this question- Difference between hamiltonian path and euler path, every Hamiltonian path is not a Euler path. How can I cover every vertex exactly once and cross an edge twice?

leo valdez
- 259
- 1
- 15
0
votes
0 answers
Hamiltonian path functional way
I am trying to work on a problem which gives me a hamiltonian path in a graph. I am aware of the algorithms used for it but they're all suited for imperative style. My confusion is if I have to use dynamic programming in scala to solve the problem…

Harsh Gupta
- 339
- 4
- 20
-1
votes
1 answer
Finding Hamiltonian path and Hamiltonian cycle
I have a SimpleGraph in JGraphT and want to know if there is
a Hamiltonian path
a Hamiltonian cycle
And if one exists I'd also like to get it.
I only found TwoApproxMetricTSP and HamiltonianCycle.
But both require complete graphs.
One obvious…

Jens Schauder
- 77,657
- 34
- 181
- 348
-2
votes
1 answer
On example where no Hamilton path is possible to make Hamilton cycle
https://www.youtube.com/watch?v=3xeYcRYccro&list=PLoJC20gNfC2gmT_5WgwYwGMvgCjYVsIQg&index=32
12:10 states that that example is a Hamilton path. This is an example to shew that a Hamilton path cannot make a Hamilton graph. Indeed all verteces are…

Versteher
- 23
- 5
-3
votes
1 answer
Possible solution to find a Hamiltonian path in polynomial time
I was thinking recently about a possible solution to find, in polynomial time, whether an undirected graph has a Hamiltonian path or not.
The main concept used as part of this implementation is based on an observation that I noticed while
trying to…

George Cionca
- 3
- 1
- 3