-
-
Notifications
You must be signed in to change notification settings - Fork 316
/
HamiltonianPath.xml
29 lines (25 loc) · 938 Bytes
/
HamiltonianPath.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<sequence values="BRWGU" origin="True">
<one symmetry="()">
<rule in="B/B/R" out="R/B/B"/>
<rule in="BBR" out="RBB"/>
</one>
<markov symmetry="(x)">
<one in="RBB" out="WWR"/>
<one in="R/B/B" out="W/W/R"/>
</markov>
<one in="BBB/BWB" out="***/*R*"/>
<markov>
<one in="UWW" out="UUU"/>
<sequence>
<one in="UWG" out="RBW"/>
<all in="U" out="W"/>
</sequence>
<one in="RBW" out="UWG"/>
</markov>
</sequence>
<!--
Starts with a fixed Hamiltonian path and applies transformations to it to generate other Hamiltonian paths (containing only one connectivity component).
For a simpler version that doesn't care about maintaining a single connectivity component see HamiltonianPaths.
Algorithm adapted from: https://aip.scitation.org/doi/10.1063/1.443937
Compare with an implementation in a conventional language: http://clisby.net/projects/hamiltonian_path/hamiltonian_path_v1.html
-->