Hex-Chaos Compositions and Equivalence Classes of Packing Problems
Year: 2018 Authors: Gary R. Greenfield
Core claim
Up to equivalence, there are exactly thirteen types of hex-chaos compositions.
Topics
generative art, cellular automata, genetic algorithm, packing problems, equivalence classes
Domains
elementary group theory, combinatorics, discrete structures, generative art, visualization, minimalist artworks
Methods
binary-to-hex mapping, 1 + 1 genetic algorithm, equivalence classification
Media
grid cells, hexadecimal labels, color ramp
Paper text
The text below is the locally extracted OCR/Markdown version of the paper. Raw PDF files remain local and are not published here.
Bridges 2018 Conference Proceedings
Hex-Chaos Compositions and Equivalence Classes of Packing Problems
Gary R. Greenfield
University of Richmond, Virginia, USA; ggreenfi@richmond.edu
Abstract
We consider a generative art scheme that uses zero-one labelings of the edges of all the cells of a grid and chaotic one-dimensional cellular automata to assign hexadecimal digits to the cells of the grid. This allows us to color all the cells by mapping hex digits to colors. We invoke a genetic algorithm to maximize the number of occurrences of two hex digits thereby evolving what we call hex-chaos compositions. Using elementary group theory we prove, up to equivalence, there are thirteen different types of hex-chaos compositions.
Introduction
Let denote the set of grids whose cells are labeled with hexadecimal digits. If , then . Each cell of a hex grid has four edges. Suppose the edges of all the cells are labelled using zeros and ones. Then a generic cell has top, left, bottom and right edge labels and . The horizontal edge labels determine an matrix , while the vertical edge labels determine an matrix . We say is a pullback if there exist and such that for all and , is equal to the conversion of the base two representation of the four digit binary number formed by concatenating the edge labels counterclockwise from the top to a hex digit i.e., equals the hex value of the decimal
In this case, we write . We denote the set of hex grids that are pullbacks by . Evidently, the way to construct pullbacks is to interleave matrices of zeros and ones of the appropriate dimensions and then use the binary to hex conversion formula to determine the hex labels.
EXAMPLE 1. Let , . Set
Then interleaving gives
Greenfield
and using the binary to hex conversion formula gives the pullback
| f | e | 3 | 5 | c |
|---|---|---|---|---|
| e | b | e | 1 | 5 |
| a | b | c | 0 | 3 |
| 9 | f | 6 | 2 | 9 |
For visualization purposes we assign a color ramp of sixteen shades of blue to the hex values 0 through . To add visual interest to the construction we choose two hex values 0 \leq x_{1} < x_{2} \leq f and recolor them so they stay stand out. If we choose and and assign them the colors brown and yellow respectively, we obtain the visualization for the of Example 1 shown in Figure 1.
Figure 1: A visualization of the hex labeled grid in Example 1 obtained by mapping 5 to brown, 9 to yellow and all other hex labels to shades of blue.
Adding Chaos
Following an idea first proposed by Cruz et al. [1], we now require the edge labels of our pullbacks to be the outputs of iterates of chaotic or eventually periodic one-dimensional cellular automata [3]. Thus, we let be an matrix with randomly generated zeros and ones and be an matrix of randomly generated zeros and ones. We assign one dimensional automata to the rows of and the columns of . We define and inductively by letting and be the matrices obtained by treating the rows of the matrix and the columns of the matrix as the inputs to the respective automata, yielding the rows of the matrix and the columns of the matrix as the outputs.
EXAMPLE 2. Let , . Choose Rule 30 for the rows and Rule 54 for the columns. Let
| H0= | 1 | 1 | 0 | 0 | 1 |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 1 | |
| 1 | 0 | 1 | 1 | 1 | |
| 1 | 1 | 0 | 0 | 1 | |
| 1 | 0 | 1 | 0 | 1 |
Then and are the matrices and that gave rise to the pullback grid of Example 1.
Hex-Chaos Compositions
Let , , and continue to use Rule 30 for rows and Rule 54 for columns. Towards the Cruz et al. goal of “harnessing chaos” we consider the following scheme for maximizing the number of occurrences of the two distinguished hex values and in the central region of a pullback hex grid. If is a pullback induced after 500 iterations starting from and (i.e., ), let be the number
Hex-Chaos Compositions and Equivalence Classes of Packing Problems
of occurrences of in , be the number of occurrences of in the centered subgrid of and . Then the fitness of is defined to be
This function preferences pullbacks where the number of ‘s and ‘s are nearly equal, rewards pullbacks where occurrences of and are within the central window and penalizes pullbacks where occurrences of and are outside the central window.
We invoke a so-called genetic algorithm by forming and from and by changing either one entry of , one entry of or one entry of both, and replacing by whenever . This implements simple hill climbing such that the rows and columns of and are, via indirect feedback, forced to cooperate to maximize fitness. We let the algorithm run for 25,000 generations. That is, we make 25,000 attempts to improve fitness. Further details about the motivation, algorithm design and choice of parameter settings can be found in Greenfield [2].
Figure 2 shows three examples of hex-chaos compositions evolved using our evolutionary algorithm. From a distance they may look quite similar, but up close each one presents a different visual challenge to the viewer. Namely, what are the rules for the two distinguished colors? For example, for browns and yellows one finds: browns can be vertically or horizontally adjacent to each other, yellows cannot, and if brown and yellow are ever horizontally (respectively, vertically) adjacent then yellow must be on the left (respectively, on top). We leave it to the reader to infer the adjacency rules for the other two examples.
Packing Problems
Since we are trying to pack approximately an equal number of ‘s and ‘s into the central window, this raises the question of how many occurrences of and one can pack into an pullback in general. Of course to consider such a question we will have to drop the assumption that the pullback is an iterate. Thus we wish to consider the problem of determining
where, for and , equals the number of occurrences of in . This is a challenging problem. We offer the following examples whose proofs appear in Greenfield [2].
THEOREM 3. Let , . Then equals if is even and is odd, and otherwise.
THEOREM 4. Let , . Then
The proofs construct ‘s for which . If we let
and define
this leads to the conjecture
Greenfield
Figure 2: Hex-chaos compositions. Top: (green), (brown). Middle: (brown), (yellow). Bottom: (brown), (black).
Hex-Chaos Compositions and Equivalence Classes of Packing Problems
CONJECTURE A.
Equivalently, if we denote the set of attained maximums by
we have
CONJECTURE B.
Packing Problem Equivalences
For fixed and , using the convention 0 \leq x_{1} < x_{2} \leq f, ostensibly there are 120 packing problems to consider. Our goal is to prove that there are really only thirteen such problems and thus, up to the equivalence relation defined below, only thirteen different kinds of hex-chaos compositions.
If is matrix of zeros and ones we define its complement to be where is the matrix all of whose entries are ones. Complements establish four bijections of with itself, corresponding to the identity, complementing the row edges, complementing the column edges, and complementing both the row and column edges. That is,
These bijections induced hex label permutations that are wholly determined by what happens to the edges of a “generic” cell. At this juncture it is convenient to change notation and use edge labels that reflect the ordering used for binary to hex conversion. We have
whence running through the sixteen possibilities for the base two representation of as establishes with as
and, similarly, we obtain
If is a matrix we define the reflection of about the vertical axis to be the matrix where , and the reflection of about the horizontal axis to be the matrix where . These operations together with the matrix transpose operation where ) allow us to mimic the action of the dihedral group of order eight on an
249
pullback. We realize this group as four clockwise rotations of 0(90), 1(90), 2(90), and 3(90) degrees plus four reflections , , and about the horizontal, vertical, diagonal, and antidiagonal axes. We define
The four bijections that involve transposes map pullbacks to pullbacks. We let denote the induced hex label permutation for . We know is the identity permutation. To determine the other induced permutations, we again use our generic cell mapping notation, but now we must recognize that the cell containing hex label is being moved before it is relabeled. If we write for so the notation is consistent, then we can track label movement by making appropriate index calculations. For example, tells us that the label in cell will be moved to cell and relabeled according to the permutation shown below. Because we know we are recovering the dihedral group, we only calculate and :
[ \left[\begin{array}[]{cccc}&e_{1}&\ e_{2}&x&e_{4}\ &&e_{3}\end{array}\right]\longrightarrow\left[\begin{array}[]{cccc}&e_{2}&\ e_{3}&\pi_{1}(x)&e_{1}\ &&e_{4}\end{array}\right],\left[\begin{array}[]{cccc}&e_{1}&\ e_{4}&\pi_{v}(x)&e_{2}\ &&e_{3}\end{array}\right] ]
gives
=\left(\begin{array}[]{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{c}&0&1&2&3&4&5&6&7&8&9&a&b&c&d&e&f\\ 0&2&4&6&8&a&c&e&1&3&5&7&9&b&d&f\end{array}\right), =\left(\begin{array}[]{cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc}{c}&0&1&2&3&4&5&6&7&8&9&a&b&c&d&e&f\\ 0&4&2&6&1&5&3&7&8&c&a&e&9&d&b&f\end{array}\right).
Writing the non-identity permutations as products of disjoint cycles provides
The permutations and generate a subgroup of isomorphic to the Klein four group using the familiar relations
Hex-Chaos Compositions and Equivalence Classes of Packing Problems
while the permutations and generate a subgroup of isomorphic to the dihedral group of order eight using the familiar relations
(Note that , and .) However, the subgroup of of order thirty two that these four permutations generate is not an internal direct product of the subgroup < \pi_1,\pi_v> of order eight with the subgroup < \psi_R,\psi_C> of order four because even though
we also have
To organize the calculation of equivalence classes of packing problems, we use a table showing how each of the thirty two permutations in
< \pi_ {1}, \pi_ {v}, \psi_ {R}, \psi_ {C} > = \left\{\pi_ {1} ^ {i} \pi_ {v} ^ {i} \psi_ {R} ^ {k} \psi_ {C} ^ {\ell}: 0 \leq i \leq 3, 0 \leq j, k, \ell \leq 1 \right\}acts on an instance — by letting the permutation act on each entry — in such a way that the first four columns show equivalences and the last four show equivalences. An example illustrates how this works.
| (0,1) | π0 | π2 | πh | πv | π1 | π3 | πd | πa |
|---|---|---|---|---|---|---|---|---|
| ψI | (0,1) | (0,4) | (0,1) | (0,4) | (0,2) | (0,8) | (0,2) | (0,8) |
| ψR | (a,b) | (a,e) | (a,b) | (a,e) | (5,7) | (5,d) | (5,7) | (5,d) |
| ψC | (5,4) | (5,1) | (5,4) | (5,1) | (a,8) | (a,2) | (a,8) | (a,2) |
| ψB | (f,e) | (f,b) | (f,e) | (f,b) | (f,d) | (f,7) | (f,d) | (f,7) |
Even though for the purpose of equivalence the pairs should show the smaller value first, the ordering of the pairs in the table is useful. For example the in the row and column tells us that the mapping from to which takes to will relocate all the 0’s and 1’s while simultaneously relabeling them as ‘s and 7’s, respectively, because and . This, in turn, tells us or equivalently, if we can solve the packing problem for all problem instances then we can solve the packing problem for all problem instances. Thus, if we denote the equivalence class of packing problems for by , then the table reveals
Space prohibits showing the calculations for all thirteen equivalence classes. Instead, we show that the equivalence classes are not all the same size by providing
| (1,4) | π0 | π2 | πh | πv | π1 | π3 | πd | πa |
|---|---|---|---|---|---|---|---|---|
| ψI | (1,4) | (4,1) | (1,4) | (4,1) | (2,8) | (8,2) | (2,8) | (8,2) |
| ψR | (b,e) | (e,b) | (b,e) | (e,b) | (7,d) | (d,7) | (7,d) | (d,7) |
| ψC | (4,1) | (1,4) | (4,1) | (1,4) | (8,2) | (2,8) | (8,2) | (2,8) |
| ψB | (e,b) | (b,e) | (e,b) | (b,e) | (d,7) | (7,d) | (d,7) | (7,d) |
which yields
Greenfield
and
| (3,c) | π0 | π2 | πh | πv | π1 | π3 | πd | πa |
|---|---|---|---|---|---|---|---|---|
| ψI | (3,c) | (c,3) | (9,6) | (6,9) | (6,9) | (9,6) | (3,c) | (c,3) |
| ψR | (9,6) | (6,9) | (3,c) | (c,3) | (3,c) | (c,3) | (6,9) | (9,6) |
| ψC | (6,9) | (9,6) | (c,3) | (3,c) | (c,3) | (3,c) | (9,6) | (6,9) |
| ψB | (c,3) | (3,c) | (6,9) | (9,6) | (9,6) | (6,9) | (c,3) | (3,c) |
which gives
Table 1 lists the thirteen equivalence classes and their cardinalities. The choice of representative is lexicographical and classes are ordered lexicographically. With reference to Figure 2, we note that (2,5) belongs to , (5,9) belongs to and belongs to . With reference to Theorem 3, belongs to .
Table 1: Equivalence Classes of Hex-Chaos Compositions.
| equivalence class | cardinality |
|---|---|
| [(0,1)] | 16 |
| [(0,3)] | 16 |
| [(0,5)] | 4 |
| [(0,7)] | 16 |
| [(0,f)] | 2 |
| [(1,2)] | 16 |
| [(1,3)] | 16 |
| [(1,4)] | 4 |
| [(1,6)] | 16 |
| [(1,b)] | 4 |
| [(1,e)] | 4 |
| [(3,6)] | 4 |
| [(3,c)] | 2 |
Summary and Conclusions
We have described a generative art scheme incorporating chaotic one-dimensional cellular automata and hex labelings of the cells of a grid in order to evolve minimalist artworks called hex-chaos compositions. We then showed how this led to a suite of 120 packing problems which, thanks to some elementary group theory, could be organized into thirteen equivalence classes, thereby revealing there were exactly thirteen different types of hex-chaos compositions and presenting us with thirteen challenging packing problems to solve. To date we have solved seven of these problems.
References
[1] C. Cruz, M. Kirley, and J. Karakiewicz. “Generation and exploration of architectural form using a composite cellular automata.” Third Australasian Conference, ACALCI 2017, Geelong VIC, Australia, January 31 - February 2, 2017, Proceedings, M. Wagner et al. (eds.), LNAI 10142, Springer International Publishing, Cham, Switzerland, 2017, pp. 99-110. [2] G. Greenfield. “Interleaved cellular automata, evolved art and packing problems.” 2018 IEEE CEC Conference Proceedings, to appear. [3] S. Wolfram. “Universality and complexity in cellular automata.” Phys. D Nonlinear Phenomena, vol. 10, no. 1, 1984, pp. 1-35.