The discussion revolves around finding a programmatic solution to a color-matching puzzle app, focusing on the mechanics of tile swapping to achieve a minimum-move solution. Participants explore various mathematical and algorithmic approaches to optimize the number of moves required to solve the puzzle, which involves immovable reference tiles and movable color tiles.
Discussion Character
Exploratory
Technical explanation
Mathematical reasoning
Debate/contested
Main Points Raised
One participant proposes establishing a systematic approach to identify the initial configuration of the tiles using their RGB values and suggests that the challenge lies in minimizing the number of moves.
Another participant suggests using polynomial fitting to predict the colors of the movable tiles based on the fixed reference points, indicating that least-squares fitting could be employed to find the best model.
There is a discussion about identifying cycles in the tile positions, where one participant explains that the problem can be viewed as a series of linked loops, with the efficiency of swaps varying based on the number of tiles involved in each cycle.
Some participants express uncertainty about the rarity of certain swap scenarios, such as cycles of two or three tiles, and the implications for the overall logic of the solution.
Questions arise regarding the rules of the game, specifically whether any two movable tiles can be swapped or if there are restrictions, leading to further exploration of sorting algorithms.
Areas of Agreement / Disagreement
Participants do not reach a consensus on the optimal approach to solving the puzzle, with multiple competing views on the methods to be used, including polynomial fitting, cycle identification, and sorting algorithms. The discussion remains unresolved regarding the specific rules of tile swapping and the implications for the solution strategy.
Contextual Notes
There are limitations regarding the assumptions about tile adjacency and the specific mechanics of the puzzle, which remain unclear. The discussion also highlights the potential complexity of the problem, with varying degrees of mathematical rigor applied by different participants.
My intuition tells me this is entirely academic. Any tile that is not in the correct place can become the head of a chain - whether it is a half-solved chain or a new unsolved chain (since they're closed loops).
So it does not help the solver to solve the puzzle. Just be sure you are always moving at least one unsolved tile into the correct place. Which is the obvious tactic anyway.
I agree (with my highlighted amendment). Chains don't help you solve the puzzle, they just prove the minimum number of swaps you need.
My intuition tells me this is entirely academic. Any tile that is not in the correct place can become the head of a chain - whether it is a half-solved chain or a new unsolved chain (since they're closed loops).
So it does not help the solver to solve the puzzle. Just be sure you are always moving at least one unsolved tile into the correct place. Which is the obvious tactic anyway.
I agree (with my highlighted amendment). Chains don't help you solve the puzzle, they just prove the minimum number of swaps you need.
If you have a bunch of items you need to rearrange and you know where they need to go then this is the optimal thing to do.
I am not sure about the terminology people are using here but if you want to rearrange objects to their correct locations (and you know what that is in advance) then you want to apply a permutation, which you can decompose into swaps of two elements, and the question is what is the minimum number of swaps needed. The answer is just the number of objects you have minus the number of cycles there are in the permutation you have to apply. (Objects that are already in the right place count as cycles of one element).
For example, let's say you have objects [B G F A E C H D] and they need to be put in order [A B C D E F G H]. This means you want to apply the permutation $$\sigma = \begin{pmatrix}
\mathrm{A} & \mathrm{B} &\mathrm{C} &\mathrm{D} &\mathrm{E} &\mathrm{F} &\mathrm{G} &\mathrm{H} \\ \mathrm{B} & \mathrm{G} &\mathrm{F} &\mathrm{A} &\mathrm{E} &\mathrm{C} &\mathrm{H} &\mathrm{D} \end{pmatrix}$$ (meaning A needs to go where B is, B needs to go where G is, C needs to go where F is, etc.). Like any permutation, this one can be decomposed into disjoint cycles; in this case $$\sigma = \begin{pmatrix} \mathrm{A} & \mathrm{B} & \mathrm{G} & \mathrm{H} & \mathrm{D} \end{pmatrix} \circ
\begin{pmatrix} \mathrm{C} & \mathrm{F} \end{pmatrix} \circ \begin{pmatrix} \mathrm{E} \end{pmatrix} \,,$$ i.e., there are three cycles with five, two, and one elements. Each cycle of ##n## elements can be done with ##n - 1## swaps, so we know that we can get all the objects in the right place with $$\text{number of elements} - \text{number of cycles} = 8 - 3 = 5$$ swaps. Furthermore, any swap that puts an object in the right final place will simply reduce the length of one of the cycles by one. For example, swapping G and H to put G in the right place just changes the first cycle to $$\begin{pmatrix} \mathrm{A} & \mathrm{B} & \mathrm{G} & \mathrm{H} & \mathrm{D} \end{pmatrix} \mapsto \begin{pmatrix} \mathrm{A} & \mathrm{B} & \mathrm{H} & \mathrm{D} \end{pmatrix} \circ \begin{pmatrix} \mathrm{G} \end{pmatrix} \,,$$ and subsequent swaps, regardless of the order in which they are done, as long as they are always putting one object in the right place, will progressively reduce the original permutation until the permutation left to apply is $$\begin{pmatrix} \mathrm{A} \end{pmatrix} \circ \begin{pmatrix} \mathrm{B} \end{pmatrix} \circ \begin{pmatrix} \mathrm{C} \end{pmatrix} \circ \begin{pmatrix} \mathrm{D} \end{pmatrix} \circ \begin{pmatrix} \mathrm{E} \end{pmatrix} \circ \begin{pmatrix} \mathrm{F} \end{pmatrix} \circ \begin{pmatrix} \mathrm{G} \end{pmatrix} \circ \begin{pmatrix} \mathrm{H} \end{pmatrix} \,,$$ i.e., nothing.
(Actually, the above also shows that swapping any objects in the same cycle will also work in the same number of steps, since this breaks a cycle at each step. E.g., if we swapped A and G in the original list, which doesn't put either object in the right place, it would still break the first cycle into $$\begin{pmatrix} \mathrm{A} & \mathrm{B} & \mathrm{G} & \mathrm{H} & \mathrm{D} \end{pmatrix} \mapsto \begin{pmatrix} \mathrm{A} & \mathrm{B} \end{pmatrix} \circ \begin{pmatrix} \mathrm{D} & \mathrm{G} & \mathrm{H} \end{pmatrix} \,.$$ But this isn't very useful since its the objects that are adjacent to each other in a cycle that are the easiest to determine share a cycle.)
CL-USER> (rearrange #(b g f a e c h d)
#(a b c d e f g h))
#(B G F A E C H D)
=> #(A G F B E C H D)
=> #(A B F G E C H D)
=> #(A B C G E F H D)
=> #(A B C D E F H G)
=> #(A B C D E F G H)
5
Furthermore, any swap that puts an object in the right final place will simply reduce the length of one of the cycles by one.
A swap between cycles is then precluded because it cannot put any object in the correct place.
It also reduces the economy by joining the two cycles, making one cycle.
Interesting. I am playing around with ore or reflected light microscopy and the colours of ores in reflected light are often very faint and, as in this game, the appearance depends on the surrounding material. However, apparently, as with sound, there seem to exist people who have kind of an "absolute" colour vision, like persons having an absolute pitch.
#36
Bruzote
25
13
DaveC426913 said:
Yah, it's a straight sort. The trickiness lies in the fact that the only criteria is colour, and the colour gradients get more and more subtle.
It is confounded by contextual perception - eg. a yellow tile will look peach or green depending on context. And you have no way to compare them before committing to a swap.
This is SO unfair to people with color-deficient vision. :-b Well, I suppose I can at least be grateful for having vision. And a computer and a safe home to use it. And...
#37
DaveC426913
Gold Member
2025 Award
24,563
8,907
Bruzote said:
This is SO unfair to people with color-deficient vision. :-b
It is! SO unfair.
This app I downloaded for free for my own amusement should be grey-scale only, to accommodate those with colour deficiencies.
Likewise, football and other sports are SO unfair for those of us with 50-something dad-bods. To be more fair, they should make the games less about athleticism and more about cerebral agility.
:-b
#38
DaveC426913
Gold Member
2025 Award
24,563
8,907
So, one wants to be careful what one asks for.
The game developers have released a version 2 of I Love Hue (Too)!
This version provides a 'minimum possible moves' stat for every game.
Which is great - exactly what I wanted.
Except what's happened is it's just raised the bar for me. Rather than setting my personal bar at 'beating the average' it's now 'hitting the minimum possible moves'. Which is harder.
This game is designed to be Zen-calming, but it just gets more stressful.