Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 472

Questions on Hamiltonian paths, that is, paths that visit each vertex exactly once in a graph.

6
votes
The simplest solution is the one suggested by Yuval Filmus. That is, take a simple path on $n$ vertices, and finish the construction after you have added some number of edges. Clearly, it is easy to e …
answered Dec 19 '15 by Juho
2
votes
The nearest neighbor method is often used as a heuristic for different problems. Sometimes the method gives an effective approximation algorithm as well. You could employ it here as well. Here's a ske …
answered Sep 18 '13 by Juho
3
votes
You can do slightly better on space by using reservoir sampling. The overall approach we take is the same as suggested by @jnalanko, and it only works well for small enough $n$. We generate each permu …
answered Dec 4 '14 by Juho