A Generalized Nomenclature Scheme for Graphene Pores, Flakes, and Edges, and an Algorithm for Their Generation and Numbering

In the present study, we generalize our recently proposed nomenclature scheme for porous graphene structures to include graphene flakes and (periodic) edges, i.e., nanographenes and graphene nanoribbons. The proposed nomenclature scheme is a complete scheme that similarly treats all these structures. Beyond this generalization, we study the geometric features of graphene flakes and edges based on ideas from the graph theory, as well as the pore–flake duality. Based on this study, we propose an algorithm for the systematic generation, identification, and numbering of graphene pores, flakes, and edges. The algorithm and the nomenclature scheme can also be used for flakes and edges of similar honeycomb systems.

Depending on their sizes, shapes, and edge structures, these structures exhibit a variety of different electronic, optical, and chemical properties [1, 10,22]. For instance, graphene nanoribbons with zig-zag termination were found to exhibit localized edge states, while their armchair counterparts do not [23], and for a mixed edge profile, having both zig-zag and armchair sites, non-negligible edge states were found to survive. The different electronic properties of graphene edges provide different reactivity and functionalization [24,25], as well as different reconstruction [26,27], and their optical properties make them potential candidates for optoelectronic, photocatalytic, and other applications [1,3]. Moreover, periodic arrangements of graphene nanostructures with different shapes are potential metamaterial absorbers based on surface plasmon resonance [28][29][30][31].
The infinite number of nanographenes and graphene nanoribbons, due to their different edge structures, and the increasing interest in them, give rise to the necessity for a nomenclature scheme, which would have the ability to accurately distinguish them from each other and provide a particular and accurate name for each such different structure.
So far, attempts for naming nanographenes are restricted to (a) the smaller members of polycrystalline aromatic hydrocarbons and (b) high symmetry flakes. For the former, empirical names have been adopted, for instance, coronene, ovalene, pentacene, pyrene, anthracene, etc. [10]. For the latter, there were attempts to classify them according to we showed that each such closed path (i.e., circuit) can be uniquely defined by the sequence of path lengths l i along the pore boundary connecting the 2-FCAs [34].
The term "non crossed" means that if we move along that path, each vertex and edge is visited only once. The term "closed path" or "circuit" means that the path begins and ends at the same vertex. In terms of graph theory, these properties describe both an Eulerian and Hamiltonian circuit. The term "path length" is also used from the point of view of graph theory, i.e., it is the number of edges along the path. For convenience, we use the term "2-2 path" for the path along the pore boundary connecting two adjacent 2-FCAs, and the term "2-2 hexagon" for the hexagon of the vacuum space associated with the 2-2 path, which contains the 2-2 path, i.e., the edges of the 2-2 path are edges of the associated 2-2 hexagon. As we showed in our recent work [34], the length l i of a 2-2 path i is an integer number between 1 and 4 (1 ≤ l i ≤ 4), and the sequence l 1 l 2 . . . l n 2 of the 2-2 path lengths l i uniquely determines a pore. However, there are many different sequences corresponding to the same pore, depending on the starting point and the direction one uses to travel along the pore boundary. For a one-to-one correspondence between pores and sequences, we select the "minimum image" of all possible sequences that one can find, starting from a different vertex of the circuit, and moving along it clockwise or counterclockwise. Considering that the different sequences l 1 l 2 . . . l n 2 corresponding to the same pore are n 2 -digit numbers composed of the l i digits (1 ≤ l i ≤ 4), the "minimum image" is the sequence representing the minimum of those numbers. According to the nomenclature scheme we proposed, a pore is named after the unique sequence of 2-2 path lengths l i provided by the "minimum image". That scheme provides an accurate, simple, and unique way to name pores. A pore with the minimum image sequence l 1 l 2 . . . l n 2 was proposed to be named as "the l 1 l 2 . . . l n 2 pore". The same nomenclature scheme is used here for naming graphene flakes and edges.
In Ref. [34], for pores, we introduced the term "edge vectors" e k . An edge vector e k is a vector attributed to the edge k of the pore circuit, where k serially numbers all edges (or vertices) of the pore boundary. The direction of e k is the direction one has, moving along the pore boundary counterclockwise, so that, if e k is directed from left to right, bottom to top, right to left, or top to bottom, the vacuum pore area is above, on the left, below, and on the right of the edge vector, respectively. For those edge vectors, we show that each vector e k of the pore boundary can be derived from the previous e k−1 vector. In particular, if the origin of e k (or equivalently the head of e k−1 ) coincides with the position of a 3-FCA, then e k can be derived by the rotation of e k−1 counterclockwise by +π/3. On the other hand, if it coincides with the position of a 2-FCA, then e k can be derived by the rotation of e k−1 counterclockwise by −π/3. Adopting the alternative notation e i,j for the edge vectors e k , where i denotes the 2-2 path and j the edge vector belonging to the i 2-2 path, and considering that R(φ) is the 2 × 2 rotation matrix for rotations in-plane by φ, we have e i,j+1 = R + e i,j , for 1 ≤ j ≤ 4 and 1 ≤ i ≤ n 2 , and e i+1,1 = R − e i,l i , for 1 ≤ i ≤ n 2 . In those relations, R ± = R(±π/3). Recalling that for in-plane rotations R(φ)R(θ) = R(θ)R(φ) = R(φ + θ) and taking into account that for a closed path, e n 2 +1,1 = e 1,1 , we find R n 2 − R n 3 + = R n 2 − R L−n 2 + = I, where I is the 2 × 2 unit matrix and L = l 1 + l 2 + . . . + l n 2 is the total length of the pore circuit. Thus, −n 2 π/3 + (L − n 2 )π/3 = 2k 0 π, In Ref. [34], we show that for pores, if e n 2 +1,1 = e 1,1 , then Equation (1) leads to the same result if k 0 = 1. However, Equation (1) shows that there are also many other solutions, depending on k 0 , for which e n 2 +1,1 = e 1,1 . The question, therefore, which rises, is what do the other cases for k 0 = 1 represent? These cases will be examined next.
As we have shown in Ref. [34], e i,j can be expressed through a rotation of e 1,1 . In particular, we showed that where and, consequently, φ n 2 +1,1 = (L + 1 − 2(n 2 + 1) + 1)π/3 = (L − 2n 2 )π/3. Thus, using Equation (1), we find φ n 2 +1,1 = 6k 0 π/3 = 2k 0 π, which for k 0 = 1 represents the angle of the full (2π) rotation of e 1,1 , which has already been examined in Ref. [34]. Therefore, for k 0 > 1, the rotation angle φ n 2 +1,1 of e 1,1 represents more than one full rotation. In that case, there are three options: (i) The pore circuit closes earlier, having the first full rotation for i = i 0 < n 2 + 1, i.e. φ i 0 +1,1 = 2π, (ii) the pore circuit crosses itself, or/and (iii) it forms a spiral. These cases obviously do not correspond to Eulerian and Hamiltonian paths, i.e., moving along those paths, either we visit the same vertex (or vertices) and edge (or edges) more than once, and/or the path does not close. A simple example of a circuit that closes earlier is a circuit that is repeated after its end, e.g., the 444444 path. The 444 path represents the smallest pore, which is formed if a single atom is removed from the graphene structure. For the 444 pore, L = 12 and n 2 = 3, satisfying Equation (2). The 444444 path is also a circuit, with L = 24 and n 2 = 6, satisfying Equation (1) for k 0 = 2. Moving along that path, we visit its vertices and edges twice, as shown in Figure 1a and, consequently, the path does not represent a pore. An example of a circuit that crosses itself is the circuit 23332333444, which is presented in Figure 1b. Both 444 and 23332333 paths represent pores and they are shown with different colors in Figure 1b. The 444 has already been mentioned above, and for the 23332333 path, L = 22 and n 2 = 8, also satisfying Equation (2). The 23332333444 path, with L = 34 and n 2 = 11, satisfies Equation (1) for k 0 = 2. Moving along this path, we visit three vertices and two edges twice. An example of a spiral path, (which is not a circuit), is the 442242222422222422222242222224 path, which is shown in Figure 1c. This spiral path satisfies Equation (1) for k 0 > 1, while its vertices and edges are not visited more than once, as we travel along it.   Different colors of edge vectors and 2-FCAs indicate the first and second circle (i.e., the path for which L = 2n 2 + 6). The black arrow in (a,b) indicates the starting vertex. (d,e) A pore and its dual flake, respectively. Shaded hexagons and dark yellow colored sticks represent the graphene bulk area and bonds between the three-fold coordinated atoms. Red and blue colored arrows represent edge vectors in the pore and flake boundaries, respectively. Red-colored edge vectors have opposite directions compared to their blue counterparts. (h) Periodically arranged edge vectors with L = 2n 2 forming an edge. The blue arrow represents the period.
In conclusion, cases for k 0 > 1 represent either spiral or crossed paths, with no interest in the present work since they do not represent pores.

Graphene Flakes
The case for k 0 = −1 corresponds to a rotation angle φ n2+1,1 = −2π, which corresponds to a clockwise rotation. Following the same convention as the one used for pores, regarding the relative position of the vacuum space with respect to the direction of the edge vectors, it is easy to understand that a closed and non-crossed path with φ n2+1,1 = −2π forms a flake, as can be seen in Figure 1e. For comparison, Figure 1d shows its counterpart pore structure. In accordance with paths or circuits corresponding to rotation angles φ n2+1,1 = 2k 0 π, with k 0 > 1, the paths or circuits corresponding to rotation angles φ n2+1,1 = 2k 0 π with k 0 < −1 are similar but rotated clockwise. In conclusion, no interesting circuits or paths can be obtained for k 0 < −1, while the case for k 0 = −1, which yields corresponds to graphene flakes. As in pores, where Equation (2) is a necessary but not sufficient condition for a closed path [34], Equation (6) is a necessary, but not sufficient condition for a closed path in the flakes. In accordance with our study for pores [34], the position vectors of the vertices (atoms) at the flake boundary are where v m = a 0 cos mπ 3 , sin mπ 3 , m = 0, 1, 2, 3, 4, 5, and h i is the position vector of the center of the 2-2 hexagon i, as shown in Figure 1f. The indices i and j are the same as those used in the notation of the edge vectors e i,j , and m i,j are integer numbers between 0 and 5, with where k is given in Equation (4). Moreover, where as shown in Figure 1g, (see Ref. [34] for more details). For a closed path, h n 2 +1 = h 1 , i.e., where according to Equations (10) and (4), Equations (2) and (13) are the necessary and sufficient conditions for a close path. However, they still are not enough to determine a flake boundary, since they do not ensure that the path is not a crossed path. As we showed for pores [34], a non-crossed path is the one for which (i) two 2-2 hexagons do not have common edges belonging to the pore boundary and (ii) traveling along the pore boundary, the corresponding 2-2 hexagons are not visited more than once unless some of them are visited twice. For those visited twice, the lengths of the associated 2-2 paths must be 1 and their sole edge vectors must have opposite directions. For the same reason, these conditions should also be satisfied for flakes.

Graphene Edges
For k 0 = 0, Equation (1) yields L/n 2 = 2. In terms of the rotating angle φ i,j , one can see that φ n 2 +1,1 = 0. Assuming that a path with φ n 2 +1,1 = 0 is not a crossed path, the edge vectors of that path will be rotated negatively and positively, so that at the end, the overall rotation angle will be zero. Even if for some specific i and j indices of e i,j , φ i,j ≥ 2π, or φ i,j ≤ −2π, these rotations will be followed by opposite rotations, which at the end will lead to a zero overall rotation for the final edge vector e n 2 +1,1 . This means that that path will not be able to close and, therefore, it does not represent a pore or a flake. Assuming that the l 1 l 2 . . . l n 2 sequence is repeated, as can be assumed in a pore or a flake circuit, the starting edge vector e n 2 +1,1 of the first repetition will be the same as the starting edge vector e 1,1 ; consequently, the whole repeated path will be arranged parallel to the initial l 1 l 2 . . . l n 2 path. This will also happen for all repetitions that follow, and the overall path will form a periodic edge, which divides the plane into the vacuum and a semi-infinite graphene structure (see Figure 1h). In conclusion, the case k 0 = 0 of Equation (1) can be considered as corresponding to an infinite periodic graphene edge, which is obviously characterized by the l 1 l 2 . . . l n 2 sequence, and can be named after it. For a one-to-one correspondence between edge names and l 1 l 2 . . . l n 2 sequences, the minimum image could be selected for the smallest period. In that case, n 2 is the number of 2-FCAs (or 2-2 paths) in that smallest periodic arrangement of atoms at the boundary, e.g., the edge 131313 . . . will be named "the 13 edge", with n 2 = 2.
As in pores and flakes, a boundary path representing an edge should not be a crossed path. The conditions for a non-crossed path in the edges are the same as those in pores and flakes.
It is worth noting that in the case of a path l 1 l 2 . . . l n 2 corresponding to a graphene edge, the average length of 2-2 paths L/n 2 is L/n 2 = 2, while for pores and flakes, L/n 2 > 2 and L/n 2 < 2, respectively.

Flakes and Flake-Pore Duality
Obviously, a circuit representing a pore boundary can be either considered the boundary of a pore, or the boundary of a flake, depending on the side where the vacancies are. A flake boundary can be considered (in several cases) the dual of a pore boundary, and vice versa, although, as we have already mentioned in the introduction and will explain below, not all pores have a flake as a dual, and not all flakes have a pore as a dual.
If the dual exists, then for the transformation of a pore to its dual flake, and the transformation of a flake to its dual pore, we consider the following: • The dual of the dual of a pore (flake) is the pore (flake) itself. As a consequence, the dual is unique, i.e., there is a one-to-one correspondence between a pore and its dual flake and between a flake and its dual pore. If this is not true, we consider that the dual of a pore or flake does not exist. • The pore (or flake) boundary is the same as that of its dual. The difference is that the edge vectors of the pore (flake) boundary have opposite directions compared to those of its dual flake (pore). This convention for the direction of edge vectors is used so that we have the same determination of the vacuum area and graphene bulk area, regarding their relative position, with respect to the direction of the edge vectors (see above). • Excluding the atoms of the boundary, all other atoms are transformed into vacancies and vacancies are transformed into atoms.
The above can be seen in Figure 1d,e, which schematically shows a pore and its dual flake, respectively. As a consequence of the above, the boundary of the pore (flake) dual is again formed by a sequence of 2-2 paths, which are different from the 2-2 paths of the pore (flake) boundary, but they both have the same number of edges and vertices and, consequently, the same length L. Moreover, 2-FCAs of a pore (flake) are transformed into 3-FCAs in its dual flake (pore) and vice versa. Thus, n 2p = n 3 f and n 3p = n 2 f , where n 2p and n 2 f are the numbers of 2-FCAs in the pore and its dual flake, respectively, and n 3p and n 3 f are the numbers of 3-FCAs in the pore and its dual flake, respectively.
Considering that n 3p = L − n 2p , Equation (2) yields n 3p − n 2p = 6. Thus, using the above relations, n 3p = n 2 f and n 2p = n 3 f , Equation (2) which is exactly the same as Equation (1), for k 0 = −1 and, consequently, consistent with the discussion of Section 2.1.1, for k 0 = −1. Therefore, it is evident that if a pore boundary has n 2 2-2 paths, its dual has L − n 2 2-2 paths, and vice versa.
In Ref. [34], we showed that the maximum number of adjacent 2-2 paths with length l i = 1 in a pore boundary is three, as shown schematically in Figure 2a. It is worth noting that, excluding the case of the hexagonal 111111 flake, the restriction of the maximum three adjacent 2-2 paths with length l i = 1 is also valid for flakes, for the same reason as in pores (see Ref. [34]). Moreover, in the same work, we showed that a 2-2 hexagon of a pore cannot be visited more than once as we travel along the path of the pore boundary unless there are only two 2-2 paths corresponding to the same 2-2 hexagon with lengths l = 1, and their sole edge vectors having opposite directions. Such a case can be seen in the pore shown schematically in Figure 2c. This restriction also applies to flakes for the same reason it applies to graphene pores. The transformation of a flake to a pore and then the transformation of that pore to a flake. Excluding atoms in the pore or flake boundary, which remain atoms, all other atoms are transformed into vacancies and vice versa. The final pore of (a) and flake of (b) is not the same as the initially transformed one. The blue and red arrows in (a,b) represent edge vectors at the flake and pore boundaries, respectively. A pore (c) and a flake (d) with two 3-FCAs, which are not adjacent along the pore or flake boundary, and are bonded with each other. The bond is shown in blue. The circuit formed by connecting the centers of hexagons adjacent to the edges of the pore or flake boundary (green arrows) is not the Eulerian circuit when the dual does not exist.
Let us now examine cases of flakes that do not have a pore as a dual and pores that do not have a flake as a dual. Pores or flakes that include three adjacent 2-2 paths in their boundaries with length l i = 1 do not have a dual, as shown in Figure 2a,b. In such pores, those three 2-2 paths are edges of the same hexagon, which is part of the graphene bulk. In the transformation of such a pore to its dual flake, the hexagon remains part of the flake. Thus, the derived flake has a different boundary compared to that of the pore. Therefore, the derived flake does not have a one-to-one correspondence with the transformed pore, as Figure 2a shows; consequently, such a pore does not have a dual. For the same reason, a flake with more than two adjacent 2-2 paths with length l i = 1 does not have a dual pore, as Figure 2b shows.
The above cases are not the only cases for which a pore or a flake does not have a dual. In fact, those cases can be considered as special cases of a more general one, where two 3-FCAs of the pore (or flake) boundary, which are not adjacent along the pore (or flake) path, are bonded with each other. The reason is that the transformation from the pore to the flake (or from the flake to the pore) is expected to be accompanied by the conversion of 3-FCAs to 2-FCAs. However, two such 3-FCAs of the pore or flake boundary will remain 3-FCAs in the transformation from the pore to the flake or from the flake to the pore since their bond will not be lost in the transformation. Thus, those atoms will not be converted to 2-FCAs, and the converted structure will have a different boundary compared to the initial one, not allowing the transformed one to be considered as the dual of the initial one. This can be clearly seen in the examples shown schematically in Figure 2c,d for a pore and a flake, respectively. From a different point of view, a flake or a pore does not have a dual if the closed path connecting the centers of the hexagons, which are adjacent to the pore boundary and are part of the flake or the graphene bulk (for pores), is not the Eulerian circuit. This means that if traveling along that path we visit the same edge more than once, (as shown in Figure 2c,d), then the dual does not exist.
If the dual of a pore (or a flake) exists, the conversion of the pore (or the flake) to its dual implies the replacement of 2-FCA vertices and 2-2 paths of its boundary to other 2-2 paths, according to the following scheme: (i) The central edge vector e i,2 of a 2-2 path i with l i = 3 is replaced by a 2-2 path with length l = 1; (ii) The central edge vectors e i,2 and e i,3 of a 2-2 path i with l i = 4 are replaced by two adjacent 2-2 paths with length l = 1; (iii) The e i,l i and e i+1,1 edge vectors of the 2-2 paths i and i + 1 with lengths l i ≥ 2 and l i+1 ≥ 2 are replaced by a 2-2 path with length l = 2; (iv) Two adjacent 2-2 paths i and i + 1 with lengths l i = l i+1 = 1 appearing between two other 2-2 paths with lengths l i−1 > 1 and l i+2 > 1, and their adjacent edges, e i−1,l i−1 and e i+2,1 , are replaced by a 2-2 path with length l = 4; (v) A 2-2 path i with length l i = 1 appearing between two other 2-2 paths with lengths l i−1 > 1 and l i+1 > 1, and their adjacent edges e i−1,l i−1 and e i+1,1 are replaced by a 2-2 path with length l = 3. For example, the dual of the 444 pore is the 112112112 flake. The transformations are shown schematically in Figure 3.
Considering that in a flake circuit with a total length L, there are n (1) , n (2) , n (3) , and n (4) 2-2 paths with lengths 1, 2, 3, and 4, respectively, the total length L of the circuit is L = 1 · n (1) + 2 · n (2) + 3 · n (3) + 4 · n (4) , and the total number of 2-2 paths, n 2 = n (1) + n (2) + n (3) + n (4) . Recalling that for flakes L = 2n 2 − 6 and combining all these equations, we find n (1) + 2n (2) + 3n (3) + 4n (4) = 2(n (1) + n (2) + n (3) + n (4) ) − 6 or The quantities n (3) and n (4) are positive numbers or zero. Thus, the above equation yields n (1) − 6 ≥ 0 or n (1) ≥ 6, which means that a flake circuit does not exist, not including at least six 2-2 paths with length l = 1.  An interesting question that needs to be answered has to do with the number N of atoms constituting a flake. Using the same strategy as the one used to find the number of vacancies in a pore (see Ref. [34]), we can consider that if the number of hexagons constituting a flake is n h , then those hexagons have 6n h vertices in total. The vertices corresponding to 2-FCAs in the flake boundary are not shared between those hexagons, while the 3-FCAs in the flake boundary are shared by two, and all other 3-FCAs are shared by three. Assuming that the number of all other 3-FCAs is n v , then 6n h = n 2 + 2n 3 + 3n v and N = n 2 + n 3 + n v . This means that 6n h = 3N − 2n 2 − n 3 . Recalling that n 2 + n 3 = L and L = 2n 2 − 6, the last equation A method used to count the hexagons of a flake is very similar to the method used to count the hexagons in the pore vacuum area, which has been described in Ref. [34]. This method is presented below. Let us assume that the h i vectors determining the 2-2 hexagons are h i = λ a,i a + λ b,i b = (λ a,i , λ b,i ) h , and λ a,i between a min and a max , (i.e., a min ≤ λ a,i ≤ a max ), where a = √ 3a 0 ( √ 3/2, 1/2) and b = √ 3a 0 (0, 1) are the lattice vectors in the Cartesian coordinates of the hexagonal graphene lattice, as shown schematically in Figure 4, where a 0 = 1.42 Å is the bond length in graphene. The subscript h of the above notation is used to distinguish the coordinates expressed in the base of a and b from the corresponding Cartesian coordinates. Let us further consider that h = (λ a , λ b ) h is a vector pointing to the center of a hexagon belonging to the flake. As one can see in Figure 4, a min + 1 ≤ λ a ≤ a max − 1. In the same figure, one can see that there are 2-2 paths associated with specific 2-2 hexagons, which include the edge vectors e i,j = v 0 and e i ,j = v 3 depicted by red colored arrows pointing to the right and to the left, respectively. Therefore, it is evident that the hexagons belonging to the flake are those between those 2-2 hexagons, which have as the upper bound the 2-2 path, which includes the e i,j = v 0 vector, and the lower bound, the one including the e i ,j = v 3 vector. Noting that the position vectors of the vertices at the origin of the edge vectors e i,j = v 0 and e i ,j = v 3 are r i,j = h i + v 4 and r i ,j = h i + v 1 , respectively, (see Equation (9) and Figure 4), the hexagons belonging to the flake, which are between h i and h i can be equivalently determined by the m i,j values of their associated 2-2 paths. Thus, if (i) for h i = (λ a , λ b1 ), ∃ j ∈ [1, l i ] : m i,j = 4, (ii) for h i = (λ a , λ b2 ), ∃ j ∈ [1, l i ] : m i ,j = 1, and (iii) λ b1 > λ b2 , then there are λ b1 − λ b2 − 1 hexagons belonging to the flake between the 2-2 hexagons determined by h i and h i . Those hexagons belonging to the flake can be determined by the vectors (λ a , λ b ), with λ b2 + 1 ≤ λ b ≤ λ b1 − 1. This can also be used to find the positions of the flake atoms. Summing the numbers of these hexagons for each different λ a value in the range a min + 1 ≤ λ a ≤ a max − 1, we can find n h , and then using Equation (16), we can find N.  A graphene edge can be considered a non-crossed, non-closed, and theoretically infinite path, dividing the honeycomb lattice into two discrete areas. One of them only has vacancies and the other one is the remaining graphene structure. Practically, however, a graphene edge is part of the boundary of a typically large graphene flake and not the boundary of a semi-infinite plane. Therefore, in terms of graph theory, a graphene edge is both an Eulerian and Hamiltonian path, which, contrary to the boundaries of flakes and pores, is a path and not a circuit. Such a path should not form a spiral because a spiral might correspond to a non-crossed and non-closed infinite path, but it does not divide the honeycomb lattice plane into the two discrete areas described above.
From the point of view of an infinite path, the graphene edge can be considered periodic. Even if it is not periodic, it can be considered periodic with infinite periodicity. Let us assume that the smallest possible period of a specific edge is represented by the sequence l 1 l 2 . . . l n 2 of 2-2 paths with length L = l 1 + l 2 + . . . l n 2 , where n 2 is the number of 2-FCAs in the period. It is worth noting that the length L is the period of edge lengths at the boundary. This means that after the sequence l 1 l 2 . . . l n 2 , another such sequence will follow, and the edge will be a repeated sequence of 2-2 paths of the form (l 1 l 2 . . . l n 2 )(l 1 l 2 . . . l n 2 )(l 1 l 2 . . . l n 2 ) . . .. Obviously, there is no reason for Equation (3) not to be valid; therefore, the angle φ i,j between the edge vector e i,j at the graphene edge boundary and the e 1,1 (first edge vector of the period) is again given by Equation (5). As already reported in Section 2.1, for an infinite (not closed) path, the angle φ l n 2 +1,1 of the first edge vector of the second period should be φ l n 2 +1,1 = 0. If it is not zero, then at each period, the angle will increase (or decrease) by a multiple of π/3, and finally, the path will either cross with itself or will close, thus not forming an infinite periodic edge. For instance, if φ l n 2 +1,1 = π/3, then φ 2l n 2 +1,1 = 2π/3, φ 3l n 2 +1,1 = 3π/3, φ 4l n 2 +1,1 = 4π/3, φ 5l n 2 +1,1 = 5π/3, and φ 6l n 2 +1,1 = 2π, and the considered periodic edge will form a pore unless it crosses with itself during the repetitions, which again does not form an edge. Negative multiples of π/3 for φ l n 2 +1,1 produce flakes and positive multiples produce pores. It is, therefore, clear that for an infinite periodic edge, φ l n 2 ,1 = φ 1,1 = 0, corresponding to k 0 = 0 in Equation (1), or L/n 2 = 2, which, as already explained, is the average path length. A question that rises is whether or not there are specific combinations of path lengths for which L/n 2 = 2. Assuming that the periodic path is composed by n (1) , n (2) , n (3) , and n (4) 2-2 paths with lengths 1, 2, 3, and 4, respectively, the last equation yields n (3) + 2n (4) = n (1) .
The independent integer solutions of this equation are (i) n (1) = 0, n (2) = 1, n (3) = 0 and n (4) = 0; (ii) n (1) = 1, n (2) = 0, n (3) = 1 and n (4) = 0; or (iii) n (1) = 2, n (2) = 0, n (3) = 0 and n (4) = 1. This means that any combinations of the sets (i) A = {2}, (ii) B = {1, 3} and/or (iii) C = {1, 1, 4} of 2-2 path lengths provide an infinitely periodic path, unless that path crosses itself, and any infinitely periodic path is composed of the combinations of the above sets of 2-2 paths. This does not mean that those sets of 2-2 paths should necessarily follow one another in the periodic l 1 l 2 . . . l n 2 sequence. The members of those sets may mix with each other, but the sequence l 1 l 2 . . . l n2 should be composed of a certain number of those sets. Thus, if λ 2 , λ 13 , and λ 114 are the numbers of A, B, and C sets in the periodic l 1 l 2 . . . l n 2 sequence, respectively, then n (1) = 2λ 114 + λ 13 , n (2) = λ 2 , n (3) = λ 13 , and n (4) = λ 114 . It is worth noting that the . . . 2222 . . . edge is the well-known zig-zag edge, while the . . . 131313 . . . is also the well-known armchair edge. Moreover, it is worth noting that when adding any combination of the above sets of 2-2 paths in a pore or flake circuit, Equation (2) (for pores) and Equation (6) (for flakes) are still satisfied. On the other hand, this does not mean that by adding such a combination in the pore or flake boundary circuit, the derived path is still a circuit.
The last task for periodic edges is the construction of the semi-infinite structure, which is terminated in the l 1 l 2 . . . l n 2 periodic edge. Obviously, the structure, which will be constructed, cannot be semi-infinite. The only option is to construct a periodic flake representing a ribbon, which can have a large width, and may be terminated with hydrogen atoms so that it can be used for simulations on edges. The idea, therefore, is to find the corresponding 2-2 hexagons represented by their h i vectors pointing to their centers, in accordance with flakes. Then, we can use the same method to find the coordinates of the flake hexagon centers, according to the method described for flakes, and finally, construct the structure.

An Algorithm for the Numbering, Identification, and Generation of Graphene Flakes and Edges
The algorithm we present is based on the algorithm used for the numbering, identification, and generation of graphene pores (see Ref. [34]). Let us assume that we want to find all possible sequences of l 1 l 2 . . . l n 2 , 1 ≤ l i ≤ 4 representing a flake or the minimum period of an edge composed of n 2 2-2 paths. According to what has been reported previously, the total length L = l 1 + l 2 + . . . + l n 2 of the flake circuit is L = 2n 2 − 6, while the corresponding length (minimum period) L of an edge is L = 2n 2 . Thus, as a first step, the algorithm, using a nested DO-loop, searches for all possible combinations of l 1 l 2 . . . l n 2 for which l 1 + l 2 + . . . + l n 2 = 2n 2 − 6 (for flakes), and l 1 + l 2 + . . . + l n 2 = 2n 2 (for edges). If the algorithm finds such a sequence, it moves to the next step. Otherwise, it rejects that sequence and moves to the next sequence.
Recalling that for flakes n (1) ≥ 6, it is obvious that the first digit l 1 of the minimum image for flakes will always be l 1 = 1. Moreover, according to Equation (18) for edges, n (1) ≥ 0, with n (1) being zero only if n (3) = n (4) = 0, i.e., only if n (2) = 0. There is only one such case representing the zig-zag edge (i.e., the 222 . . . edge) corresponding to the sole 2-2 path sequence with l 1 = 2 and n 2 = 1. Thus, excluding that case, the first 2-2 path length of the minimum image will always be l 1 = 1. Consequently, with l 1 = 1 for both flakes and edges, the search for the possible l 1 l 2 . . . l n 2 sequences is restricted to the values of the l 2 , l 3 , . . ., l n 2 , reducing the effort by four times. Moreover, recalling Equation (15), one can see that for constant n (4) , if n (3) increases by 1, n (1) also increases by 1, and for constant n (3) , if n (4) increases by 1, n (1) increases by 2. This means that the sequence l 1 l 2 . . . l n 2 of a flake is constituted by six paths with length 1, maybe some others with length 2 and/or an amount of (114) and (13) path sections. All these paths or path sections may be mixed with each other in the l 1 l 2 . . . l n 2 sequence. Thus, any combination of them, which leads to the minimum image of the l 1 l 2 . . . l n 2 sequence, will start with either l 1 = l 2 = 1 or l 1 = 1 and l 2 = 2. This means that l 2 = 3 or 4; consequently, this reduces the computational effort by another 1/2 (i.e., totally 1/8).
The second step of the algorithm checks whether or not the sequence l 1 l 2 . . . l n 2 represents the minimum image of the equivalent sequences, representing the same flake or edge. In the serial search for l i s, imposed by the nested DO-loops, with the outer one corresponding to l 2 and the inner ones to l 3 , l 4 , etc., the minimum image will be reached first. Thus, if the algorithm finds a sequence l 1 l 2 . . . l n 2 not corresponding to the minimum image, it means that the corresponding minimum image has already been found and examined earlier. In that case, the l 1 l 2 . . . l n 2 sequence is rejected and the algorithm moves to the next l 1 l 2 . . . l n 2 sequence.
In the third step, the algorithm checks whether or not l 1 = l 2 = l 3 = l 4 = 1. As already reported above, such a sequence does not represent a flake or an edge, unless it is the 111111 flake. Therefore, if such a part of the l 1 l 2 . . . l n 2 sequence is found, the sequence is again rejected, and the algorithm moves to the next l 1 l 2 . . . l n 2 sequence. It is worth noting that if the first four digits l 1 l 2 l 3 l 4 of the l 1 l 2 . . . l n 2 sequence are not all "1"s, then the sub-sequence 1111 will not appear elsewhere in the l 1 l 2 . . . l n 2 sequence because if such a sub-sequence has to appear, it should appear in the first digits, due to the minimum image convention. Therefore, this check is enough to ensure that a sub-sequence of 1111 will not appear anywhere else in the l 1 l 2 . . . l n 2 sequence.
In the fourth step, the algorithm calculates the m i,l i values using Equation (14), and in the fifth step, it calculates the h i vectors using Equation (11), i.e., summing the u m i,l i vectors. The calculated m i,l i values and h i vectors are stored for further processing. For convenience, the algorithm starts with m 1,1 = 0 and h 1 = (0, 0), and in the summations of Equation (11), the u m vectors are expressed as In the sixth step, which applies to flakes, but not to edges, the algorithm checks if Equation (13) is satisfied, i.e., if the path is a circuit. If Equation (13) is not satisfied, the sequence l 1 l 2 . . . l n 2 is rejected, and the algorithm moves to the next sequence. Otherwise, it moves to the seventh and eighth steps, which apply both to flakes and edges, and checks if the circuit or path crosses itself. In the seventh step, the algorithm compares the h i vectors between each other. If ∃ i and i for which h i = h i , then if (i) l i = 1 = l i , or (ii) l i = l i = 1, but v i,l i = −v i ,l i , the sequence l 1 l 2 . . . l n 2 is rejected, and the algorithm moves to the next sequence. If for all cases for which h i = h i , it finds that l i = l i = 1 and v i,l i = −v i ,l i , the algorithm moves to the next step, finding whether or not two adjacent 2-2 hexagons have a common edge, which belongs to the flake or edge boundary. For that reason, the algorithm checks if ∃ i and i , for which −1) h , and m i,j = 5, m i ,j = 2. If any of the above cases is true, the 2-2 hexagons determined by h i and h i are adjacent with a common edge, which belongs to the flake boundary. The existence of an m i,j value in a 2-2 path depends on the values of l i and m i,l i , according to the relation [34] which is used by the algorithm. If any of the above cases is true, the l 1 l 2 . . . l n 2 sequence is rejected, otherwise, the sequence represents a graphene flake, which is numbered and exported as the output. In particular, for edges, the algorithm performs those checks of steps seven and eight, for the minimum period and for two periods, to ensure that the path of the current and the next period do not cross each other. To minimize the computational time for this procedure, the algorithm performs the above tests (i) for the h i and h i vectors, which correspond to the same period, and (ii) for the h i and h i + L vectors, belonging to the current and the next period, respectively, where L = ∑ i=1 u i is the period. Therefore, it does not perform those tests for vectors h i + L and h i + L, both belonging to the next period, which would not provide any new information that is not known from the tests performed in the current period.
The above procedure is repeated recursively for all possible l 1 l 2 . . . l n 2 sequences. If our aim is to find and number the l 1 l 2 . . . l n 2 sequences representing flakes or edges, the algorithm has to do nothing more than the above steps. If, on the other hand, we also want to find the number of atoms in the flake or the structure (atomic position) of the flake and edge, some extra steps are needed.
To find the number N of atoms in a flake, we find the number n h of hexagons in the flake first, using the method described in Section 2.2. Then, using Equation (16), we find N. Thus, the eighth step of the algorithm, which will follow each successful l 1 l 2 . . . l n 2 sequence, is the following: (a) The algorithm finds the maximum a max and the minimum a min coordinates along the a direction of the h i = (λ a , λ b ) h vectors. If h = (λ a , λ b ) h is a vector pointing to the center of a hexagon belonging to the flake area, then a min + 1 ≤ λ a ≤ a max − 1. The details of these results can be found in Ref. [34]. The values of m i,l i are calculated in the fourth step of the algorithm, see above. Having this information, and the ordered λ b values, the algorithm finds the number of hexagons for each λ a value in the range [a min + 1, a max − 1] and sums them to find n h . During this step, the algorithm stores the coordinates (λ a , λ b ) h of the h vectors, pointing to the center of the flake hexagons. Those vectors are used in the next step for the determination of the flake structure.
Considering that the hexagonal graphene structure can be constructed by vectors the flake structure can be found using the h = (λ a , λ b ) h vectors, which were found in the previous step, and the vectors h i corresponding to the 2-2 hexagons. Thus, the positions of the flake atoms are determined by (i) the vectors R 1 = h + v 4 and R 2 = h + v 5 , for each h vector, (ii) the vectors R 1 = h i + v 4 , if ∃ j : m i,j = 4, for 1 ≤ j ≤ l i , and (iii) the vectors R 2 = h i + v 5 if ∃ j : m i,j = 5, for 1 ≤ j ≤ l i . In a similar way, we may find the structure of a ribbon that has the edge of interest, as described above.

Results and Discussion
Using the algorithm described above, we developed two Fortran codes, which can be found at https://github.com/fthenak/Graphene-Pores-Flakes-Edges (accessed on 3 July 2023). The first one with the name "pore_flake_edge_generation.f90" takes as input (i) the system kind (i.e., pore, flake, or edge) and (ii) the number n 2 of 2-FCAs in the boundary of each system, and provides as output (i) the number n 2 :m of each pore, flake, or edge, (ii) the corresponding minimum image of the l 1 l 2 . . . l n 2 sequence, and (iii) the length L of the pore or flake circuit, or periodic edge path. Moreover, for flakes, it provides (iv) the number of hexagons of the flake and (v) the number of atoms constituting the flake, and for pores, (iv) the number of hexagons in the vacuum area and (v) the number of vacancies. The second code with the name "pore_flake_edge_structure.f90" takes as input (i) the system kind (i.e., pore, flake, or edge), (ii) the number n 2 of 2-FCAs in the boundary of each system, and (iii) the sequence l 1 l 2 . . . l n 2 in separated digits. For the case of pores, a width d of atoms around the pore is also an input, considering that pores are periodically arranged in the infinite graphene sheet. If that sequence corresponds to the selected system (pore, flake, or edge), it provides as output (i) the structure in the xyz format, which is stored in a file under the name "structure.xyz", (ii) the corresponding minimum image of the sequence, (iii) and the length L of the circuit or path. Moreover, (a) for a flake, it provides (iv) the number of hexagons and (v) the number of atoms in the flake, (b) for a pore, (iv) the number of hexagons in the vacuum area and (v) the number of vacancies, and (c) for an edge, (iv) the number of ribbon atoms and the vector period L. Those codes are extensions of the codes pore_generation.f90 and pore_structure.f90, which were developed exclusively for pores and can be found in the Supplementary Information of Ref. [34].
Using the first code, we find the number of graphene flakes (N f ) and periodic edges (N e ) for different numbers n 2 of 2-FCAs in their boundaries. In Table 1, we present those numbers as functions of n 2 . For comparison and completeness, in the same table, we also present the corresponding numbers of different graphene pores (N p ), which are presented in Ref. [34]. In the same table, in parenthesis, we present the number of pores (d p ) and flakes (d f ), which have a dual. Recalling that the length L of the circuit of a flake or a pore is the same as the length of its dual, and for a pore L = 2n 2p + 6, while for a flake L = 2n 2 f − 6, we conclude that for flakes and pores with the same length L, n 2 f = n 2p + 6. This means that the number of flakes and pores with the same length L should have the same number of duals. This is clearly shown in Table 1, where the number of pores that have a dual for n 2 = n 2p is the same as the number of flakes, which have a dual for n 2 = n 2 f = n 2p + 6, e.g., for n 2 = 12, d p = 517, and for n 2 = 18 = 12 + 6, d f = 517. Moreover, Table 1 shows that most of the pores have a dual, contrary to flakes, where only a few of them have a dual, indicating that for the same L, N f >> N p , while for the same n 2 , N p >> N f .
Using a semi-logarithmic plot, we present the results of Table 1 in Figure 5a, and we fit logarithmic quadratic functions of the form log(N) = an 2 2 + bn 2 + c to those points. The fitted functions are presented in the legends of that figure. As one can see, they fit almost perfectly (particularly for large n 2 values) to the (N, n 2 ) points. It is worth noting that a simple logarithmic linear function of the form log(N) = an 2 + b does not have the same fitting quality as the logarithmic quadratic one, although the coefficients of the quadratic terms in all three cases are relatively small. In Tables 2 and 3, we present the minimum image sequences l 1 l 2 . . . l n 2 of flakes with n 2 ≤ 15 and periodic edges with n 2 ≤ 7, respectively, which were found using the abovementioned pore_flake_edge_generation.f90 code. In the same tables, the corresponding flake and edge numbers n 2 :m are also presented, as well as the length L of the circuit of the flakes and paths of the edge periods, respectively. Moreover, Table 2 also contains the number n h of flake hexagons and the number N of atoms in the flake. The star symbol (*), which appears in some lines of Table 2, indicates that the flake corresponding to that line has a dual. Table 2. All possible flakes for n 2 ≤ 15. The table shows the flake numbering n 2 :m, the sequences l 1 l 2 . . . l n 2 , the number of atoms N and hexagons n h in the flake, and the length L of the flake circuit. The star symbol (*), which appears in some lines, indicates that that flake has a dual.  For completeness, we present in Figure 5b the computational time versus n 2 for the execution of the pore_flake_edge_generation.f90 code, for the generation and numbering of the pore, flake, and edge l 1 l 2 . . . l n 2 sequences, using an Intel(R) Xeon(R) Gold 6132 CPU @ 2.60 GHz processor, with the ability of 761.6 GFlops. As one can see, the computational time for those calculations rises exponentially with n 2 , as expected. The computational time used for flakes seems to be ≈3 times smaller than that for pores and edges, which can be explained due to the reduction of searches for the l 1 l 2 . . . l n 2 sequences, only for l 3 , l 4 , . . . , l n 2 , since l 1 = 1 and l 2 is either 1 or 2, while pore l 1 = 1 or 2, and edge l 1 = 1. Moreover, for the edges, the algorithm does not have to check if the path is closed or not, contrary to the flakes and pores, while for flakes and pores, it also finds the number of flake atoms and the number of vacancies, respectively, which explains the lower slope of the fitted logarithmic lines for edges compared to the slopes for flakes and pores. Table 3. All possible periodic edges with a period including n 2 ≤ 7 2-fold coordinated atoms at the edge boundary. The table shows the number n 2 :m of each edge, the sequence l 1 l 2 . . . l n 2 corresponding to the minimum period, and the corresponding length L of the periodic edge path, (L = 2n 2 ).