aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/h48.md5
-rw-r--r--doc/nasty-symmetries.md93
2 files changed, 95 insertions, 3 deletions
diff --git a/doc/h48.md b/doc/h48.md
index 678e160..681d092 100644
--- a/doc/h48.md
+++ b/doc/h48.md
@@ -120,9 +120,8 @@ of consequences:
120 harmless. 120 harmless.
121* When combining symmetry-reduced coordinates with other coordinates, 121* When combining symmetry-reduced coordinates with other coordinates,
122 one has to be extra careful with handling self-symmetric coordinates. 122 one has to be extra careful with handling self-symmetric coordinates.
123 This is a much more painful point, but a precise description of 123 An informal explanation of this phenomenon can be found in
124 the adjustments needed to handle these cases is out of the scope 124 the [docs/nasty-symmetries.md document](./nasty-symmetries.md).
125 of this document.
126 125
127## The H48 solver 126## The H48 solver
128 127
diff --git a/doc/nasty-symmetries.md b/doc/nasty-symmetries.md
new file mode 100644
index 0000000..a7b300e
--- /dev/null
+++ b/doc/nasty-symmetries.md
@@ -0,0 +1,93 @@
1*The explanation below is an informal description of the issues that arise
2in generating a pruning table when working with a complex cube coordinate
3that has a symmetric component. It is an excerpt of an email exchange
4between me and [Arhan Chaudhary](https://github.com/ArhanChaudhary).*
5
6Let's say we are working with what I call a
7*symmetric-composite coordinate* in my
8[cube coordinate page](https://sebastiano.tronto.net/speedcubing/coordinates).
9So you have one coordinate that is reduced by symmetry composed with
10one that is not. As an example:
11
12* The symmetry-reduced coordinate is "corners", a coordinate that
13 determines the orientation and permutation of corners, reduced by
14 symmetry. Before reducing it by symmetry it would be a number
15 0 <= x < 8! * 3^7, after applying symmetry that number is between 0
16 and ~(8! * 3^7)/48 (because here are 48 possible symmetries).
17* The other coordinate is "edges", given by a number between 0 and
18 12! * 2^11. This coordinate is NOT reduce by symmetry.
19
20This is obviously a very large coordinate, not usable in practice,
21but it is easy to explain.
22
23Computing the value of this combined coordinate is done like this
24(it is also explained in the paged I linked above):
25
261. Compute the coordinate value c of "corners".
272. Find the cube transformation that brings the corner position to the
28 representative of its symmetry class.
293. Transform the cube by the transformation found in step 2.
304. Compute the value e of "edges" of the transformed cube.
315. Compute c * (12! * 2^11) + e (the number we multiply by is the
32 maximum value of "edges" +1).
33
34(Some of the information we need, like which one is the representative
35of a symmetry class or whic transformation leads to a representative,
36is pre-computed).
37
38Now let's consider a position that is symmetrical as far as corners
39are concerned, but not symmetrical (or less symmetrical) as far as
40edges are concerned:
41
42* The corners are all solved;
43* The edges are off by an H-perm on the top layer (UF swapped with UB and
44 UR swapped with UL).
45
46We'll call this position P1. This P1 is equivalent to a position P2
47that has corners all solved and an H-perm on the bottom, but these two
48positions DO NOT have the same value according to the coordinate we
49defined: in step 3 above, in both case the transformation is going to
50be trivial (i.e. no transformation is performed), because there is only
51one element in the symmetry class of this corner position, the solved
52position; this must also be the representative. This leads in one case
53to use the value of e coming from "H-perm on top" and in the other case
54that coming from "H-perm on the bottom".
55
56The problem we have now is this: will the pruning table values for
57P1 and P2 be initialized correctly? Let's say that there is only one
58shortest path from the solved cube to P1, and it ends with the move U,
59and let's call Q1 the position before this last U. (In reality this can't
60be the case, because then also U' would work, but this is not going to
61break our reasoning here.) Similarly, let's call Q2 the position before
62the last D move in the shortest path from solved to P2 (by symmetry,
63the last move must be D, like it was U for P1).
64
65Q1 and Q2 are of course equivalent, in the same sense that P1 and P2
66were. But more than that, they actually have the same coordinate value,
67unlike P1 and P2! This is because their edge position is "less symmetric":
68the "transformation to representative" of step 2 above must bring each
69of Q1 and Q2 with the turned side (U or D respectively) to the same side.
70
71This means that when we scan the list of positions at distance N
72(the distance of Q1/Q2 to solved) to fill the positions at distance
73N+1 (such as P1/P2), this position Q1/Q2 is reached only once; and
74we apply the move U (or equivalent) to it only once. Therefore, we
75cannot reach both P1 and P2 with this strategy! As I explain
76[here](https://sebastiano.tronto.net/speedcubing/coordinates/#pruning-tables):
77we'll have to add an extra step to fill in correctly the positions like
78P1 and P2.
79
80In the previous paragraph I am assuming that we are filling the pruning
81table in a specific way, i.e. "scanning the list of position at distance N
82to fill the positions at distance N+1". This not the only techniques for
83filling a pruning table, but I hope it is clear that any other technique
84that takes advantage of symmetry (by considering Q1 and Q2 as the same)
85is going to lead to the same problem with P1 and P2.
86
87Trying to summarize all of the above:
88
89* When using the "symmetric-composed coordinates" technique, there are
90 positions that are technically equivalent but have distinct values.
91* When we fill the pruning table, we may reach these positions from
92 positions that do not have this characteristic. This is going to "hide"
93 some equivalent positions that have distinct values.

Generated with cgit - Back to sebastiano.tronto.net