Monday, June 20, 2022

[gwyhglin] permutation group maze

(say) 6 items in a row.  touch the space between adjacent items to swap them.  goal is to put the items in their "correct" order.  this is how bubble sort works, so it is always possible: isomorphic to the symmetric group.  6 items = 720 states (6!).

run a maze generation algorithm on the graph of states.  items in a row as before.  this time, the space between adjacent items has an indicator indicating whether that pair may currently be swapped.  (previously, push button maze.)  better is for the indicator to provide lookahead: if swapped, illustrate what further swaps will be possible in the next step.  720 states is probably the maximum a human can mentally keep track of, because he or she does not get an overhead view of all points (states) of the maze.  or, 5 items, 120 states.

illustrate items being in the right or wrong spots in memorable ways.

instead of 6 items in a row, let them be laid out in a connected graph.  select an edge to swap.  illustrating lookahead and memorably illustrating states seems more challenging.  maybe 6 kings and 6 kingdoms: things not only go wrong in a kingdom with the wrong king on a throne, but the troubles cascade throughout the realm.

vaguely similar: Grow Cube, but any permutation permitted.

back to 6 items in a row.  instead of swapping 2 adjacent items, consider cycling 3 consecutive items.  each set of 3 can be 3-cycled in two different directions.  this is isomorphic to the alternating group.  6 items, 360 states; 5 items, 60 states.  without any maze-like restrictions, it is easy (as confirmed by experiment) to correctly order to any start permutation with the correct parity.  one can use an algorithm similar to bubble sort.

as before, run a maze-generating algorithm on the underlying graph of states.

for a point-and-click UI, on-screen buttons corresponding to 3-cycling ABC and CDE can be on one side of the row of items, and BCD and DEF can be on the other side of the row.  overlapping 3-cycles are therefore not geometrically a UI problem.  (4-cycles and beyond would be less elegant.)  each 3-cycle button is divided into two parts corresponding to the two possible 3-cycling directions.  or, could use two mouse buttons.

for a touchscreen UI, simply swipe the 3 items in a row that you wish to cycle.  however, once we add maze-like restrictions, indicating which operations are permitted will require annotations off to the side.

depicting lookahead seems challenging.

as before, we can also consider items laid out not in a row but in some planar graph.  probably best is as a map of regions.  the map has some line segments drawn on it, each line segment passing through exactly 3 regions, indicating which regions may be cycled.  we could also try to have all regions the same shape (even translationally congruent) to illustrate that all items can fit into any slot, but it becomes tricky to insure that straight line segments exist through the 3-cycles we wish to permit.

9 dots (9!/2 = 181440 states) in a 3 by 3 grid seems an attractive layout for many possible 3 cycles in straight lines, vaguely similar to pattern-unlock on Android smartphones.  also 8 dots (omit center), 7 dots (like capital H), 6 dots (right triangle), 5 dots (like capital L or T or X).  6, 7, and 9 dots permit diagonal 3-cycles through the center dot.

physical UI: map of regions.  at every junction of 3 regions meeting at a point (tri-point) is a knob which can be turned in two possible directions to execute a 3 cycle.  lights on the knob and haptic feedback can indicate whether an operation is permitted according to the underlying maze.  a tesselation of regular hexagons has three hexagons meeting at each point.

depicting lookahead seems even more challenging.  memorably depicting states remains desirable.

the 15-puzzle is isomorphic to the alternating group, though I don't know details.

beyond symmetric and alternating groups, we could consider permutation representations of other finite groups, though many are large.  they may be tricky enough not to need imposing a maze over them (e.g., Rubik's cube group).  among finite simple groups, the Mathieu groups seem promising.

No comments :