Hamiltonian path generator

About: This javascript program generates a Hamiltonian path on an n × n grid using the backbiting move described in the paper "Secondary structures in long compact polymers" by Richard Oberdorf, Allison Ferguson, Jesper L. Jacobsen and Jané Kondev, Phys. Rev. E 74, 051801 (2006). Paper available via the APS (subscription required) or as a pre-print on the arxiv.
Author: Program by Nathan Clisby, July 2012. Please let me know if you find this generator useful, or if you have any suggestions for improvement! (homepage, clisby@gmail.com)
Output modified by E. Emberly, Sept. 2014.
Usage: Specify desired grid size and choose `quality factor' which determines how `random' the path will be, then click "Generate Hamiltonian path" or reload page. Quality factor of 1.0 should be fine for most purposes; for large grids it may be worth trying 0.5 or even 0.1.

Attempted paths:       Grid size:       Quality factor: