Polyhedron and Polychoron Codes for Describing Atomic Arrangements

The arrangement of atoms can be represented as a tiling of Voronoi polyhedra by using the Voronoi tessellation. We can know how an atom is surrounded by its ﬁ rst nearest neighbour atoms by knowing the shape of the Voronoi polyhedron associated with that atom. Furthermore, by knowing how a Voronoi polyhedron is surrounded by other Voronoi polyhedra, we can know how an atom is surrounded by its ﬁ rst nearest neighbours, second nearest neighbours, third nearest neighbours, … . However, there existed no methods for describing the arrangements of polyhedra, or atomic arrangements. To overcome this problem, we have recently created the polyhedron and polychoron codes [Sci. Rep. 6, 23455, Sci. Rep. 7, 40269, and Bull. Soc. Sci. Form 32, 1 (2017)]. In this chapter, we review the methods.


Introduction
Since the properties of materials depend on how atoms are arranged [1,2], understanding the arrangement of atoms is essential for studying the material properties. When we perform molecular dynamics or Monte Carlo simulations, we obtain the xyz coordinates of all the atoms. However, knowing all the atomic coordinates does not mean understanding the atomic arrangements. To understand the atomic arrangements, the essence should be extracted from the raw data of the atomic coordinates.
When studying the atomic arrangements of materials, particularly amorphous materials, the Voronoi tessellation is often used [3][4][5][6][7][8][9][10]. By using this method, the arrangement of atoms can be represented as a tiling of Voronoi polyhedra ( Fig. 6.1). Each Voronoi polyhedron contains one atom. We can know how an atom i is surrounded by its first nearest neighbour atoms by knowing the shape of the Voronoi polyhedron containing the atom i. For example, when the Voronoi polyhedron associated with the atom i is a dodecahedron, the atoms surrounding the atom i occupy the vertices of an icosahedron ( Fig. 6.2). Therefore, we can reveal the dominant local atomic arrangements (short-range order) by identifying frequently found Voronoi polyhedra. Furthermore, by knowing how a Voronoi polyhedron is surrounded by other Voronoi polyhedra, we can know how the atom is surrounded by its first nearest neighbours, second nearest neighbours, third nearest neighbours, . . .. Therefore, we can reveal the long-range order by identifying frequently found assemblages of Voronoi polyhedra.
To classify Voronoi polyhedra, several methods have been proposed. For example, the Voronoi index ⟨n 3 n 4 n 5 n 6 . . .⟩ [3] has often been used in studying amorphous materials. Here, n i is the number of i-gons of a Voronoi polyhedron. However, different Voronoi polyhedra can accidentally have the same Voronoi index ( Fig. 6.3). It is therefore impossible to study details of local atomic arrangements with the Voronoi index. To overcome this problem, Lazar et al. [13] used the Weinberg code [14,15]. However, there arises a different problem. With this method, a dodecahedron, for example, is encoded as '1 2 3 4 5 1 5 6 7 8 1 8 9 Fig. 6.1 Voronoi tessellation [11]. There is a one-to-one correspondence between the arrangement of atoms (left) and the tiling of Voronoi polyhedra (right) Fig. 6.2 Relation between the atomic arrangement and the shape of the Voronoi polyhedron [12]. First nearest neighbours of the pink atom are blue atoms, occupying the vertices of an icosahedron (left). The Voronoi polyhedron associated with the pink atom is a dodecahedron (right) 10 2 10 11 12 3 12 13 14 4 14 15 6 15 16 17 7 17 18 9 18 19 11 19 20 13 20 16 20  19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1'. Such a long codeword is difficult for human to handle. Since our brain capacity is limited, a shorter codeword is desirable. More seriously, there existed no methods for classifying assemblages of Voronoi polyhedra. Although we might not become conscious, it has severely prevented our understanding of the long-range order of amorphous materials.
Considering that the knowledge of square pyramids was used to construct the ancient pyramids of Egypt at Gaza, the study of polyhedra has a more than 4500 years history [16,17]. However, as described above, there existed no methods for briefly representing polyhedra and assemblages of polyhedra in a unified way. To overcome this problem, we have created the polyhedron code (p 3 -code) and the polychoron code (p 4 -code) [11,12,18,19]. The p 3 -code is a method for briefly representing polyhedra. It consists of (1) an encoding algorithm for converting a way of how polygons are arranged to form a polyhedron into a sequence of numbers, which we call a polyhedron codeword (p 3 -codeword, or p 3 for short) and (2) a decoding algorithm for recovering the original polyhedron from its p 3 . The p 4 -code is a generalization of the p 3 -code for representing assemblages of polyhedra. By using the p 4 -code, a way of how polyhedra are arranged to form a polyhedral assemblage can be converted into a sequence of p 3 s, which we call a polychoron codeword (p 4 -codeword, or p 4 for short), from which the original polyhedral assemblage can be recovered. In this chapter, we review the p 3 -code and p 4 -code [11,12,18,19].

Our Way of Viewing a Polyhedron
We regard a polyhedron as a tiling by polygons of the surface of a three-dimensional object that is topologically the same as a sphere. We are interested in the relative  [12]. Left and right polyhedra are composed of two squares, eight pentagons, and two hexagons. Therefore, both have the same Voronoi index. However, the left polyhedron is different from the right polyhedron. In fact, the hexagons of the left polyhedron adjoin each other, while the hexagons of the right polyhedron are separate from each other arrangements of polygons (which polygons are glued to which polygons), while we ignore measures such as lengths and angles.
According to the idea developed by L. Euler, A. M. Legendre, F. Möbius, and P. R. Cromwell [16], we assume that the polygons are glued such that (1) any pair of polygons meet only at their sides or corners and that (2) each side of each polygon meets exactly one other polygon along an edge. Here, we stress that parts of a polyhedron and those of the building-block polygons are clearly distinguished ( Fig. 6.4). Specifically, vertices and edges are zero-and one-dimensional parts of a polyhedron, respectively. On the other hands, corners and sides are zero-and one-dimensional parts of a polygon, respectively. Since this idea plays a central role in our theory, we need a verb to briefly describe the relation between parts of a polyhedron and those of polygons. For this purpose, we use the verb 'contribute'. For example, when we say that corners contribute to a vertex or a vertex is contributed by corners, we mean that the vertex is a point of a polyhedron at which the corners of polygons meet. We also say that a polygon (side) contributes to a vertex if one of its corners (endpoints) contributes to that vertex. When we say that an edge is contributed by sides, we mean that the edge is a line segment of a polyhedron along which the sides of polygons meet. The face of a polyhedron is a polygon. But when we call a polygon, we regard it as a building block of a polyhedron. So, we may say the edge of a face. But we cannot say the edge of a polygon.
We first describe a method for simple polyhedra. By a simple polyhedron, we mean that every vertex is degree three. Here, the degree of a vertex is the number of edges incident to that vertex. We use the property that every vertex of a simple polyhedron is contributed by three corners in the method for simple polyhedra. After describing the method for simple polyhedra, we generalize it to non-simple polyhedra.

Decoding Simple Polyhedra
The p 3 -code consists of encoding and decoding algorithms. Since the decoding algorithm is incorporated in the encoding algorithm, we first describe the decoding algorithm. To formulate the decoding algorithm, simple but a lot of new ideas must be introduced. However, the completed algorithm can be described easily. We describe the completed algorithm below. See Ref. [18] for its formulation.

How to Recover a 34443-Polyhedron
In our theory, we refer to a polyhedron illustrated in Fig. 6.5 as a 34443-polyhedron. The number sequence 34443 is not only the name of the polyhedron, but also instructs how to construct the polyhedron from its building-block polygons. Each number in 34443 indicates a building-block polygon. Specifically, since the left most number is 3, the polygon 1 is a triangle. Similarly, the polygons 2, 3, and 4 are squares, and the polygon 5 is a triangle.
When recovering the 34443-polyhedron from 34443, we first convert each number to the building-block polygon ( Fig. 6.6a). To instruct how to assemble the   [11] building-block polygons, we assign identification numbers (IDs) i 1 , i 2 , i 3 , . . . to the sides of the polygon i in a clockwise direction (Fig. 6.6b). Here, the side i j means the jth side of the polygon i or the side j of the polygon i. We assume that each symbol i j has a lexicographical number. In an example shown in Fig. 6.6, the lexicographical number increases in the order of 1 1 , . . . , 1 3 3 . In general, we define that i j < m n when i < m, and i j < i k when j < k.
We call the polygon 1 the partial polyhedron 1 (Fig. 6.7a). By glueing the side 2 1 (the side 1 of the polygon 2) to the side 1 1 of the partial polyhedron 1, we obtain a structure illustrated in Fig. 6.7b, which we call the partial polyhedron 2. Here, we introduce a term 'dangling side'. The dangling side is a side that is not glued to another side. In the example of Fig. 6.8, the sides 1 2 , 1 3 , 2 2 , 2 3 , and 2 4 are the dangling sides. We call the dangling side with the smallest ID the s-side. In the example of Fig. 6.8, the dangling side 1 2 is the s-side.
By glueing the side 3 1 (the side 1 of the polygon 3) to the s-side 1 2 of the partial polyhedron 2, we obtain a structure illustrated in Fig. 6.9. When a vertex contributed by two dangling sides are contributed by three polyhedra, we call that vertex an illegal vertex. In Fig. 6.9, the illegal vertex is indicated by an open circle. Every vertex of a simple polyhedron is contributed by three polygons. If we proceed decoding with leaving the illegal vertex, then the number of polygons that contribute to that vertex can increase to four, five, six, . . ., and we cannot construct a simple polyhedron. Therefore, when an illegal vertex is generated, we rectify it by glueing together the dangling sides contributing to it as illustrated in Fig. 6.10. As a result, the illegal vertex is removed. We call the structure thus obtained the partial polyhedron 3.  [11] We then repeat procedures described above. Specifically, we glue the side 4 1 (the side 1 of the polygon 4) to the s-side 1 3 of the partial polyhedron 3. As a result, two illegal vertices are generated. We, therefore, rectify them, and obtain the partial polyhedron 4. Then, we glue the side 5 1 (the side 1 of the polygon 5) to the s-side 2 3 of the partial polyhedron 4, and rectify illegal vertices. As a result, the 34443-polyhedron is completed.
In addition to the number sequence 34443, the polyhedron illustrated in Fig. 6.5 can be constructed from 43434 or 44343. Note that the number sequence 34443 is the sequence of numbers three, four, four, four and three. To give only one unique number sequence to the polyhedron, we regard the number sequences as numbers. Since the 34443, thirty-four thousand four hundred forty-three, is the smallest of three, we define it as the unique number sequence of the polyhedron. Therefore, we call the polyhedron the 34443-polyhedron.

Polyhedron Codeword
As we have seen, the polyhedron illustrated in Fig. 6.5 can be represented by 34443. We refer to the number sequence 34443 that represents the polyhedron as  Illegal vertex of a partial polyhedron [11] the p 3 -codeword. The subscript 3 indicates that a polyhedron is a three-dimensional object.
The p 3 formally consists of a polygon-sequence codeword (ps 2 ) and a side-pairing codeword (sp), and is denoted as Here, '; ' is a separator. The ps 2 -codeword is denoted as Here, p 2 i ð Þ is the number of sides of the polygon i. F is the number of faces of the polyhedron, in other words the number of polygons of the polyhedron. Although the formal form is p 3 = ps 2 ; sp, the p 3 -codeword of the polyhedron illustrated in Fig. 6.5 consists of only ps 2 . In other words, p 3 = ps 2 = 34443. There are many polyhedra whose p 3 does not have sp. However, some polyhedra need sp. For example, Tutte's polyhedron illustrated in Fig. 6.11 is represented by p 3 = 4555A4559554AA55555454555; E 6 9 6 . Here, A and E indicate 10 and 13, respectively. sp = E 6 9 6 instructs that the side E 6 should be glued to the side 9 6 . The sp-codeword is formally denoted as Here, we refer to the pair of y i ð Þ and x i ð Þ as a necessary additional pair (necessary a-pair). Note that a necessary a-pair is identical with a non-curable a-pair of Ref. [18]. To stress that the a-pair is necessary, we call a non-curable a-pair a necessary a-pair in this chapter. The necessary a-pair y i ð Þx i ð Þ instructs that the sides y i ð Þ and x i ð Þ should be glued together. N na is the number of the necessary a-pairs. Note that y i ð Þ > x i ð Þ and y i ð Þ < y i + 1 ð Þ.

Algorithm for Recovering the Original Polyhedron from p 3
In Sect. 6.2.2.1, we have described how to recover the 34443-polyhedron. Here, we describe how to recover the original polyhedron from its p 3 = ps 2 ; sp.
3. Repeat procedure 2 until all the polygons are placed.

Schlegel Diagram
So far, we have dealt with three-dimensional polyhedra. For convenience, we use Schlegel diagrams [17,20] to illustrate polyhedra from now on. The Schlegel diagram is the projection of a polyhedron onto a plane. The Schlegel diagram of the 34443-polyhedron is illustrated in Fig. 6.13a. Here, there are two things we should note. First, the outside polygon abc of the Schlegel diagram corresponds to the interior of the polygon abc of the polyhedron. Second, counterclockwise directions around inside polygons of a Schlegel diagram correspond to clockwise directions around the corresponding polygons of the polyhedron, while a clockwise direction around the outside polygon of a Schlegel diagram corresponds to a clockwise direction around the corresponding polygon of the polyhedron. For example, a travel z → x → a → c in the Schlegel diagram is in a counterclockwise direction. However, the corresponding travel in the polyhedron is in a clockwise direction. On the other hand, a travel a → b → c around the outside polygon of the Schlegel diagram and the corresponding travel in the polyhedron are both in clockwise directions. Figure 6.13b illustrates the decoding process of the 34443-polyhedron by using Schlegel diagrams.  [18]. a Relation between a polyhedron and its Schlegel diagram. b Decoding process illustrated by using Schlegel diagrams. Open circles are illegal vertices. Filled circles are degree two vertices

Polygon-Sequence Codeword
When encoding a polyhedron, we first choose a polygon and its side as a seed. Different seeds yield different p 3 s. To assign one unique p 3 to that polyhedron, we introduce the lexicographical number Lex p 3 ð Þ. We define p 3 with the smallest lexicographical number as the unique p 3 of that polyhedron. We have described the lexicographical numbers of 34443, 43434, and 44343 in Sect. 6.2.2.1. We will describe how to deal with p 3 = ps 2 ; sp in Sect. 6.2.3.7.
The p 3 -codeword consists of ps 2 and sp. We first describe how to generate ps 2 . The ps 2 -codeword is the sequence of p 2 i ð Þ s. Generating ps 2 is, therefore, assigning IDs to polygons. To distinguish between polygons to which IDs have already been assigned and polygons to which IDs will be assigned later, we use colours. We first colour all the polygons. When an ID is assigned, we make the polygon transparent.
We explain how to generate ps 2 by using the 34443-polyhedron as an example. In Fig. 6.14, polyhedra are expressed by using Schlegel diagrams. We choose the outside polygon and its side indicated by the arrow as a seed ( Fig. 6.14a). The polygon chosen as the seed is the polygon 1. Since the outside polygon is a triangle, p 2 1 ð Þ = 3. We then assign IDs to the sides of the polygon 1 from the side chosen as the seed in a clockwise direction, and make the polygon 1 transparent (Fig. 6.14b).
When decoding, we have defined a dangling side as a side that is not glued to another side. In encoding, we define a dangling side as a side of a transparent polygon that is glued to a coloured polygon. In Fig. 6.14b, the sides 1 1 , 1 2 , and 1 3 are dangling sides. Since 1 1 is the lexicographically smallest, the side 1 1 is the Fig. 6.14 Encoding process [18]. The dashed lines are s-sides s-side. The polygon 2 is the one that is glued to the s-side 1 1 . Since the polygon 2 is a square, p 2 2 ð Þ = 4. We assign IDs to the sides of the polygon 2 from the side glued to the s-side 1 1 in a clockwise direction, and then make the polygon 2 transparent (Fig. 6.14c). We note that the side IDs of the polygon 2 are assigned in a counterclockwise direction in Fig. 6.14c. This is because a counterclockwise direction around any polygon of the Schlegel diagram other than the outside polygon corresponds to a clockwise direction around the corresponding polygon of a polyhedron.
All that is left now is to repeat above described procedures. Specifically, since the polygon that is glued to the s-side 1 2 is the polygon 3, p 2 3 ð Þ = 4. After assigning IDs to its sides, we make the polygon 3 transparent (Fig. 6.14d). The polygon 4 is the one that is glued to the s-side 1 3 , and p 2 4 ð Þ = 4. After assigning IDs to its sides, we make the polygon 4 transparent (Fig. 6.14e). The polygon 5 is the one that is glued to the s-side 2 3 , and p 2 5 ð Þ = 3. After assigning IDs to its sides, we make the polygon 5 transparent (Fig. 6.14f). All the polygons have become transparent, and ps 2 = 34443 has been completed.
To summarize, for a given seed, ps 2 can be generated as follows.
Algorithm B (Fig. 6.15) (a) Polygon chosen as a seed is polygon 1.
ð Þ ) to its sides in a clockwise direction from the side that is glued to the s-side. c. Make polygon i transparent.
3. Repeat the procedure 2 until all the polygons get transparent.
Face and side IDs are assigned by generating ps 2 . By using the side IDs, we can assign edge and vertex IDs. The edge IDs will be used when generalizing the p 3 -code to the p 4 -code for polyhedral assemblages, while vertex IDs will be used when dealing with non-simple polyhedra.
We first describe how to assign edge IDs ( Fig. 6.16). Since two side IDs are associated with every edge, we tentatively assign the smaller side ID to the edge ( Fig. 6.16b). Since the tentative IDs thus assigned are not in a sequential order, we relabel the IDs so that the edge i is the one with the ith smallest tentative ID ( Fig. 6.16c). To assign vertex IDs, we first assign IDs to corners as illustrated in Fig. 6.17. We note that i 1 is assigned to the corner shared by the sides i 1 and i p 2 i ð Þ . For 1 < j ≤ p 2 i ð Þ, i j is assigned to the corner shared by the sides i j − 1 and i j . Since three corner IDs are associated with every vertex, we tentatively assign the smallest corner ID to the vertex, and then relabel the IDs so that the vertex i is the one with the ith smallest tentative ID.

Outline of How to Generate sp
To describe how to generate sp, we need to introduce simple but a lot of new ideas. One of them is the zeroth tentative sp (tsp 0 ð Þ ). Although details are given in Ref.
[18], we note that tsp 0 ð Þ is defined so that it has following properties; 1. The original polyhedron can be recovered from ps 2 ; tsp 0 ð Þ by using Algorithm A (Sect. 6.2.2.3), 2. but tsp 0 ð Þ can contain information that is not needed for recovering the original polyhedron.
The sp-codeword is obtained by reducing the redundancy in tsp 0 ð Þ .
To describe a little bit more about the relation between sp and tsp 0 ð Þ , we introduce the partial polyhedron D i ð Þ, polyhedron P i ð Þ, and partial polyhedron E i ð Þ. When decoding, polygons are glued together one by one. D i ð Þ is the assemblage of polygons obtained when the polygon i is attached. On the other hand, when generating ps 2 , the polygons get transparent one by one. P i ð Þ is the polyhedron obtained when the polygon i becomes transparent. We note that encoded polygons of P i ð Þ are transparent, but the others are coloured. E i ð Þ is the assemblage of polygons obtained by removing the coloured polygons from P i ð Þ. P 4 ð Þ of Fig. 6.14e is reproduced in Fig. 6.18a. E 4 ð Þ is obtained from P 4 ð Þ by removing the coloured polygon (Fig. 6.18b). Since recognizing transparent polygons is difficult, we coloured polygons of E 4 ð Þ (Fig. 6.18c). As for partial polyhedra, we do not distinguish between transparent polygons and coloured polygons. We therefore consider that coloured E 4 ð Þ is identical with E 4 ð Þ. Now we look at the sequence of partial polyhedra obtained in encoding E 1 ð ÞE 2 ð ÞE 3 ð Þ . . . E F ð Þ and the sequence of partial polyhedra obtained in decoding Fig. 6.19a). But, what we need is E F ð Þ = D F ð Þ. We therefore admit E i ð Þ ≠ D i ð Þ for i < F, and reduce redundancy from tsp 0 ð Þ to obtain sp ( Fig. 6.19b).
To describe details of tsp 0 ð Þ , we need to describe a-pairs. For this purpose, we first describe a term 'plot'.

Plot
When two dangling sides of different polygons adjoin each other, we consider that they are chained. We call the chain of dangling sides the plot. We also call a separate dangling side the plot. We assign the smallest ID of the dangling sides constituting a plot to that plot. In an example shown in Fig. 6.20, the dangling sides 1 2 and 2 4 of different polygons adjoin each other, so that they are chained. On the other hand, since the dangling sides 1 2 and 1 3 belong to the same polygon, they are not chained. Similarly, the dangling sides 2 3 and 2 4 are not chained. Therefore, the dangling sides 1 2 and 2 4 constitute the plot 1 2 . Similarly, the dangling sides 1 4 and 2 2 constitute the plot 1 4 . The separate dangling side 1 3 constitutes the plot 1 3 by itself. Similarly, the separate dangling side 2 3 froms the plot 2 3 . Here, we point out that the dangling sides of the same plot are all glued to the same polygon. In Ref. [18], we defined 'chained' as follows: two dangling sides are chained when they contribute to the same vertex contributed by two transparent polygons.   [18] However, the definition is complicated. In Ref. [12], we have found that the same term 'chained' can be defined more briefly, and we use this brief definition as described above.

How to Generate tsp 0 ð Þ
The tsp 0 ð Þ -codeword consists of a-pairs. We therefore describe a-pairs. In generating ps 2 , polygons of the polyhedron get transparent one by one. The process can be represented as P 1 The a-pairs relate to how the polygon i is glued to the other polygons in P i − 1 ð Þ. To explain this, we generate ps 2 of a polyhedron illustrated in Fig. 6.21a twice with choosing the outside polygon and the side indicated by the arrow as a seed. When the first generation is finished, IDs are assigned to all the polygons and sides. Therefore, we can perform the second generation with knowing all the IDs in advance. Figure 6.21b illustrates P 1 ð Þ, which is obtained when polygon 1 becomes transparent. In P 1 ð Þ, the dangling sides 1 1 , 1 2 , 1 3 and 1 4 constitute the plots 1 1 , 1 2 , 1 3 and 1 4 , respectively. The smallest ID plot (s-plot for short) is the plot 1 1 , to which the polygon 2 is glued. In general, the polygon i is glued to the s-plot of P i − 1 ð Þ. This is because, by definition, the polygon that is glued to the s-side of P i − 1 ð Þ is the polygon i. Figure 6.21c illustrates P 7 ð Þ, where the polygon 8 is glued to the s-plot 3 4 . In addition to the s-plot, the polygon 8 is glued to the plot 5 6 , which we call an additional plot. In general, the additional plots of P i − 1 ð Þ are plots other than the s-plot to which the polygon i is glued. By definition, the smallest ID of dangling sides constituting the additional plot 5 6 is 5 6 . The side 5 6 is glued to the side 8 5 of the polygon 8, and we refer to the pair of the sides 8 5 and 5 6 as the a-pair 8 5 5 6 . Note that the lexicographically larger 8 5 proceeds 5 6 . As is illustrated in Fig. 6.21d, 10 4 5 4 is also an a-pair. When generating ps 2 of the polyhedron illustrated in Fig. 6.21a, 8 5 5 6 and 10 4 5 4 are a-pairs. By collecting the a-pairs, tsp 0 ð Þ = 8 5 5 6 10 4 5 4 . The tsp 0 ð Þ -codeword is formally denoted as Here, y a i ð Þx a i ð Þ is the ith a-pair, where y a i ð Þ > x a i ð Þ and y a i ð Þ < y a i + 1 ð Þ. N a is the number of a-pairs.

How to Generate sp
As described above, when we encode the polyhedron illustrated in Fig. 6.21a, we obtain ps 2 ; tsp 0 ð Þ = 458585574755433; 8 5  [18] for its proof). But tsp 0 ð Þ can contain information that is not needed for recovering the original polyhedron.
We now examine whether 10 4 5 4 is necessary or not. To do so, we try to decode from 458585574755433; 8 5 5 6 which is obtained by removing 10 4 5 4 from ps 2 ; tsp 0 ð Þ ( Fig. 6.22). Since it does not have the information of the a-pair 10 4 5 4 , the sides 10 4 and 5 4 are not glued together in D 10 ð Þ, which is obtained when the polygon 10 is placed. And then the polygon 13 is glued to the side 5 4

in D 13
ð Þ. This means that we cannot recover the original polyhedron without 10 4 5 4 . On the other hand, when we decode 458585574755433; 10 4 5 4 which is obtained by removing 8 5 5 6 from ps 2 ; tsp 0 ð Þ , the sides 8 5 and 5 6 are separate in D 8 ð Þ, but they are glued together in D 13 ð Þ, and the original polyhedron can be recovered (Fig. 6.23). This means that 8 5 5 6 is not necessary. By removing the unnecessary 8 5 5 6 from tsp 0 ð Þ , sp is obtained as 10 4 5 4 .
3. Repeat the procedure 2, until we obtain tsp N a ð Þ = sp.
The sp-codeword is obtained from tsp 0 ð Þ by removing unnecessary a-pairs. In other words, sp consists of necessary a-pairs.

Lexicographical Number of p 3
Different seeds yield different p 3 s. To assign one unique p 3 to a polyhedron, we describe the lexicographical number Lex p 3 ð Þ. We regard Lex p 3 ð Þ as a base-n number, where n is any sufficiently large number as described below. Since p 3 consists of ps 2  ð Þ and Lex sp ð Þ. For reference, the concatenation of 24 expressed in base-10 (twenty-four) and 5 expressed in base-10 (five) is 245 (two hundred forty-five).
Note that, to regard Lex p 3 ð Þ as a base-n number, n should be larger than p 2 i ð Þ, y i ð Þ and x i ð Þ. Since the number of sides of a polyhedron is 2E = 6 F − 2 ð Þ, n should be larger than 2E. Here, E is the number of edges of a polyhedron.
Since there are 2E different selections of seeds, 2E different p 3 s can be generated from a polyhedron. If we consider that the polyhedron is identical with its mirror image, additional 2E different p 3 s can be generated from the mirror image. By selecting the smallest of 4E different p 3 s, we can assign one unique p 3 to the polyhedron. By considering that a polyhedron is identical with its mirror image, the unique p 3 s can be used to determine the isomorphism of polyhedral graphs. A polyhedral graph is a planer triply connected graph that has no multiple edges. If we regard a region enclosed by two edges as a 2-gon, p 3 s can be used to determine the isomorphism of planer triply connected graphs. When we want to distinguish the polyhedron from its mirror image, we may select the smallest of 2E different p 3 s. But the unique p 3 s thus generated cannot be used to determine the isomorphism of polyhedral graphs.

Solving the Problem of Voronoi Index
As is shown in Fig. 6.24, two different polyhedra have the same Voronoi index ⟨0282000 . . .⟩. By using p 3 s, we can say that 455665555455-and Fig. 6.24 Solving the problem of Voronoi index [12] 455655655554-polyhedra have the same Voronoi index ⟨0282000 . . .⟩. In other words, different polyhedra can be distinguished by using our method.

Cut-and-Dot Method
So far, we have assumed that polyhedra are simple. The theory for simple polyhedra can be easily generalized to non-simple polyhedra that have one or more vertices of degree more than three. Figure 6.25 illustrates a pentagonal pyramid. Since the apex is degree five, the pentagonal pyramid is a non-simple polyhedron. But when we cut the apex, a simple polyhedron can be obtained. By distinguishing the cross section from other faces, we can establish a one-to-one correspondence between a non-simple polyhedron and a simple polyhedron with a cross section. Using this relation, the non-simple polyhedron can be represented by 5444445. The dot over '5' indicates that the pentagon is a cross section which should be shrunk to a vertex. Note that this approach was inspired by Kempe's patch method for the four colour problem [17].
When dealing with polyhedra without cross sections, we have defined the s-side as the smallest ID dangling side. As for polyhedra with cross sections, we define the s-side as the smallest ID dangling side of polygons that are not cross sections. The reason is given later. A non-simple polyhedron can be encoded as follows: 1. Cut vertices of degree more than three. 2. Choose a polygon that is not a cross section and its side that does not contribute to any edge of the cross sections as a seed. 3. Generate p 3 using Algorithm B. 4. Put dots over numbers of ps 2 corresponding to the cross sections.
By encoding, IDs can be assigned to faces, edges and vertices of a non-simple polyhedron as follows (Fig. 6.26): 1. Assign IDs to a polyhedron with cross sections. 2. Shrink cross sections to vertices. As a result, some IDs disappear.

Fig. 6.25
One-to-one corresponding between a non-simple polyhedron and a simple polyhedron with a cross section [18] 3. Relabel IDs so that they become sequential orders.
We have modified the definition of the s-side. As a result, IDs assigned using the method described above conform to IDs assigned by directly applying Algorithm B to the non-simple polyhedron. Note that a codeword can be generated by directly applying Algorithm B to a non-simple polyhedron. However, the original polyhedron cannot be recovered from the codeword using Algorithm A. For example, a pentagonal pyramid can be encoded as 533333. But it cannot be recovered from 533333.
To assign one unique codeword to a non-simple polyhedron, we define Lex p 3 ð Þ for p 3 with dots. For this purpose, we define Lex ps 2 ð Þ as the concatenation of

Using Duality
The cut-and-dot method described in the previous section is applicable to all non-simple polyhedra, but is sometimes inefficient. For example, the octahedron is encoded as 66464646464646. Since 6 is repeated twice and then 46 is repeated six times, 66464646464646 can be shortened to 6 2 46 ð Þ 6 . However, the representation of the octahedron with beautiful symmetries is not beautiful. We think that it is a problem. To overcome this problem, we use the duality of polyhedra [17,21]. Since the octahedron is the dual of the hexahedron, we represent the octahedron as ★4 6 .
Here, ★ represents the dual, 4 6 is p 3 of the hexahedron, and ★4 6 means the dual of the 4 6 -polyhedron. We describe the details of this method below. Fig. 6.26 How to assign IDs to a non-simple polyhedron [18] For any polyhedron, its dual is constructed as follows (Fig. 6.27): 1. Put a vertex v * i of the dual polyhedron on the face f i of the given polyhedron. 2. Link v * i and v * j by the edge e * ij , when f i and f j share an edge e. The dual of the octahedron is the hexahedron, and the dual of the hexahedron is the octahedron. Thus, the octahedron and hexahedron are dual to each other. By using ★, a polyhedron composed of triangles only can be briefly represented, for its dual is a simple polyhedron.
Since there is a one-to-one correspondence between an original polyhedron and its dual, we can determine the edge and face IDs of the original from those of its dual. For example, in an example shown in Fig. 6.27b, the face dcf of the octahedron corresponds to the vertex m of the hexahedron. We, therefore, assign the ID of the vertex m to the face dcf. Similarly, the edge dc of the octahedron corresponds to the edge mi. We, therefore, assign the ID of the edge mi to the edge dc.
When we encode a simple polyhedron, we first choose a seed, and then generate p 3 from the seed. The side chosen as a seed contributes to the edge 1, and the polygon chosen as a seed becomes the polygon 1. Therefore, choosing a seed is determining the edge 1 and face 1. When we encode a non-simple polyhedron using the duality, we also choose a side and polygon of the non-simple polyhedron as a seed. We then choose a seed for its dual so that the edge of the dual corresponding to the edge of the original contributed by the side chosen as a seed becomes the edge 1 and that the vertex of the dual corresponding to the polygon of the original chosen as a seed becomes the vertex 1. For example, when we encode the octahedron with choosing the polygon dcf and its side dc as a seed, the polygon mihl and its side mi is a seed for its dual. Then 1 is assigned to the vertex m of the dual, and therefore to the polygon dcf of the original. Similarly, 1 is assigned to the edge mi of the dual, and therefore to the edge dc of the original contributed by the side dc. Fig. 6.27 Duality. a The dual of the octahedron is the hexahedron. b Graph representation of (a). The octahedron and hexahedron are dual to each other [18] Note that in Ref. [18], we determine the seed for the dual in a different way. But for simplicity, we have modified the method in Ref. [12], and the modified version is described above.
Therefore, the unique p 3 of the octahedron is ★4 6 .

Relation Between an Atomic Arrangement and a Voronoi Polyhedron
To represent atomic arrangements, we introduce the symbol @ that relates a Voronoi polyhedron and its corresponding atomic arrangement as follows. We refer to the Voronoi polyhedron associated with the atom i as the Voronoi polyhedron i. In other words, the atom i and its nearest neighbour atoms define the Voronoi polyhedra i. When the Voronoi polyhedron i is a p 3 -polyhedron, we represent the arrangement of atoms defining the Voronoi polyhedron, namely the atom i and its first nearest neighbour atoms, as an @p 3 -cluster ( Fig. 6.28a). Note that, in the @p 3 -cluster, first nearest neighbour atoms of the atom i occupy the vertices of a ★p 3polyhedron and the atom i locates at the centre of the ★p 3 -polyhedron ( Fig. 6.28b).

Polychoron Code
We can study the short-range order of amorphous materials by classifying the Voronoi polyhedra with the p 3 -code. We can study the long-range order by classifying assemblages of Voronoi polyhedra. A polyhedral assemblage can be Fig. 6.28 Relation between a local atomic arrangement and a Voronoi polyhedron [12]. a The Voronoi polyhedron associated with the pink atom is 5 12 . The pink and its neighbouring atoms form a @5 12 cluster. b The atoms adjacent to the pink atom occupy the vertices of a ★5 12polyhedron regarded as a part of a polychoron (four-dimensional polytope). The p 3 -code for polyhedra can be easily generalized to deal with polychora, for it is based on the hierarchy of structures of polytopes: a polyhedron (three-dimensional polytope) is an assemblage of polygons (two-dimensional polytopes). In this section, we generalize the p 3 -code for polyhedra to the p 4 -code for polychora. The p 4 -code consists of the encoding algorithm for converting a polychoron into p 4 and the decoding algorithm for recovering the original polychoron from its p 4 . The p 4 -code can be used to study the long-range order of amorphous materials.
Since we are living in the three-dimensional world, understanding four-dimensional objects is not easy. But understanding Schlegel diagrams of polychora is not difficult. As shown in Fig. 6.13a, a polyhedron can be represented as a two-dimensional object by using a Schlegel diagram. Similarly, a polychoron can be represented as a three-dimensional object by using a Schlegel diagram. The Schlegel diagram of a polychoron abcdefgh is illustrated in Fig. 6.29. We can see that the polychoron is an assemblage of two 3333-polyhedra and four 34443-polyhedra, and polyhedra are glued face to face. We note that the outside of the polyhedron abcd of the Schlegel diagram corresponds to the inside of the polyhedron abcd of the polychoron. By using the p 4 -code, the polychoron abcdefgh is represented by p 4 = 3333 34443 34443 34443 34443 3333. The p 4 -codeword is the sequence of p 3 s and instructs how to construct the polychoron from its building-block polyhedra. Since the left most p 3 is 3333, the polyhedron 1 is a 3333-polyhedron. Similarly, the polyhedra 2, 3, 4, and 5 are 34443-polyhedra, and the polyhedron 6 is a 3333-polyhedra. To describe the p 4 -code, we first describe the relations between parts of polyhedra and parts of a polychoron.

Our Way of Viewing a Polychoron
We regard a polychoron as a tiling by polyhedra of the surface of a four-dimensional object that is topologically the same as a 3-sphere. We assume that the polyhedra are glued together such that (1) any pair of polyhedra meet only at their faces, edges, or vertices and that (2) each face of each polyhedron meets exactly one other polyhedron along a ridge. We distinguish parts of a polychoron and parts of its building-block polyhedra (Fig. 6.30). The 0-face is a point of a polychoron where the vertices of polyhedra meet; the peak is a line segment of a polychoron where the edges of polyhedra meet; the ridge is an area of a polychoron where the faces of polyhedra meet. The cell of a polychoron is a polyhedron.

1-Simple Polychoron
Polyhedra can be classified into simple and non-simple polyhedra according to the degrees of the vertices. As described above, we have first created the method for simple polyhedra, and then generalized it for non-simple polyhedra. Polychora can be classified into simple and non-simple polychora according to the types of the Fig. 6.30 Parts of polyhedra and parts of a polychoron [18] 0-faces as well. A polychoron whose 0-faces are all degree four is called a simple polychoron. Here, the degree of a 0-face is the number of peaks incident to that 0-face. However, to describe the p 4 -code, we need to classify polychora according to the types of the peaks. We, therefore, generalize the concept of 'simple'. For this purpose, we first define the degree of a peak as the number of ridges incident to that peak. We then call a polychoron whose peaks are all degree three a 1-simple polychoron. The '1' indicates the simplicity regarding one-dimensional parts of a polychoron, namely peaks or 1-faces. We first describe the method for 1-simple polychora, and then briefly describe the generalization of the method for non-1-simple polychora. In the method for 1-simple polychora, we use the property that every peak of a 1-simple polychoron is contributed by three edges.
Note that, using our generalized notation, a simple polychoron is called a 0-simple polychoron. Here, '0' means the simplicity regarding zero-dimensional parts of a polychoron, namely 0-faces. Similarly, a simple polyhedron is a 0-simple polyhedron. If a polychoron is 0-simple, then it is also 1-simple, for its peaks are all degree three. However, a 1-simple polychoron is not always 0-simple. In other words, a set of 0-simple polychora is a subset of 1-simple polychora. For example, the 24-cell composed of 24 octahedra is 1-simple, but is not 0-simple. The polyhedra of a 0-simple polychoron are all 0-simple. On the other hand, the polyhedra of a 1-simple polychoron can be non-0-simple. For example, the octahedra of the 1-simple 24-cell are non-0-simple.
We also note that the definition of the peak degree described above is different from the definition given in Ref. [18]: the degree of a peak is the number of polyhedra contributing to that peak. In the previous definition, the polyhedra (building blocks of a polychoron) are focused. The previous definition, therefore, does not match the definition of the vertex degree where the edges (parts of a polyhedron) are focused: the degree of a vertex is the number of edges incident to that vertex. To match the definition of the vertex degree, namely to focus on the parts of a polychoron, we have introduced the new definition. In addition, in Ref. [18], we used the term 'a non-affected polychoron' to mean a 1-simple polychoron. However, since our new terminology is suitable for the systematic description of fundamental characteristics of polytopes, we use '1-simple' instead of 'non-affected'.

Polychoron Codeword
The p 4 -code is a method for converting a way of how polyhedra are arranged to form a polychoron into p 4 from which the original structure can be recovered. The p 4 -codeword consists of polyhedron-sequence codeword (ps 3 ) and face-pairing codeword (fp), and is denoted as a. Polyhedron glued to the s-face is polyhedron i. a. Generate p 3 of polyhedron i and assign IDs to its faces (edges) by encoding polyhedron i in such a way that i 1 is assigned to the face glued to the s-face (the edge glued to the smallest ID edge of the s-face). b. Make polyhedron i transparent.
3. Repeat the procedure 2 until all the polyhedra get transparent.

How to Generate tfp 0 ð Þ
To describe fp, we introduce a zeroth tentative fp (tfp 0 ð Þ ). For this purpose, we introduce some ideas. When two dangling faces of different polyhedra adjoin each other, we consider that they are chained. The chained dangling faces constitute a plot. A separate dangling face also constitutes a plot by itself. We assign the smallest face ID of all the dangling faces constituting a plot to that plot.  [18] correspondence, the p 4 -code can be generalized to deal with non-1-simple polychora (See [18] for details). However, this approach is not always efficient. So, we also use the duality of polychora. By using the duality, the 5-cell can be represented by T 4 , the 8-cell by H 8 , the 16-cell by ★H 8 , the 24-cell by O 24 , the 120-cell by D 120 , and the 600-cell by ★D 120 . Here, T = 3333 = 3 4 represents the tetrahedron, H = 444444 = 4 6 represents the hexahedron, O = ★H represents the octahedron, and D = 555555555555 = 5 12 represents the dodecahedron.

Ridge-Sequence Codeword
A polychoron relating to an amorphous material is 0-simple. Since they are all 0-simple, the polyhedra of a 0-simple polychoron can be represented without ' ⋅ ' and '★'. In other words, all the numbers of sides of polygons of a 0-simple polychoron are recorded in p 4 . We introduce a ridge-sequence codeword (rs) to briefly represent a 0-simple polychoron below.
We first describe tentative ridge IDs and ridge IDs. Since two face IDs are associated with every ridge, we tentatively assign the smaller face ID to the ridge. Since the tentative IDs thus assigned are not in a sequential order, we relabel the IDs so that the ridge i is the one with the ith smallest tentative ID.
In a polychoron, polyhedra are glued together face to face. For example, in the polychoron illustrated in Fig. 6.29, the first face of the polyhedron 2 (34443-polyhedron) is glued to the first face of the polyhedron 1 (3333-polyhedron). Since the face 2 1 is glued to the face 1 1 , p 2 2 1 ð Þ= p 2 1 1 ð Þ= 3. Here, p 2 i j À Á is the value of p 2 of jth number of ps 2 of the polyhedron i. In general, when the face a b is glued to the face x y , p 2 a b ð Þ= p 2 x y À Á . The ridge is a part of a polychoron where two faces of polyhedra meet. Suppose that a < x and r t a b ð Þ is the number of peaks of the ridge with a tentative ID a b . Then p 2 a b ð Þ= p 2 x y À Á = r t a b ð Þ. Since r t a b ð Þ is recorded twice, p 4 is redundant. This originates in that we regard a polychoron as an assemblage of polyhedra. If we regard a polychoron as an assemblage of ridges and use rs, we can reduce the redundancy in p 4 (See Ref. [19] for details). The rs-codeword is denoted as, rs = r 1 ð Þr 2 ð Þr 3 ð Þ . . . r R ð Þ.
Here, r i ð Þ is the number of peaks of the ridge i. R is the number of ridges of a polychoron. By using rs, we can represent a polychoron whose p 4 is 3333 34443 34443 34443 34443 3333 by a briefer codeword p rs ð Þ 4 = rs = 33334443443433 ( Fig. 6.32).

Relation Between a Local Atomic Arrangement and an Assemblage of Voronoi Polyhedra
An assemblage of polyhedra can be regarded as a partial polychoron, and is represented by p 4 . For example, as is illustrated in Fig. 6.33, an assemblage of two dodecahedra is represented by p 4 = ps 3 = DD (p rs ð Þ 4 = rs = 5 23 ). The arrangement of atoms that define the polyhedral assemblage is represented by @DD (@ 5 23 ). The @DD-cluster (@ 5 23 -cluster) can be regarded as overlapping two @D-clusters.

Summary
We have reviewed the p 4 -and p 3 -codes, which we have created as a method for studying the structures of amorphous materials [11,12,18,19]. The p 3 -code is a method for briefly representing polyhedra. It consists of (1) an encoding algorithm for converting a way of how polygons are arranged to form a polyhedron into p 3 and (2) a decoding algorithm for recovering the original polyhedron from its p 3 . We can study the short-range order of amorphous materials by classifying Voronoi Fig. 6.32 Ridge-sequence codeword [19] Fig. 6.33 Relation between a local atomic arrangement and an assemblage of Voronoi polyhedra. Here, D = 5 12 is p 3 of the dodecahedron polyhedra according to their p 3 s. The p 4 -code is a generalization of the p 3 -code for representing assemblages of polyhedra. By using the p 4 -code, a way of how polyhedra are arranged to form a polyhedral assemblage can be converted into p 4 , from which the original polyhedral assemblage can be recovered. We can study the long-range order of amorphous materials by classifying assemblages of Voronoi polyhedra according to their p 4 s.