3 ms·
A similar trick can be used to solve the following problem: considering a rectangular grid, is it possible to find a cycle that goes from adjacent squares to ad
by a3_nm 12y ago
A similar trick can be used to solve the following problem: considering a rectangular grid, is it possible to find a cycle that goes from adjacent squares to adjacent squares and visits each square exactly once?
Answer (ROT13):
Vg qrcraqf ba gur cnevgl bs gur ahzore bs fdhnerf, juvpu qrcraqf ba jurgure gur qvzrafvbaf bs gur tevq fvqrf ner obgu bqq be abg. Vs gur ahzore bs fdhnerf vf bqq, gurer nera'g nf znal juvgr fdhnerf nf oynpx fdhnerf, naq n plpyr zhfg tb sebz juvgr gb oynpx naq sebz oynpx gb juvgr, fb ab plpyr rkvfgf. Vs vg vf rira, lbh pna rnfvyl pbzr hc jvgu n trareny fpurzr gb pbafgehpg n plpyr.
- theoh 12y agoThis is called a Hamiltonian circuit.