diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-13 08:45:20 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-06-13 08:45:20 +0200 |
| commit | 8ac3998636180a79a2a5cf494f143cf79e1eae4e (patch) | |
| tree | d9c35cd8df85945488e31bb40c34e4975d42feb5 /doc | |
| parent | 7c6ec4625886dc8210b84e5a7597b653261a3115 (diff) | |
| download | nissy-core-8ac3998636180a79a2a5cf494f143cf79e1eae4e.tar.gz nissy-core-8ac3998636180a79a2a5cf494f143cf79e1eae4e.zip | |
Added documentation about symmetry issues with pruning tables
Diffstat (limited to '')
| -rw-r--r-- | doc/h48.md | 5 | ||||
| -rw-r--r-- | doc/nasty-symmetries.md | 93 |
2 files changed, 95 insertions, 3 deletions
| @@ -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 | ||
| 2 | in generating a pruning table when working with a complex cube coordinate | ||
| 3 | that has a symmetric component. It is an excerpt of an email exchange | ||
| 4 | between me and [Arhan Chaudhary](https://github.com/ArhanChaudhary).* | ||
| 5 | |||
| 6 | Let'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). | ||
| 9 | So you have one coordinate that is reduced by symmetry composed with | ||
| 10 | one 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 | |||
| 20 | This is obviously a very large coordinate, not usable in practice, | ||
| 21 | but it is easy to explain. | ||
| 22 | |||
| 23 | Computing the value of this combined coordinate is done like this | ||
| 24 | (it is also explained in the paged I linked above): | ||
| 25 | |||
| 26 | 1. Compute the coordinate value c of "corners". | ||
| 27 | 2. Find the cube transformation that brings the corner position to the | ||
| 28 | representative of its symmetry class. | ||
| 29 | 3. Transform the cube by the transformation found in step 2. | ||
| 30 | 4. Compute the value e of "edges" of the transformed cube. | ||
| 31 | 5. 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 | ||
| 35 | of a symmetry class or whic transformation leads to a representative, | ||
| 36 | is pre-computed). | ||
| 37 | |||
| 38 | Now let's consider a position that is symmetrical as far as corners | ||
| 39 | are concerned, but not symmetrical (or less symmetrical) as far as | ||
| 40 | edges 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 | |||
| 46 | We'll call this position P1. This P1 is equivalent to a position P2 | ||
| 47 | that has corners all solved and an H-perm on the bottom, but these two | ||
| 48 | positions DO NOT have the same value according to the coordinate we | ||
| 49 | defined: in step 3 above, in both case the transformation is going to | ||
| 50 | be trivial (i.e. no transformation is performed), because there is only | ||
| 51 | one element in the symmetry class of this corner position, the solved | ||
| 52 | position; this must also be the representative. This leads in one case | ||
| 53 | to use the value of e coming from "H-perm on top" and in the other case | ||
| 54 | that coming from "H-perm on the bottom". | ||
| 55 | |||
| 56 | The problem we have now is this: will the pruning table values for | ||
| 57 | P1 and P2 be initialized correctly? Let's say that there is only one | ||
| 58 | shortest path from the solved cube to P1, and it ends with the move U, | ||
| 59 | and let's call Q1 the position before this last U. (In reality this can't | ||
| 60 | be the case, because then also U' would work, but this is not going to | ||
| 61 | break our reasoning here.) Similarly, let's call Q2 the position before | ||
| 62 | the last D move in the shortest path from solved to P2 (by symmetry, | ||
| 63 | the last move must be D, like it was U for P1). | ||
| 64 | |||
| 65 | Q1 and Q2 are of course equivalent, in the same sense that P1 and P2 | ||
| 66 | were. But more than that, they actually have the same coordinate value, | ||
| 67 | unlike P1 and P2! This is because their edge position is "less symmetric": | ||
| 68 | the "transformation to representative" of step 2 above must bring each | ||
| 69 | of Q1 and Q2 with the turned side (U or D respectively) to the same side. | ||
| 70 | |||
| 71 | This 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 | ||
| 73 | N+1 (such as P1/P2), this position Q1/Q2 is reached only once; and | ||
| 74 | we apply the move U (or equivalent) to it only once. Therefore, we | ||
| 75 | cannot reach both P1 and P2 with this strategy! As I explain | ||
| 76 | [here](https://sebastiano.tronto.net/speedcubing/coordinates/#pruning-tables): | ||
| 77 | we'll have to add an extra step to fill in correctly the positions like | ||
| 78 | P1 and P2. | ||
| 79 | |||
| 80 | In the previous paragraph I am assuming that we are filling the pruning | ||
| 81 | table in a specific way, i.e. "scanning the list of position at distance N | ||
| 82 | to fill the positions at distance N+1". This not the only techniques for | ||
| 83 | filling a pruning table, but I hope it is clear that any other technique | ||
| 84 | that takes advantage of symmetry (by considering Q1 and Q2 as the same) | ||
| 85 | is going to lead to the same problem with P1 and P2. | ||
| 86 | |||
| 87 | Trying 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. | ||
