Keywords

1 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, \( \ldots \). Therefore, we can reveal the long-range order by identifying frequently found assemblages of Voronoi polyhedra.

Fig. 6.1
figure 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
figure 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)

To classify Voronoi polyhedra, several methods have been proposed. For example, the Voronoi index \( \left\langle {n_{3} n_{4} n_{5} n_{6} \ldots } \right\rangle \) [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 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.

Fig. 6.3
figure 3

Problem of Voronoi index [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

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].

2 Polyhedron Code

2.1 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 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.

Fig. 6.4
figure 4

Parts of polygons and parts of a polyhedron [18]

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.

2.2 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.

2.2.1 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.

Fig. 6.5
figure 5

34443-polyhedron [11]

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 building-block polygons, we assign identification numbers (IDs) \( i_{1} , i_{2} , i_{3} , \) \( \ldots \) to the sides of the polygon \( i \) in a clockwise direction (Fig. 6.6b). Here, the side \( i_{j} \) means the \( j \)th 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} , \ldots , 1_{3} , 2_{1} , \ldots , 2_{4} , 3_{1} , \ldots , 3_{4} , 4_{1} , \ldots , 4_{4} , 5_{1} , \ldots , 5_{3} \). In general, we define that \( i_{j} < m_{n} \) when \( i < m \), and \( i_{j} < i_{k} \) when \( j < k \).

Fig. 6.6
figure 6

Decoding procedures [11]

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} , {\text{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.

Fig. 6.7
figure 7

Partial polyhedra 1 and 2 [11]

Fig. 6.8
figure 8

Dangling sides [11]

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, \( \ldots \), 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.

Fig. 6.9
figure 9

Illegal vertex of a partial polyhedron [11]

Fig. 6.10
figure 10

How to rectify an illegal vertex [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.

2.2.2 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 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

$$ p_{3} = ps_{2} ;sp. $$

Here, ‘\( ; \)’ is a separator. The \( ps_{2} \)-codeword is denoted as

$$ ps_{2} = p_{2} \left( 1 \right)p_{2} \left( 2 \right)p_{2} \left( 3 \right) \ldots p_{2} \left( F \right). $$

Here, \( p_{2} \left( i \right) \) 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

Fig. 6.11
figure 11

Tutte’s polyhedron [12]

$$ sp = y\left( 1 \right)x\left( 1 \right) y\left( 2 \right)x\left( 2 \right) y\left( 3 \right)x\left( 3 \right) \ldots y\left( {N_{\text{na}} } \right)x\left( {N_{\text{na}} } \right). $$

Here, we refer to the pair of \( y\left( i \right) \) and \( x\left( i \right) \) 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\left( i \right)x\left( i \right) \) instructs that the sides \( y\left( i \right) \) and \( x\left( i \right) \) should be glued together. \( N_{\text{na}} \) is the number of the necessary a-pairs. Note that \( y\left( i \right) > x\left( i \right) \) and \( y\left( i \right) < y\left( {i + 1} \right) \).

2.2.3 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 \).

Algorithm A (Fig. 6.12)

Fig. 6.12
figure 12

Decoding algorithm [12]

  1. 1.

    \( i = 1 \)

    1. (a)

      Polygon \( \alpha \) is a \( p_{2} \left( \alpha \right) \)-gon\(\left({1 \le \alpha \le F} \right)\).

    2. (b)

      Assign IDs (\( \alpha_{1} , \alpha_{2} , \alpha_{3} , \ldots , \alpha_{{p_{2} \left( \alpha \right)}} \)) to sides of polygon \( \alpha \) in a clockwise direction.

    3. (c)

      Polygon 1 is partial polyhedron 1.

  2. 2.

    \( i = i + 1 \)

    1. (a)

      Glue side \( i_{1} \) to the s-side of partial polyhedron \( i - 1 \).

    2. (b)

      When side \( y\left( \beta \right) \) (\( 1 \le \beta \le N_{\text{na}} \)) is a side of polygon \( i \), glue side \( y\left( \beta \right) \) to side \( x\left( \beta \right) \).

    3. (c)

      Rectify illegal vertices.

    4. (d)

      Resultant structure is partial polyhedron \( i \).

  3. 3.

    Repeat procedure 2 until all the polygons are placed.

2.3 Encoding Simple Polyhedra

2.3.1 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 \to x \to a \to 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 \to b \to 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.

Fig. 6.13
figure 13

Schlegel diagram [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

2.3.2 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 \( {\text{Lex}}\left( {p_{3} } \right) \). 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} \left( i \right) \) 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} \left( 1 \right) = 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).

Fig. 6.14
figure 14

Encoding process [18]. The dashed lines are s-sides

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} , {\text{and }} 1_{3} \) are dangling sides. Since \( 1_{1} \) is the lexicographically smallest, the side \( 1_{1} \) is the 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} \left( 2 \right) = 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} \left( 3 \right) = 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} \left( 4 \right) = 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} \left( 5 \right) = 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)

Fig. 6.15
figure 15

Encoding algorithm [12]

  1. 1.

    \( i = 1 \)

    1. (a)

      Polygon chosen as a seed is polygon 1.

    2. (b)

      Assign IDs (\( 1_{1} , 1_{2} , 1_{3} , \ldots , 1_{{p_{2} \left( 1 \right)}} \)) to its sides in a clockwise direction from the side chosen as a seed.

    3. (c)

      Make polygon 1 transparent.

  2. 2.

    \( i = i + 1 \)

    1. a.

      Polygon glued to the s-side is polygon \( i \).

    2. b.

      Assign IDs (\( i_{1} , i_{2} , i_{3} , \ldots , i_{{p_{2} \left( i \right)}} \)) to its sides in a clockwise direction from the side that is glued to the s-side.

    3. c.

      Make polygon \( i \) transparent.

  3. 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 \( i \)th 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} \left( i \right)}} \). For \( 1 < {\text{j}} \le p_{2} \left( i \right) \), \( 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 \( i \)th smallest tentative ID.

Fig. 6.16
figure 16

How to assign edge IDs [18]

Fig. 6.17
figure 17

Corner and edge IDs [18]

2.3.3 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^{\left( 0 \right)} \)). Although details are given in Ref. [18], we note that \( tsp^{\left( 0 \right)} \) is defined so that it has following properties;

  1. 1.

    The original polyhedron can be recovered from \( ps_{2} ;tsp^{\left( 0 \right)} \) by using Algorithm A (Sect. 6.2.2.3),

  2. 2.

    but \( tsp^{\left( 0 \right)} \) can contain information that is not needed for recovering the original polyhedron.

The \( sp \)-codeword is obtained by reducing the redundancy in \( tsp^{\left( 0 \right)} \).

To describe a little bit more about the relation between \( sp \) and \( tsp^{\left( 0 \right)} \), we introduce the partial polyhedron \( D\left( i \right) \), polyhedron \( P\left( i \right) \), and partial polyhedron \( E\left( i \right) \). When decoding, polygons are glued together one by one. \( D\left( i \right) \) 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\left( i \right) \) is the polyhedron obtained when the polygon \( i \) becomes transparent. We note that encoded polygons of \( P\left( i \right) \) are transparent, but the others are coloured. \( E\left( i \right) \) is the assemblage of polygons obtained by removing the coloured polygons from \( P\left( i \right) \). \( P\left( 4 \right) \) of Fig. 6.14e is reproduced in Fig. 6.18a. \( E\left( 4 \right) \) is obtained from \( P\left( 4 \right) \) by removing the coloured polygon (Fig. 6.18b). Since recognizing transparent polygons is difficult, we coloured polygons of \( E\left( 4 \right) \) (Fig. 6.18c). As for partial polyhedra, we do not distinguish between transparent polygons and coloured polygons. We therefore consider that coloured \( E\left( 4 \right) \) is identical with \( E\left( 4 \right) \).

Fig. 6.18
figure 18

Relation between polyhedron \( \varvec{P}\left( \varvec{i} \right) \) and partial polyhedron \( \varvec{E}\left( \varvec{i} \right) \) [18]

Now we look at the sequence of partial polyhedra obtained in encoding \( E\left( 1 \right)E\left( 2 \right)E\left( 3 \right) \ldots E\left( F \right) \) and the sequence of partial polyhedra obtained in decoding \( D\left( 1 \right)D\left( 2 \right)D\left( 3 \right) \ldots D\left( F \right) \). When decoding from \( ps_{2} ;tsp^{\left( 0 \right)} \), \( E\left( i \right) = D\left( i \right) \) for \( 1 \le i \le F \) (Fig. 6.19a). But, what we need is \( E\left( F \right) = D\left( F \right) \). We therefore admit \( E\left( i \right) \ne D\left( i \right) \) for \( i < F \), and reduce redundancy from \( tsp^{\left( 0 \right)} \) to obtain \( sp \) (Fig. 6.19b).

Fig. 6.19
figure 19

Comparison between \( \varvec{tsp}^{\left( 0 \right)} \) and \( \varvec{sp} \) [12]

To describe details of \( tsp^{\left( 0 \right)} \), we need to describe a-pairs. For this purpose, we first describe a term ‘plot’.

2.3.4 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.

Fig. 6.20
figure 20

Plot. The pair of Dangling sides contributing to a circle are chained [18]

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. 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.

2.3.5 How to Generate \( {tsp}^{\left( 0 \right)} \)

The \( tsp^{\left( 0 \right)} \)-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\left( 1 \right)P\left( 2 \right)P\left( 3 \right) \ldots P\left( F \right) \). The a-pairs relate to how the polygon \( i \) is glued to the other polygons in \( P\left( {i - 1} \right) \). 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\left( 1 \right) \), which is obtained when polygon 1 becomes transparent. In \( P\left( 1 \right) \), 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\left( {i - 1} \right) \). This is because, by definition, the polygon that is glued to the s-side of \( P\left( {i - 1} \right) \) is the polygon \( i \). Figure 6.21c illustrates \( P\left( 7 \right) \), 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\left( {i - 1} \right) \) 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^{\left( 0 \right)} = 8_{5} 5_{6} 10_{4} 5_{4} \).

Fig. 6.21
figure 21

Explanation of \( \varvec{tsp}^{\left( 0 \right)} \) [18]

The \( tsp^{\left( 0 \right)} \)-codeword is formally denoted as

$$ tsp^{\left( 0 \right)} = y_{a} \left( 1 \right)x_{a} \left( 1 \right) y_{a} \left( 2 \right)x_{a} \left( 2 \right) y_{a} \left( 3 \right)x_{a} \left( 3 \right) \ldots y_{a} \left( {N_{a} } \right)x_{a} \left( {N_{a} } \right). $$

Here, \( y_{a} \left( i \right)x_{a} \left( i \right) \) is the \( i \)th a-pair, where \( y_{a} \left( i \right) > x_{a} \left( i \right) \) and \( y_{a} \left( i \right) < y_{a} \left( {i + 1} \right) \). \( N_{a} \) is the number of a-pairs.

2.3.6 How to Generate \( {sp} \)

As described above, when we encode the polyhedron illustrated in Fig. 6.21a, we obtain \( ps_{2} ;tsp^{\left( 0 \right)} = 458585574755433;8_{5} 5_{6} 10_{4} 5_{4} \). The original polyhedron can be recovered from \( ps_{2} ;tsp^{\left( 0 \right)} \) using Algorithm A described in Sect. 6.2.2.3 (See Ref. [18] for its proof). But \( tsp^{\left( 0 \right)} \) 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^{\left( 0 \right)} \) (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\left( {10} \right) \), which is obtained when the polygon 10 is placed. And then the polygon 13 is glued to the side \( 5_{4} \) in \( D\left( {13} \right) \). 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^{\left( 0 \right)} \), the sides \( 8_{5} \) and \( 5_{6} \) are separate in \( D\left( 8 \right) \), but they are glued together in \( D\left( {13} \right) \), 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^{\left( 0 \right)} \), \( sp \) is obtained as \( 10_{4} 5_{4} \).

Fig. 6.22
figure 22

Necessary a-pair [18]

Fig. 6.23
figure 23

Unnecessary a-pair [18]

For a given \( tsp^{\left( 0 \right)} \), \( sp \) can be generated as follows.

Algorithm C

  1. 1.

    \( i = 0 \)

    1. (a)

      \( tsp^{\left( 0 \right)} = y_{a} \left( 1 \right)x_{a} \left( 1 \right) y_{a} \left( 2 \right)x_{a} \left( 2 \right) y_{a} \left( 3 \right)x_{a} \left( 3 \right) \ldots y_{a} \left( {N_{a} } \right)x_{a} \left( {N_{a} } \right) \).

  2. 2.

    \( i = i + 1 \)

    1. (a)

      Construct \( test^{\left( i \right)} \) from \( tsp^{{\left( {i - 1} \right)}} \) by removing \( y_{a} \left( {N_{a} - i + 1} \right)x_{a} \left( {N_{a} - i + 1} \right) \).

    2. (b)

      Decode from \( ps_{2} ;test^{\left( i \right)} \).

      1. If the original polyhedron is recovered, then \( tsp^{\left( i \right)} = test^{\left( i \right)} \).

      2. Otherwise, \( tsp^{\left( i \right)} = tsp^{{\left( {i - 1} \right)}} \).

  3. 3.

    Repeat the procedure 2, until we obtain \( tsp^{{\left( {N_{a} } \right)}} = sp \).

The \( sp \)-codeword is obtained from \( tsp^{\left( 0 \right)} \) by removing unnecessary a-pairs. In other words, \( sp \) consists of necessary a-pairs.

2.3.7 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 \( {\text{Lex}}\left( {p_{3} } \right) \). We regard \( {\text{Lex}}\left( {p_{3} } \right) \) as a base-\( n \) number, where \( n \) is any sufficiently large number as described below. Since \( p_{3} \) consists of \( ps_{2} \) and \( sp \), \( {\text{Lex}}\left( {p_{3} } \right) \) consists of \( {\text{Lex}}\left( {ps_{2} } \right) \) and \( {\text{Lex}}\left( {sp} \right) \). We first describe \( {\text{Lex}}\left( {ps_{2} } \right) \). Since \( ps_{2} \) is the sequence of \( F \) numbers, we define \( {\text{Lex}}\left( {ps_{2} } \right) \) as a \( F \)-digit base-\( n \) number \( {\text{Lex}}\left( {ps_{2} } \right) = p_{2} \left( 1 \right)p_{2} \left( 2 \right)p_{2} \left( 3 \right) \ldots p_{2} \left( F \right) \), where \( p_{2} \left( i \right) \) is the value of the \( \left( {F - i + 1} \right) \)th digit. Note that \( p_{2} \left( i \right) \) in the number sequence \( ps_{2} = p_{2} \left( 1 \right)p_{2} \left( 2 \right)p_{2} \left( 3 \right) \ldots p_{2} \left( F \right) \), is the \( i \)th number. Similarly, \( {\text{Lex}}\left( {sp} \right) \) is a \( 2N_{\text{na}} \)-digit base-\( n \) number \( y\left( 1 \right)x\left( 1 \right)y\left( 2 \right)x\left( 2 \right)y\left( 3 \right)x\left( 3 \right) \ldots y\left( {N_{\text{na}} } \right)x\left( {N_{\text{na}} } \right) \). \( {\text{Lex}}\left( {p_{3} } \right) \) is the concatenation of \( {\text{Lex}}\left( {ps_{2} } \right) \) and \( {\text{Lex}}\left( {sp} \right) \). 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 \( {\text{Lex}}\left( {p_{3} } \right) \) as a base-\( n \) number, \( n \) should be larger than \( p_{2} \left( i \right) \), \( y\left( i \right) \) and \( x\left( i \right) \). Since the number of sides of a polyhedron is \( 2E = 6\left( {F - 2} \right) \), \( 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.

2.3.8 Solving the Problem of Voronoi Index

As is shown in Fig. 6.24, two different polyhedra have the same Voronoi index \( \left\langle {0282000 \ldots } \right\rangle \). By using \( p_{3} \)s, we can say that 455665555455- and 455655655554-polyhedra have the same Voronoi index \( \left\langle {0282000 \ldots } \right\rangle \). In other words, different polyhedra can be distinguished by using our method.

Fig. 6.24
figure 24

Solving the problem of Voronoi index [12]

2.4 Non-simple Polyhedron

2.4.1 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 \( 544444\dot{5} \). 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].

Fig. 6.25
figure 25

One-to-one corresponding between a non-simple polyhedron and a simple polyhedron with a cross section [18]

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. 1.

    Cut vertices of degree more than three.

  2. 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. 3.

    Generate \( p_{3} \) using Algorithm B.

  4. 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):

Fig. 6.26
figure 26

How to assign IDs to a non-simple polyhedron [18]

  1. 1.

    Assign IDs to a polyhedron with cross sections.

  2. 2.

    Shrink cross sections to vertices. As a result, some IDs disappear.

  3. 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 \( {\text{Lex}}\left( {p_{3} } \right) \) for \( p_{3} \) with dots. For this purpose, we define \( {\text{Lex}}\left( {ps_{2} } \right) \) as the concatenation of \( {\text{Lex}}\left( {ps_{2}^{\left( 1 \right)} } \right) \) and \( {\text{Lex}}\left( {ps_{2}^{\left( 2 \right)} } \right) \). The \( ps_{2}^{\left( 1 \right)} \)-codeword is obtained from \( ps_{2} \) by replacing every number without a dot by 0 and then removing all dots, while \( ps_{2}^{\left( 2 \right)} \) is obtained by removing all dots from \( ps_{2} \). For example, when \( ps_{2} = 544444\dot{5} \), \( ps_{2}^{\left( 1 \right)} = 0000005 \) and \( ps_{2}^{\left( 1 \right)} = 5444445 \). Therefore, \( {\text{Lex}}\left( {ps_{2} } \right) = 00000055444445 \).

2.4.2 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 \( 66\dot{4}6\dot{4}6\dot{4}6\dot{4}6\dot{4}6\dot{4}6 \). Since 6 is repeated twice and then \( \dot{4}6 \) is repeated six times, \( 66\dot{4}6\dot{4}6\dot{4}6\dot{4}6\dot{4}6\dot{4}6 \) can be shortened to \( 6^{2} \left( {\dot{4}6} \right)^{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.

For any polyhedron, its dual is constructed as follows (Fig. 6.27):

Fig. 6.27
figure 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]

  1. 1.

    Put a vertex \( v_{i}^{*} \) of the dual polyhedron on the face \( f_{i} \) of the given polyhedron.

  2. 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.

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.

To assign one unique \( p_{3} \) to any non-simple polyhedron, we assume \( {\text{Lex}} \)(★) = 1 and define \( {\text{Lex}} \)(★\( p_{3} \)) as the concatenation of \( {\text{Lex}} \)(★) and \( {\text{Lex}} \)(\( p_{3} \)). By doing so, \( {\text{Lex}} \)(★\( 4^{6} \)) = 1444444, while \( {\text{Lex}}\left( {6^{2} \left( {\dot{4}6} \right)^{6} } \right) = 0040404040404066464646464646 \). Therefore, the unique \( p_{3} \) of the octahedron is ★\( 4^{6} \).

2.5 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_{3} \)-polyhedron and the atom \( i \) locates at the centre of the ★\( p_{3} \)-polyhedron (Fig. 6.28b).

Fig. 6.28
figure 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^{12} \)-polyhedron

3 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 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.

Fig. 6.29
figure 29

Polychoron represented by using a Schlegel diagram [19]

3.1 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.

Fig. 6.30
figure 30

Parts of polyhedra and parts of a polychoron [18]

3.2 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 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’.

3.3 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

$$ p_{4} = ps_{3} ;fp. $$

Here, \( ps_{3} \) is denoted as

$$ ps_{3} = p_{3} \left( 1 \right)p_{3} \left( 2 \right)p_{3} \left( 3 \right) \ldots p_{3} \left( C \right), $$

where \( p_{3} \left( i \right) \) is \( p_{3} \) of polyhedron \( i \), \( C \) is the number of cells of a polychoron, in other words the number of polyhedra of a polychoron. The \( fp \)-codeword is denoted as

$$ fp = w\left( 1 \right)z\left( 1 \right)v\left( 1 \right)w\left( 2 \right)z\left( 2 \right)v\left( 2 \right)w\left( 3 \right)z\left( 3 \right)v\left( 3 \right) \ldots w\left( {N_{\text{na}} } \right)z\left( {N_{\text{na}} } \right)v\left( {N_{\text{na}} } \right). $$

Here, \( w\left( i \right)z\left( i \right)v\left( i \right) \) is the necessary a-pair for the polychoron, instructing that the face \( w\left( i \right) \) and face \( v\left( i \right) \) should be glued together in such a way that the edge of the face \( w\left( i \right) \) contributed by the side \( z\left( i \right) \) is glued to the smallest ID edge of the face \( v\left( i \right) \). \( N_{\text{na}} \) is the number of necessary a-pairs. Note that \( w\left( i \right) > v\left( i \right) \) and \( w\left( i \right) < w\left( {i + 1} \right) \).

3.4 How to Generate \( ps_{3} \)

To encode a polychoron, we first chose a polyhedron, face of the polyhedron, and edge of the face as a seed. Depending on how we choose the seed, \( p_{4} \) changes. By using lexicographical numbers described in Sect. 6.3.8, one unique \( p_{4} \) can be assigned to each polychoron. The \( p_{4} \)-codeword consists of \( ps_{3} \) and \( fp \). We first describe how to generate \( ps_{3} \).

Generating \( ps_{3} \) is assigning IDs to polyhedra. We use colours to distinguish between polyhedra to which IDs have already been assigned and polyhedra to which IDs will be assigned later. We first colour all the polyhedra. When an ID is assigned, we make the polyhedron transparent (Fig. 6.31). We refer to the face of a transparent polyhedron glued to a coloured polyhedron as a dangling face. To instruct how to assign IDs to polyhedra, we assign IDs to the faces (edges) of every polyhedron by encoding the polyhedron. Specifically, we assign \( i_{j} \) to the \( j \)th face (edge) of the polyhedron \( i \). The dangling face with the smallest ID is called the s-face.

Fig. 6.31
figure 31

Encoding a polychoron. The edges of each s-face are indicated by red lines. The smallest ID edge of each s-face is indicated by a dotted line [18]

For a given seed, \( ps_{3} \) can be generated as follows.

Algorithm D

  1. 1.

    \( i = 1 \)

    1. a.

      Polyhedron chosen as the seed is polyhedron 1.

    2. b.

      Generate \( p_{3} \) of polyhedron 1 and assign IDs to its faces (edges) by encoding polyhedron 1 in such a way that \( 1_{1} \) is assigned to the face (edge) chosen as the seed.

    3. c.

      Make polyhedron 1 transparent.

  2. 2.

    \( i = i + 1 \)

    1. a.

      Polyhedron glued to the s-face is polyhedron \( i \).

    2. 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).

    3. b.

      Make polyhedron \( i \) transparent.

  3. 3.

    Repeat the procedure 2 until all the polyhedra get transparent.

3.5 How to Generate \( tfp^{\left( 0 \right)} \)

To describe \( fp \), we introduce a zeroth tentative \( fp \) (\( tfp^{\left( 0 \right)} \)). 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.

In generating \( ps_{3} \), polyhedra of the polychoron get transparent one by one. We consider a polychoron \( P_{4} \left( {i - 1} \right) \) obtained when the \( \left( {i - 1} \right) \)th polyhedron gets transparent. The polyhedron \( i \) is glued to the s-plot of \( P_{4} \left( {i - 1} \right) \). When the polyhedron \( i \) is glued to plots other than the s-plot, those plots are the a-plots for the polychoron. Suppose that the face \( w_{a} \) of the polyhedron \( i \) is glued to the face \( v_{a} \) of the a-plot \( v_{a} \) in such a way that the edge contributed by the side \( z_{a} \) of the polygon \( w_{a} \) is glued to the smallest ID edge of the face \( v_{a} \). Then the pair of \( w_{a} z_{a} v_{a} \) is the a-pair for the polychoron. The \( tfp^{\left( 0 \right)} \)-codeword is obtained by collecting the a-pairs in such a way that \( w_{a} \left( i \right) < w_{a} \left( {i - 1} \right) \);

$$ tfp^{\left( 0 \right)} = w_{a} \left( 1 \right)z_{a} \left( 1 \right)v_{a} \left( 1 \right) \ldots w_{a} \left( {N_{\text{a}} } \right)z_{a} \left( {N_{\text{a}} } \right)v_{a} \left( {N_{\text{a}} } \right). $$

Here, \( N_{\text{a}} \) is the number of a-pairs.

3.6 How to Recover a Polychoron from \( ps_{3} ;tsp^{\left( 0 \right)} \)

To describe how to recover a polychoron from its \( ps_{3} ;tsp^{\left( 0 \right)} \), we first describe the dangling face for decoding and an illegal peak. In decoding, we call a face that is not glued to another polyhedron a dangling face. When a peak contributed by two dangling faces is also contributed by three polyhedra, we call that peak an illegal peak. The illegal peak can be rectified by glueing the two dangling faces together.

The polychoron can be recovered from its \( ps_{3} ;tsp^{\left( 0 \right)} \) as follows:

Algorithm E

  1. 1.

    \( i = 1 \)

    1. a.

      Polyhedron \( \alpha \) is a \( p_{3} \left( \alpha \right) \)-polyhedron \( \left( {1 \le \alpha \le C} \right) \).

    2. b.

      Assign \( \alpha_{j} \) to the \( j \)th face (edge) of polyhedron \( \alpha \).

    3. c.

      Polyhedron 1 is partial polychoron 1.

  2. 2.

    \( i = i + 1 \)

    1. a.

      Glue face \( i_{i} \) (face \( {\text{1}} \) of polyhedron \( i \)) to the s-face of partial polychoron \( i - 1 \).

    2. c.

      When \( w_{a} \left( \beta \right) \) is the face ID of polyhedron \( i \) \( \left( {1 \le \beta \le N_{\text{a}} } \right) \), glue together faces \( w_{a} \left( \beta \right) \) and \( v_{a} \left( \beta \right) \) in such a way that the edge contributed by side \( z_{a} \left( \beta \right) \) is glued to the smallest ID edge of the face \( v_{a} \left( \beta \right) \).

    3. d.

      Rectify illegal peaks.

    4. e.

      Structure thus obtained is partial polychoron \( i \).

  3. 3.

    Repeat the procedure 2 until all the polyhedra are placed.

For reference, recovering a polychoron from 3333 34443 34443 34443 34443 3333 is illustrated in Supplemental Information of Ref. [18].

3.7 How to Generate \( fp \)

The original polychoron can be recovered from \( ps_{3} ;tfp^{\left( 0 \right)} \) by using Algorithm E. However, \( tfp^{\left( 0 \right)} \) can contain information that is not necessary for recovering the original polychoron. The \( fp \)-codeword is obtained by reducing the redundancy in \( tfp^{\left( 0 \right)} \) as follows;

Algorithm F

  1. 1.

    \( i = 0 \)

    1. a.

      \( tfp^{\left( 0 \right)} = w_{a} \left( 1 \right)z_{a} \left( 1 \right)v_{a} \left( 1 \right) \ldots w_{a} \left( {N_{\text{a}} } \right)z_{a} \left( {N_{\text{a}} } \right)v_{a} \left( {N_{\text{a}} } \right) \).

  2. 2.

    \( i = i + 1 \)

    1. a.

      Construct \( test^{\left( i \right)} \) by removing \( w_{a} \left( {N_{a} - i + 1} \right)z_{a} \left( {N_{a} - i + 1} \right)v_{a} \left( {N_{a} - i + 1} \right) \) from \( tfp^{{\left( {i - 1} \right)}} \).

    2. b.

      Decode from \( ps_{3} ;test^{\left( i \right)} \).

      1. i.

        If the original polychoron is recovered, then \( tfp^{\left( i \right)} = test^{\left( i \right)} \).

      2. ii.

        Otherwise, \( tfp^{\left( i \right)} = tfp^{{\left( {i - 1} \right)}} \).

  3. 3.

    Repeat the procedure 2 until \( fp = tfp^{{\left( {N_{\text{a}} } \right)}} \) is obtained.

3.8 Lexicographical Number of \( p_{4} \)

Different \( p_{4} \)s are generated from different seeds. To determine one unique \( p_{4} \), we define \( {\text{Lex}}\left( {p_{4} } \right) \) as follows. Since \( p_{4} = ps_{3} ;fp \), \( {\text{Lex}}\left( {p_{4} } \right) \) is the concatenation of \( {\text{Lex}}\left( {ps_{3} } \right) \) and \( {\text{Lex}}\left( {fp} \right) \). Since \( ps_{3} \) is the sequence of \( p_{3} \left( i \right) \)s, \( {\text{Lex}}\left( {ps_{3} } \right) \) is a \( C \)-digit number \( {\text{Lex}}\left( {p_{3} \left( 1 \right)} \right){\text{Lex}}\left( {p_{3} \left( 2 \right)} \right){\text{Lex}}\left( {p_{3} \left( 3 \right)} \right) \ldots {\text{Lex}}\left( {p_{3} \left( C \right)} \right) \), where \( {\text{Lex}}\left( {p_{3} \left( i \right)} \right) \) is the value of the \( \left( {C - i + 1} \right) \)th digit. Similarly, \( {\text{Lex}}\left( {fp} \right) \) is a \( 3N_{\text{a}} \)-digit number \( {\text{Lex}}\left( {w\left( 1 \right)} \right){\text{Lex}}\left( {z\left( 1 \right)} \right){\text{Lex}}\left( {v\left( 1 \right)} \right) \ldots {\text{Lex}}\left( {w\left( {N_{\text{na}} } \right)} \right){\text{Lex}}\left( {z\left( {N_{\text{na}} } \right)} \right){\text{Lex}}\left( {v\left( {N_{\text{na}} } \right)} \right) \). A total of \( 12P \) \( p_{4} \)s are obtained from a polychoron and its mirror image, where \( P \) is the number of peaks. By choosing the lexicographically smallest one, we can assign one unique \( p_{4} \) to a polychoron.

3.9 Non-1-Simple Polychora

A 1-simple polychoron has one or more peaks of degree more than three. By cutting such peaks and distinguishing cross-section polyhedra from other polyhedra, a one-to-one correspondence can be established between a non-1-simple polychoron and a 1-simple polychoron with cross-section polyhedra. By using this 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.

3.10 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 ‘\( \cdot \)’ 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 \( i \)th 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} \left( {2_{1} } \right) = p_{2} \left( {1_{1} } \right) = 3 \). Here, \( p_{2} \left( {i_{j} } \right) \) is the value of \( p_{2} \) of \( j \)th number of \( ps_{2} \) of the polyhedron \( i \). In general, when the face \( a_{b} \) is glued to the face \( x_{y} \), \( p_{2} \left( {a_{b} } \right) = p_{2} \left( {x_{y} } \right) \). The ridge is a part of a polychoron where two faces of polyhedra meet. Suppose that \( a < x \) and \( r_{t} \left( {a_{b} } \right) \) is the number of peaks of the ridge with a tentative ID \( a_{b} \). Then \( p_{2} \left( {a_{b} } \right) = p_{2} \left( {x_{y} } \right) = r_{t} \left( {a_{b} } \right) \). Since \( r_{t} \left( {a_{b} } \right) \) 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\left( 1 \right)r\left( 2 \right)r\left( 3 \right) \ldots r\left( R \right). $$

Here, \( r\left( i \right) \) 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_{4}^{{\left( {rs} \right)}} = rs = 33334443443433 \) (Fig. 6.32).

Fig. 6.32
figure 32

Ridge-sequence codeword [19]

3.11 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_{4}^{{\left( {rs} \right)}} = 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.

Fig. 6.33
figure 33

Relation between a local atomic arrangement and an assemblage of Voronoi polyhedra. Here, \( {D} = 5^{12} \) is \( {p}_{3} \) of the dodecahedron

4 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 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.