Locally repairable codes based on permutation cubes and Latin squares

The importance of Locally Repairable Codes (LRCs) lies on their applications in distributed storage systems (DSSs). There are two approaches to repair multiple failed nodes: the parallel approach, in which a set of failed nodes are simultaneously repaired; and the sequential method, wherein the failed nodes are repaired successively by making use of known nodes, including those already repaired. LRCs in the joint sequential-parallel mode were investigated with the aim of reducing the repair time in the sequential mode, and in this study, we continue the investigation by providing LRCs with higher repair tolerance. We propose a construction of generator matrices for binary LRCs based on back-circulant Latin squares and t-dimensional permutation cubes. The codes based on back-circulant Latin squares have locality r = 5 and availability t ⩾ 4 in the parallel mode and, in the case where t + 1 is neither even nor a multiple of 3, they possess a short block length compared to their counterparts [18], [21]. We present LRCs based on t-dimensional permutation m-cubes with block length mt, locality r = 2m - 3, and availability t ⩾ 3 in parallel mode. These codes can repair any set of failed nodes of size up to 2t - 1 in the sequential mode in at most t - 1 steps. It is shown that these codes are overall local with repair tolerance 2t in the parallel mode. Finally, we introduce the LRC-AL class of codes, a new class of LRCs which satisfies the property that for any pair of nodes i, j, there is a repair set for the failed node i that contains the live node j.


I. INTRODUCTION
Distributed storage systems (DSSs) are used to store large amounts of data and improve reliability by distributing data over multiple storage nodes. Locally repairable codes (LRCs) are important because of their applications in DSSs. Let C denote an rn, k, ds linear code with block length n, dimension k, and minimum distance d. The i-th coordinate of C, where 1 ď i ď n, is said to have locality r if the value at this coordinate can be repaired by accessing at most r (r ! k) other coordinates and performing a linear computation with them. Furthermore, if the i-th coordinate, 1 ď i ď n, can be repaired by accessing r i other coordinates (referred to as a repair set), then, C is called an LRC with locality r " maxtr i |1 ď i ď nu and average localityr " 1 n ř n i"1 r i . Codes with locality r were proposed independently in [1]- [3]. The average locality was investigated in [4], [5] and a lower bound onr was given, which is useful for single erasure (node failure). is an r8, 4, 3s linear code with locality r " 2.
Each coordinate of C can be repaired by r " 2 other coordinates. For instance, the last coordinate of a codeword c P C can be recovered by adding the second and fourth coordinates.
In a DSS, multiple failed nodes may occur simultaneously, and the DSS must be able to repair the failed nodes as much as possible. In general, in the case of multiple failed nodes, the repair efficiency depends on the applied repair method, which is repairing either simultaneously or one by one. These methods are referred to as parallel and sequential approaches, respectively, in [6]. The parallel approach has been widely studied in [7]- [25].
Codes with locality r and availability t are a subclass of LRCs in the parallel mode (PM). A code C is called an LRC with locality r and availability t if for every coordinate, there exist t pairwise disjoint repair sets of size at most r, which enables C to simultaneously repair any t failures [9], [10], [18]- [21]. Another subclass of LRCs in the PM, studied in [8], [26], is known as the overall local code. For any positive integer n, we define rns as the set t1, 2,¨¨¨, nu. A given rn, ks-code C is called an overall local with repair tolerance t, if for any E Ă rns of size up to t and each i P E, the i-th coordinate of C has a repair set included in rnszE.
For the sequential approach, there are several papers that distinguish functional repair and exact repair [6], [26]- [31]. A class of codes in the sequential mode (SM) was given in [27], they are pn, k, r, uq-ELRC (exact locally repairable code) where u is the erasure tolerance (repair tolerance). The construction of codes by the direct product method was considered in [28]. Some structures of LRCs with locality r and erasure tolerance u in the SM, constructed based on graphs of the girth at least pu`1q, are given in [30]. In addition, a construction of LRCs with locality r is given in [29] by using u´3 orthogonal Latin squares of order r. These codes have length n " r 2`r pu´1q`1 and erasure tolerance u in the SM. It is worth mentioning that a family of binary non-MDS (Maximum Distance Separable) erasure codes has been constructed in [32] based on incident matrices coming from Latin squares by a method quite different from our approach in this paper.
From a practical perspective, the number of steps needed for repairing, referred to as the repair time, is important in the SM. If a DSS uses an LRC in the SM with erasure tolerance u then in general the repair time for repairing u failed nodes is u. Hence, reducing the repair time in the SM is important. In [33], LRCs were investigated under the joint sequentialparallel mode (SPM) with the aim of reducing the repair time in the SM. If a DSS uses an LRC (with parameters pn, k, r, t, uq) in the joint SPM with erasure tolerance u (in the SM) and t (in the PM), then the repair time for u failed nodes is at most u´t`1 (u ě t).
Let C be a code with locality r and availability t. This property is equivalent to saying that for each coordinate i of C, there exist t distinct codewords in C K , each of which has a support of size at most r`1 with the property that any two of these t supports have only the i-th coordinate in common.
This realization led us to construct an LRC by focusing on its dual code C K and, hence, considering the structure of the parity-check matrices of the LRC [33]. In [33], we realized that parity-check matrices possessing the aforementioned property can be constructed by using orthogonal Latin squares and variational permutation cubes (a generalization of orthogonal Latin squares), because the existence of a set of t mutually orthogonal Latin squares guarantees the existence of the required t distinct codewords. We have to mention that, in this approach, there is a restriction on the applied Latin squares and an arbitrary set of Latin squares will not necessarily produce a desired parity-check matrix. In addition, in combinatorial designs, there are some limitations on constructing orthogonal Latin squares\variational cubes, and there are not enough mutually orthogonal Latin squares\variational cubes of arbitrary order. Due to this limitation of this approach, we are trying to find a better method for constructing LRCs for the joint SPM.
In this research line, we observe that the binary matrices corresponding to Latin squares (not necessarily orthogonal) and permutation cubes can be considered as generator matrices of the overall local codes, because each element in a Latin square\permutation cube appears only once in each row and column. This leads to the present research paper, which focuses on the structure of generator matrices of LRCs, which are based on the structure of Latin squares and permutation cubes.
Therefore, from a theoretical point of view, the novelty of this work with respect to [33] lies in using generator matrices instead of parity-check matrices, based on the reasons described above. From an output perspective, the novelty of this study, compared with [33], is that owing to the elimination of the limiting orthogonality constraint, we have been able to construct codes that have a higher repair tolerance. More precisely, the codes constructed by using t 1 -dimensional permutation cubes have repair tolerance t " 2t 1 (in the PM) and u " 2 t 1´1 in the SM, whereas the codes constructed in [33], using t 1 -dimensional variational permutation cubes, have erasure tolerance u " 3 (in the SM) and t " 2 (in the PM). Further, for the codes presented in this paper, finding a repair set for a failed node is simpler than that in the codes presented in [33]; this is due to the fact that for the codes given in this paper finding a repair set is done by using just the cell labels of a cube, while in the structure given in [33], to find a repair set we need both the cell labels and the values of the cells of all permutation cubes involved in the structure.
As previously mentioned, the general novelty of the joint sequential-parallel approach is that the repair time of the SM can be reduced by using the PM along with the SM. Specifically, the code constructed by making use of t-dimensional permutation cubes can repair 2 t´1 failed nodes in at most t´1 steps, whereas the repair time spent in other constructions in the SM is not low; for instance, the repair time of some u " 2 t´1 failed nodes is 2 t´1 for the code constructed in [30]. Further, choosing a repair set (for a failed node) that includes a specified desired node, as discussed in this paper, might be useful in practice.
In comparison with other previous constructions [21], [27], [29], [30], the new constructions of LRCs given in this paper achieve higher repair tolerance and reduced repair time. All the codes constructed here are binary, and hence, are easily implemented. In this study, back-circulant Latin squares are used to construct LRCs with availability t, which possess a shorter block length compared to the previous constructions (such as codes presented in [21] and direct product code in [18]) with availability t. In addition, it is very simple to construct a back-circulant Latin square, so the corresponding code can be easily constructed. Furthermore, it is easy to find a repair set for a failed node in this construction. Codes constructed based on permutation cubes can repair failed nodes in the PM and have a high repair tolerance in the SM, unlike the existing ones that can either repair failed nodes in the sequential or PM. For example, the codes presented in [30] constructed based on graphs of girth ě pu`1q can repair u failed nodes only in the SM and have a large block length, versus codes constructed based on permutation cubes (see Table 4). In addition, the codes based on permutation cubes have high flexibility in choosing a repair set for a failed node; that is, there are different options in choosing a repair set for a failed node. Indeed, by considering different rows of a cube, different repair sets can be obtained. Furthermore, we show that these new codes can be introduced as pr, t, xq-LRCs (a new generalization of LRCs investigated in [34]). Figure 1 illustrates the chain relationship that holds between five subclasses of LRCs. The figure also provides properties of LRCs based on permutation cubes and Latin squares. Some bounds on the parameters of LRCs are given in [14]- [16], [18], [26], [30]. An upper bound on the rate (lower bound on the block length) of an LRC with locality r and erasure tolerance u in the SM was given in [30] as where s " rpu´1q{2s. In Theorem 9, we obtain a lower bound on the block length under the joint SPM by using the same technical approach as that in [30] to derive (1). For a sufficiently large n, say, n ą 50, our bound is almost equal to this bound in (1), and the difference is negligible. A lower bound on the block length of LRCs in the SM is given in [26].
This bound for a code that can repair u " 3 failed nodes in the SM is given by Some examples of LRCs constructed by Latin squares are presented in Table 3, whose block lengths are closer to this bound up to a few units. Finally, it is worth to briefly give a comparison between LRCs and MDS codes. An rn, k, ds MDS code C has maximum transmission rate among all linear codes of length n and minimum distance d. From this point of view, although the codes constructed in this paper are non-MDS, but, in using a given rn, k, ds MDS code C for a DSS, the code needs to transfer r " k symbols to repair a single failed node, and this leads to high disc I/O. In order to overcome this I/O disc problem, the parameter r needs to be considerably smaller than k, and LRCs are constructed to fulfill this condition.
The paper is organized as follows: in Section II, we provide some necessary basic concepts about LRCs, as well as the definition of availability for LRCs in the PM, and pE, rqrepairable set for LRCs in the sequential approach. In addition, some basic concepts about Latin squares, back-circulant Latin squares, and m-dimensional permutation cubes are presented. In Section III, first, a bound on the block length under the joint sequential-parallel approach is derived, and second, we assign a binary matrix to a given permutation cube, and provide an important relationship between permutation cubes and their assigned binary matrices. In Section IV, we present some constructions of LRCs summarized in Theorems 13, 14 and 17 and their corollaries; in Theorem 13, we present LRCs with locality r " 5, by making use of back-circulant Latin squares; in Theorem 14, we apply Latin squares to construct LRCs with repair tolerance t " 3, and then generalize these codes for repair tolerance t ě 3 in Theorem 17, where we make use of t-dimensional permutation cubes to construct LRCs that can repair t failed nodes in the PM and 2 t´1 failed nodes in the SM. Specific codes are given in Corollaries 15 and 18 that achieve the bounds given in Theorems 14 and 17, respectively. In Theorem 22, we show that these codes can repair 2t failed nodes in the PM. We also prove that the codes constructed in Theorem 17 belong to the class of pr, t, xq-LRC introduced in [34]. In Section V, we introduce the LRC-AL class of codes, a new class of LRC for which for any pair of nodes i, j there is a repair set for a failed node i containing the live node j (a node that has not failed), and present a binary construction for this class of codes. This new class of codes might be useful for engineering design because it may be necessary to have a certain node in a repair set. In Section VI we compare our constructions with the previous well-known constructions in the literature. Finally, in Section VII, we give the most important conclusions.

II. PRELIMINARY
Some background definitions and notations for LRCs, Latin squares, and m-dimensional permutation cubes are provided in this section.

A. LOCALLY REPAIRABLE CODES IN THE PARALLEL AND SEQUENTIAL MODE
Recall that the set t1, 2,¨¨¨, nu is denoted by rns. Let C be a q-ary linear rn, k, ds-code of length n, dimension k, and minimum distance d over the field F q , where q is a prime power (if the minimum distance is not relevant, we simply refer to C as an rn, ks-code). Let G " pg 1 , . . . , g n q and H " ph 1 , . . . , h n q be a generator and a parity-check matrix for C, respectively, where g i and h i denote the i-th column of G and H, respectively. Then, GH T " 0 and H is a generator matrix for the dual code C K . For any c " pc 1 , c 2 , . . . , c n q P F n q , the support of c is defined by supppcq " ti P rns : c i ‰ 0u and wtpcq " |supppcq| is the Hamming weight of c. The minimum distance of C, denoted by dpCq, is the minimum weight of the nonzero codewords in C.
Codes with locality r and availability t, in which each coordinate has t pairwise disjoint repair sets with locality r have been introduced in [10], [19] as a class of LRCs. Definition 1. Let C be a code of length n with generator matrix G " pg 1 , . . . , g n q and i P rns. A set Rpiq Ď rnsztiu of the maximum size r is called an pr, Cq-repair set for the coordinate i if g i " ř lPRpiq a i l g l , where a i l P F q . This code is called a locally repairable code (LRC) with locality r and availability t if each coordinate of C has t pairwise disjoint pr, Cq-repair sets.
Example 2. Let C be the code in Example 1. Each coordinate of C has t " 2 pairwise disjoint p3, Cq-repair sets; hence, it is an LRC with r " 3 and t " 2. For instance, for i " 5 we have R 1 p5q " t1, 2u, R 2 p5q " t6, 7, 8u, and the pr, Cq-repair sets for i " 8 are R 1 p8q " t2, 4u, R 2 p8q " t5, 6, 7u. Definition 2. Let E " ti 1 , i 2¨¨¨, i u u be an ordered set of indexes belonging to rns and E 1 " rnszE. A linear rn, ks-code C is said to be pE, rq-repairable if there exists a collection of sets tRpi 1 q, Rpi 2 q,¨¨¨, Rpi u qu such that, for each j P rus, we have Rpi j q Ă E 1 Y ti 1 ,¨¨¨, i j´1 u and |Rpi j q| ď r, where Rpi j q is an pr, Cq-repair set for i j . In other words, a coordinate i j can be computed once its preceding coordinates i 1 ,¨¨¨, and i j´1 are computed.
By this definition, if an rn, ks-code C is pE, rq-repairable, then we can repair a set E of the failed nodes in the SM. The code C is pE, 2q-repairable for E " t4, 5, 6, 7, 8u Ă r12s, . Indeed, taking the elements in E in the following order 5, 4, 6, 7, 8, we have the collection tRp5q " t1, 2u, Rp4q " t12, 5u, Rp6q " t2, 3u, Rp7q " t3, 4u, Rp8q " t4, 1uu. Note that, in this example, as 5 P Rp4q, we need to compute node 5 before computing node 4. In addition, it is easy to check that C is an LRC with locality r " 2 and availability t " 4. Now, we combine Definitions 1 and 2 and introduce a class of LRCs with the property of repairing failed nodes in both the parallel and the SMs.
Definition 3. An rn, ks-code C with locality r and availability t is called pn, k, r, t, uq-exact locally repairable code (ELRC), if it is pE, rq-repairable for all E Ď rns of size up to u pt ď uq.
Example 4. Consider C given in Example 3. It is easy to verify that any 5 failed nodes of C can be repaired in the SM. For example, if nodes 4, 5, 6, 7, 8 fail, then they can be repaired in the SM, as explained in Example 3. Thus C is a p12, 4, 2, 4, 5q-ELRC with minimum distance d " 6.
The next definition introduces the concept of overall local codes in the joint SPM, denoted by ELR-MRAC (exact locally repairable with multiple repair alternatives code).

Definition 4 ( [33]
). An rn, ks linear code C is called an pn, k, r, t, uq-exact locally repairable with multiple repair alternatives code (ELR-MRAC) if it is pE, rq-repairable for each E Ď rns of size up to u, and for any S Ă rns of size t and any i P S, the i-th coordinate has a repair set with locality r contained in rnszS.
We should note that ELRCs are a subclass of ELR-MRACs. Example 5 illustrates the difference between ELRC and ELR-MRAC. Each failed node can be repaired using r " 3 live nodes, but there are no 2 distinct pr " 3, Cq-repair sets for the first node; thus, the availability of this code is 1. Furthermore, if S is a set of t " 3 failed nodes, then each node in S has a repair set contained in r8szS. For instance, for S " t1, 2, 5u, we have repair sets Rp1q " t3, 6, 8u, Rp2q " t3, 6, 7u and Rp5q " t3, 4, 6u contained in r8szS, but these repair sets are not distinct. Furthermore, it is obvious that each set of three failed nodes can be repaired in the SM. Therefore, C is an p8, 4, 3, 1, 3q-ELRC and p8, 4, 3, 3, 3q-ELR-MRAC.
Based on Definitions 3 and 4, if an pn, k, r, t, uq-ELRC or pn, k, r, t, uq-ELR-MRAC is used in a DSS with n nodes, then the DSS is able not only to repair any t-set of failed nodes simultaneously, but also to repair any u-set of failed nodes in the SM (u ě t).

B. LATIN SQUARES AND PERMUTATION CUBES
Definition 5. An nˆn array L of n objects, say Z n " t0, 1, 2,¨¨¨, n´1u, is called a Latin square if each object occurs once in each row and column of L. Each position in L is called a cell, and hence L has n 2 cells. Definition 6. For each n, the Latin square L " p pi,jq q, where pi,jq " i`j pmod nq for 0 ď i, j ď n´1, is called back-circulant Latin square of order n.
Definition 7. An m-dimensional permutation cube of order n is an m-dimensional nˆnˆ¨¨¨ˆn array, where each column (i.e., each sequence of objects parallel to an edge of the cube) is a permutation of the elements of Z n . Accordingly, a 2-dimensional permutation cube is a Latin square of order n.
Definition 8. Let L be an m-dimensional permutation cube of order n. Then, an pm´1q-dimensional plane of L is an pm´1q-dimensional subcube of L. In particular, a 1dimensional plane is called a line, and for convenience, a 2dimensional plane is called a plane. Two planes that do not intersect are said to be parallel. It is obvious that any cube of dimension m has n parallel pm´1q-dimensional planes. Two lines are said to be perpendicular if they have exactly one common cell. In general, two pm´1q-dimensional planes are said to be perpendicular if they have exactly one common pm´2q-dimensional plane.
For brevity, henceforth we use 'cube' instead of 'permutation cube'.

III. BLOCK LENGTH AND GENERATOR MATRIX OF AN LRC
This section is divided into two parts. First, a bound on the block length in the joint SPM is obtained by using the same approach as in [30]. In the second subsection, we assign a binary matrix to a given cube and provide a result on the relationship between the permutation cubes and their assigned binary matrices.

A. A LOWER BOUND ON THE BLOCK LENGTH UNDER THE JOINT SEQUENTIAL-PARALLEL APPROACH
We obtain a lower bound on the block length in the joint SPM by using the technical proof in [30, Appendix A]. This bound, derived for ELR-MRACs, also holds for ELRCs because ELR-MRAC is a generalization of ELRC.
In other words, the rate of C is upper bounded by Proof. Considering the proof presented in [30], we provide a proof for odd values of u; the process for even values of u is similar. Let B be the linear span of the set tc 1 P C K : wtpc 1 q ď r`1u. Let m be the dimension of B and assume that c 1 1 , c 1 2 ,¨¨¨, c 1 m is a basis of B such that wtpc 1 i q ď r1 , for each 1 ď i ď m. Let H be the mˆn matrix whose i-th row is c 1 i . Assuming that there is a column in H of weight at least t, inequality (55) in [30] can be rewritten as follows: Therefore, inequality (66) of [30] is changed to the following: (5) Using the same algebraic manipulations that has been applied in [30] we derive inequality (3) from (5).
Hence, we only need to show that H contains a column of weight at least t. Suppose that c 1 Repeating this process again, we obtain E t " t1, i 2 ,¨¨¨, i t u and t vectors c 1 1 , c 1 2 ,¨¨¨, c 1 t of weight at most r`1 such that 1 ‰ i j P supppc 1 j´1 q and E j X supppc 1 j q " t1u for 2 ď j ď t. Now, we show that the set tc 1 i : 1 ď i ď tu is linearly independent. Suppose that ř t i"1 α i c 1 i " 0 and α i P F 2 . We have α 1 " 0 because i 2 P supppc 1 1 q and i 2 R supppc 1 j q for 2 ď j ď t. In addition, α 2 " 0 because α 1 " 0, i 3 P supppc 1 2 q, and i 3 R supppc 1 j q for 3 ď j ď t. By repeatedly using the same argument, we conclude that α i " 0 for 1 ď i ď t, and thus tc 1 i : 1 ď i ď tu is a part of a basis of B. Hence, the first column of H has a weight of at least t, and the proof is complete.

B. THE RELATIONSHIP BETWEEN GENERATOR MATRIX AND CUBE
Given a Latin square L nˆn " p ij q over t0, 1, 2,¨¨¨, n1 u, assume that the cells of L are labeled from 1 to n 2 , as demonstrated in Table 1; hence the label of ij is in`j`1 for 0 ď i, j ď n´1. An nˆn 2 binary matrix A L " pa st q is assigned to L, where a st " 1 if and only if the value of the t-th cell of L is s, for 0 ď s ď n´1 and 1 ď t ď n 2 .
Example 6. For the Latin square L given below, the corresponding matrix A L is as follows. For instance, for s " 1, the second row of A L , the values of the 4th, 6th, 9th, and  Similarly, the cells of an m-dimensional cube of size n are labeled from 1 to n m (as illustrated by Figure 2 in cell labeling of the given 3-dimensional cube of size 5). Note that the cell pi 1 Given an m-dimensional cube L over t0, 1,¨¨¨, n´1u, a binary nˆn m matrix A L " pa st q is assigned to L, in which a st " 1 if and only if the t-th cell (the cell with label t) of L contains the symbol s for 0 ď s ď n´1 and 1 ď t ď n m . Proposition 10. Let tL 1 , L 2 ,¨¨¨, L w u be a set of w permutation cubes of dimension m (or Latin squares in the case of dimension 2) of size n ě 3. Assume that A Li is the matrix corresponding to L i as mentioned above. Let and E " ti 1 , i 2 ,¨¨¨, i r u Ă rn m s. Let L j pEq be the set of values of the cells in L j whose labels are in E. If the number of appearances of any element of the set L j pEq is even, for 1 ď j ď w, then the set tg i1 , g i2 ,¨¨¨, g ir u of columns of G is linearly dependent (over F 2 ).
Proof. Consider the submatrix G 1 " pg i1 g i2¨¨¨gir q of G whose columns are those indexed by E.
In each row of G 1 , there is an even number of 1, because the number of appearances of each element of set L j pEq is even, for 1 ď j ď w. Thus, ř r s"1 g is " 0.
Therefore, for each m-dimensional cube (or Latin square) L of order n, LpEq is the set of values of the cells of L whose labels are in E Ă rn m s. Example 7. Let L 1 , L 2 be the following two Latin squares of size 3. The matrix G defined in Proposition 10 is as follows. Let E " t1, 3, 5, 8u. Then L 1 pEq " t0, 2, 2, 0u and L 2 pEq " t0, 1, 1, 0u. The number of appearances of any element in each set L j pEq is 2; hence, the columns tg 1 , g 3 , g 5 , g 8 u of G are linearly dependent.
Corollary 11. Consider the matrix introduced in Proposition 10 as a generator matrix for C, an LRC of length n m . If E " ti 1 , i 2 ,¨¨¨, i r`1 u Ă rn m s is a subset of the cell labels, such that the number of appearances of any element in L j pEq is even, for 1 ď j ď w, then any coordinate i i0 P E of C can be repaired by using r other coordinates In other words, suppose that the value of the i-th cell of L j is x j , for 1 ď j ď w. Now, if there exists a subset Rpiq " ti 1 , i 2 ,¨¨¨, i r u Ă rn m s of cell labels, such that i R Rpiq and the number of appearances of x j P L j pRpiqq is odd and the number of appearances of any other element in L j pRpiqq, different from x j , is even, for 1 ď j ď w, then the coordinate i of C can be repaired using the coordinates ti 1 , i 2 ,¨¨¨, i r u.
Remark 1. One of the most important features of the structure presented in Corollary 11 is that it easily provides many ways for selecting a repair set for a failed node, which can be achieved by only using the structure of cubes (or Latin squares) regardless of the code structure.
The Kronecker product of two matrices A " pa ij q mˆn and B " pb ij q rˆs , is defined as A b B " pa ij Bq mrˆns . Consider matrices J n " I n b 1 n and R n " 1 n b I n , where I n is the nˆn identity matrix and 1 n denotes the all-one vector of length n: J n and R n correspond, respectively, to the following squares L nˆn and L 1 nˆn which are not Latin squares: The definition of matrices R n and J n given by (6) are extended to m-dimensional cubes.

Definition 12.
[Particular cubes and their corresponding matrices]. As an extension of squares L nˆn and L 1 nˆn , given above, define L P Ci as an m-dimensional cube of order n for 1 ď i ď m, such that when partitioned into n parallel m´1dimensional planes, all cells on each plane have the same value.
It is obvious that these cubes are not permutation cubes, but they can still be used to construct LRCs.
Example 8. Let m " 3 and n " 5. In this case, we have three particular cubes L P Ci , as shown in Figure 2. The corresponding matrices are as follows: Remark 2. In Corollary 11, if A L P C i (or R n , J n for dimension 2) is added to the generator matrix G, then the code-rate of C can increase. In this case, if we want to select a repair set of size at most r to repair a coordinate i P rn m s (with the terms stated in Corollary 11), we need a set Rpiq " ti 1 , i 2 ,¨¨¨, i r u Ă rn m s of cell labels, such that in addition to the conditions stated in Corollary 11, there must be an even number of cell labels for each pm´1q-dimensional plane of the cube (or, of each row and each column in a Latin square) in Rpiq Y tiu.

IV. CODE CONSTRUCTIONS
In this section, by using Proposition 10 and Corollary 11, we provide four theorems describing some new constructions of LRCs.
In Theorem 13, we present LRCs with locality r " 5 by using back-circulant Latin squares. The lengths of these codes are much shorter than those of their counterparts given in [18], [21]. In Theorem 14, we apply Latin squares to construct LRCs with repair tolerance t " 3, and then generalize these codes for repair tolerance t ě 3 in Theorem 17, which is one of the most important results of this section. Theorem 17 gives us a family of LRCs with locality r " 2n 0´3 and availability t ě 3 in the PM and repair tolerance u " 2 t´1 in the SM based on t-dimensional cubes of size n 0 . Then, in Corollary 20, we show that these codes are able to repair any set of failed nodes of size up to u " 2 t´1 in at most t´1 steps.
Each coordinate of the code C generated in Theorem 17 has pn 0´1 qpt´1qt repair sets, any two of which intersect at most x " n 0´2 coordinates (proved in Corollary 21). At the end of this section, in Theorem 22, we prove that the code C generated in Theorem 17 has a good repair tolerance in the PM.
Suppose that the f -th coordinate of C fails. The f -th coordinate corresponds to the pi, jq-th cell (the cell in row i and column j) of the Latin square, where f " in 0`j1 (see Table 1). We want to find t pairwise disjoint repair sets of order 5. We use the ordered pair px, yq instead of the corresponding label z " xn 0`y`1 .
Let 0 ď k ď t " n 0´1 and assume that k ‰ j. The k-th p5, Cq-repair set for this cell is R k pf q and note that all computations are made modulo n 0 : R k pf q " tpi, kq, pi´2k`2j, 2k´jq, pi´k`j, 2k´jq, pi´k`j, jq, pi´2k`2j, kqu.
To prove that R k pf q is a repair set for the f -th coordinate, it is sufficient to show that B " L`R k pf q˘ŤtLpi, jq} is a set satisfying the conditions of Corollary 11. According to Definition 6 of the back-circulant Latin squares, we have So, Lpi, jq " Lpi´2k`2j, 2k´jq " i`j; Lpi, kq " Lpiḱ`j , 2k´jq " i`k; Lpi´k`j, jq " Lpi´2k`2j, kq " i´k`2j. Moreover, i`j ‰ i`k, i`j ‰ i´k`2j, and i`k ‰ i´k`2j; otherwise, in each case, we obtain k " j, which is false. Thus, the number of appearances of any element in the set B is even. In addition, because R n0 and J n0 are submatrices of G, according to Remark 2, it is necessary that R k pf q Ť tf u have an even number of cell labels from each row and each column of L. We analyse it. The cell labels in R k pf q Ť tf u are in columns j, 2k´j, k and in rows i, i´2k`2j, i´k`j in such a way that there are exactly two elements in each column as well as two elements in each row.
Finally, we prove that these t repair sets are pairwise disjoint, that is, R k pf q Ş R k 1 pf q " H for any two different numbers 0 ď k, k 1 ď t and distinct from j. Comparing the elements in R k pf q and R k 1 pf q, it is obvious that there are no common elements in almost all cases. The cases that are not so obvious are as follows: ‚ If pi, kq " pi´2k 1`2 j, 2k 1´j q then 2k 1 " 2j and since 2 n 0 then k 1 " j, which is false. Hence, pi, kq ‰ pi´2k 1`2 j, 2k 1´j q. ‚ If pi´2k`2j, 2k´jq " pi´k 1`j , 2k 1´j q then 2k " 2k 1 , which is not possible since 2 n 0 . Hence, pi´2k`2j, 2k´jq ‰ pi´k 1`j , 2k 1´j q. ‚ If pi´k`j, 2k´jq " pi´2k 1`2 j, k 1 q then´k " 2k 1`j and 2k´j " k 1 , so 3k " 3k 1 and since 3 n 0 then k " k 1 , which is false. Hence pi´k`j, 2k´jq " pi´2k 1`2 j, k 1 q Therefore, any t " n 0´1 of failed nodes can be repaired in the PM; hence, any u " t " n 0´1 of failed nodes can be repaired in the SM. Now we show that the dimension of C is 3n 0´2 . The sum of the rows in R n0 is 1 n0 " p1, 1,¨¨¨, 1q, which coincides with the sum of the rows of J n0 and the sum of the rows of A L . Hence, rankpGq ď 3n 0´2 . On the other hand, let S " t1, 2,¨¨¨, 2n 0 , 2n 0`1 , 3n 01 , 4n 0`1 ,¨¨¨, pn 0´1 qn 0`1 u Ă rn 2 0 s. The set S consists of the cell labels of the first two rows and the first column of the Latin square. The values of these cells are as shown below.
We claim that the set tg s | s P Su of columns in G is linearly independent over F 2 ; otherwise, we have ř sPS a s g s " 0 for some a i s in F 2 , where at least one of the a i s is nonzero. Set E " ti P S | a i " 1u. Then ÿ iPE a i g i " ÿ iPE g i " 0, and hence, each row of the following matrix G 1 contains an even number of 1: Then, according to the matrix J n0 , the set E must contain an even number of cell labels in each row of the Latin square; and hence, E does not contain any cell labels outside the first two rows of the Latin square (because E Ă S and S contain one cell label from the r-th row with r ą 2).
Based on the structure of matrix R n0 , the set E must contain an even number of cell labels from each column of the Latin square. Based on the properties of matrix A L the number of appearances of any element of the set LpEq must be even. Therefore, according to the structure of the back-circulant Latin square, E must contain all cell labels of the first and second rows of the Latin square; and hence, E " t1, 2,¨¨¨, 2n 0 u. However, n 0 is an odd number, and hence E contains an odd number of cell labels from the first row of the Latin square, which is a contradiction. Therefore, the set of columns tg s | s P Su in G is linearly independent, and rankpGq " 3n 0´2 . Finally, because this code can repair n 0´1 failed nodes, d ě n 0 . In addition, note that the weight of the first row in G is n 0 , so d " n 0 .
The minimum distance of the constructed code C is d " n 0 " t`1, and the length of C is much shorter than that of its counterparts constructed in the PM (see comparisons provided in Table 2).
In this code, assume that i, j are two arbitrary coordinates and that we have a repair set ti x |1 ď x ď 5u for the i-th coordinate. If we arrive at the j-th label from the i-th label by a movement pattern on the back-circulant Latin square, and then, using the same movement pattern, we arrive at the j xth label from the i x -th label (for 1 ď x ď 5), then tj x |1 ď x ď 5u is a repair set for the j-th coordinate. For instance, see Figures 3 and 4 in Example 9.
Algorithm 1 describes how Theorem 13 is working.

Algorithm 1 Construction of ELRC based on back circulant
Latin square (Theorem 13). Input: n 0 is neither even nor a multiple of 3.
Example 9. Let L be a back-circulant Latin square of order n 0 " 5; then, the matrix G from Theorem 13 is G "¨1 The code C with generator matrix G is a p25, k " 13, r " 5, t " 4, u " 4q-ELRC. Suppose the first coordinate of C fails; this coordinate corresponds to the label 1 of the Latin square L (see Figure 3 and Table 1). According to Theorem 13, there are four disjoin repair sets for this node (see Figure 3); for instance, R 3 p1q " t4, 11, 12, 22, 24u. Now, suppose that the second coordinate of C also fails. This coordinate corresponds to the label 2 of the Latin square L. In the Latin square, we move from the first label to the second label by cyclic shifting one unit to the right. Then, we obtain a repair set for the second node by moving all labels of any repair set for the first node one unit to the right. Theorem 14. Let tL i | 1 ď i ď wu be a set of w Latin squares of size n 0 , and assume that A Li is the binary matrix corresponding to L i . The code C with the following generator matrix G is an pn " pn 0 q 2 , k, r " 2n 0´3 , t " 3, u " 3q-ELR-MRAC for n 0 ě 4, and an pn " 9, k, r " 3, t " 2, u " 2q-ELR-MRAC for n 0 " 3, where k depends on the structure of the Latin squares L i and k ď pn 0´1 qw`1. The minimum distance d of C satisfies 4 ď d ď n 0 " ? n for n 0 ě 4, and d " 3 if n 0 " 3.
Proof. First suppose n 0 " 4. Assume that E Ă rns is a set of at most t " 3 failed nodes and f is an arbitrary coordinate of E. The f -th coordinate corresponds to the pa, bq-th cell (the cell in row a and column b) of a Latin square, where f " an 0`b`1 . Note that the joint set of values of a row and a column of the Latin square L x , except the value of its intersection cell, has 2n 0´2 elements for each 1 ď x ď w, and the number of appearances of any element in this set is 2. Then, according to Corollary 11, for each coordinate f P E, it is sufficient to find a row a and a column b, such that the joint set of cells of a, b, except its common cell, contains f and contains no other coordinates of Eztf u.
‚ Suppose that the a-th row of a Latin square contains no coordinate of Eztf u.
In this case, as n 0 ě 4, there are at least three columns other than b. Because Eztf u has at most two members, then there is a column b that contains no coordinates of Eztf u. Hence, row a and column b have the required conditions. ‚ Suppose that the b-th column of a Latin square contains no coordinate of Eztf u. The previous argument applies to this case. ‚ Suppose that the a-th row of a Latin square contains a coordinate f 1 of Eztf u and the b-th column contains a coordinate f 2 of Eztf u.
In this case, assume that f 1 " an 0`d`1 . Hence, row a and column d have the required conditions.
As u ě t then 3 is a lower bound for u. Note that the dimension of C depends on the structure of the w Latin squares L i . However, we can easily find an upper bound for k: the rows in the matrix G are not independent if w ą 1, because by adding the vectors in any A Li , we always obtain the all-one vector, and hence, k ď wpn 0´1 q`1. We see that there exists a row of weight n 0 in G, and hence, the minimum distance d is at most n 0 . Because u ě 3, we have d ě 4; thus, 4 ď d ď ?
In the following corollary, w " n 0´1 Latin squares of size n 0 ě 4 are given, and the associated code from Theorem 14 achieves the dimension bound with equality, so k " wpn 01 q`1. Hence, the rate of this code is n´2 ?
Proof. Assume that A Li is the binary matrix corresponding to L i , and R ij is the j-th row of A Li . As supppR 11`R22 q " t2, 3, n 2 0´n0`3 , n 2 0´n0`2 u and d ě 4, we have d " 4. Now, we show that k " pn 0´1 q 2`1 by proving that the elements in the set S " tR ij | 1 ď i, j ď n 0´1 u Y tR 1n 0 u are linearly independent. Suppose ř n0´1 Because the value of the first cell of each Latin square is n 0´1 , the first coordinate of each vector in S is zero, except in R 1n 0 , and hence, a 1n 0 " 0.
We show that a ij " 0, for all 1 ď i, j ď n 0´1 . Without loss of generality, we assume that a 11 ‰ 0. According to the construction of the Latin squares, and looking at the content of supppR 11 q, there are at least 3 indices i, j, k (i.e., three Latin squares labeled by i, j, and k) such that none of them is 1 and a i1 a jj a k pk`1q ‰ 0. Assume that i " α, j " β, k " γ and hence a α1 a β β 1 a γ γ 1 ‰ 0, wherein β 1 " β and γ 1 " γ`1.
Again, according to the construction of the Latin squares and looking at the content of supppR α1`Rβ β 1`Rγ γ 1 q, there are at least three indices i, j, and k such that i " β and j " α " k and a i β 1 a j j 1 a k k 1 ‰ 0 for some j 1 and k 1 .
By repeating this argument, we conclude that a 1n 0 and all a ij , for 1 ď i, j ď n 0´1 , are nonzero. This contradicts p7q.
Example 10. Let n 0 " 4 and that tL i | 1 ď i ď 3u be a set of w " 3 Latin squares of size 4, as follows: Then, the code C with generator matrix G is a p16, 10, r " 5, t " 3, u " 3q-ELR-MRAC, with minimum distance d " 4. For instance, if the first, second, and fifth nodes fail, then these nodes can be repaired simultaneously with repair sets t6, 7, 8, 9, 13u, t6, 10, 13, 15, 16u, and t4, 6, 7, 12, 16u, respectively. We now give an example in which the locality parameter is r " 97 and the code rate is 0.961. Let n 0 " 50 and suppose that tL i | 1 ď i ď 49u is a set of w " 49 Latin squares of size 50 constructed from Corollary 15. The code associated to these Latin squares is an ELR-MRAC with code rate k n " 2402 2500 " 0.961. As a generalization, in the following theorem, by using cubes of dimension t, we can construct some LRCs with availability t. The code-rate can be increased by increasing the number of cubes.
Before proceeding to the theorem, we introduce a useful lemma. In this lemma, points (marked cells) represent the failed nodes.
Lemma 16. Let t and x be two positive integers with t ě 2 and x ď 2 t´1 . If we have x points (marked cells) in a tdimensional n-cube, then there exists a pt´1q-dimensional subcube containing at most 2 t´1´1 points.
Proof. If x " 1, then there is nothing to prove, so suppose that x ě 2. Consider all pt´1q-dimensional subcubes perpendicular to one specific direction and assume that all x points (marked cells) are not in the same pt´1q-dimensional subcube, so it is obvious that the statement is fulfilled. Otherwise, we can repeat the same argument by taking all the different t directions. Hence, the statement is proved; otherwise, all x points are in the intersection of t perpendicular pt´1q-dimensional subcubes. This intersection is reduced to one point, and thus, it should be x " 1, which is impossible because we assume that x ě 2.
Theorem 17. Let t ě 3 and r " 2n 0´3 , for some integer n 0 ě 3. Assume that tL i | 1 ď i ď wu is a set of w tdimensional permutation cubes of order n 0 , and A Li is the matrix corresponding to L i . Then, code C with the generator matrix is an ppn 0 q t , k, r " 2n 0´3 , t, u " 2 t´1 q-ELRC, with minimum distance 2 t ď d ď n t´1 0 . The dimension k depends on the structure of the permutation cubes L i and k ď wpn 01 q`1.

Proof.
Suppose that the f -th coordinate of C fails. The fth coordinate corresponds to the pi 1 , i 2 ,¨¨¨, i t q-th cell of a permutation cube, where f " ř t j"1 i j n j´1 0`1 . We want to find t pairwise disjoint pr, Cq-repair sets for this coordinate. We use the ordered t-tuples px 1 , x 2 ,¨¨¨, x t q instead of the corresponding label z " ř t j"1 x j n j´1 0`1 . The first pr, Cq-repair set is R 1 (all calculations are made modulo n 0 ): R 1 " pi 1`x , i 2 ,¨¨¨, i t q, pi 1´1 , i 2`y , i 3 ,¨¨¨, i t q | 1 ď x ď n 0´2 , 1 ď y ď n 0´1 ( . The size of the repair set R 1 is |R 1 | " 2n 0´3 and the set A 1 " R 1 Ť pi 1 , i 2 ,¨¨¨, i t q ( contains exactly two perpendicular lines of a cube, except their intersection (for instance, see Figure 5). Then, the number of appearances of any element in the collection L x pA 1 q is two, for each 1 ď x ď w. Hence, according to Corollary 11, R 1 is an pr, Cq-repair set for the f -th coordinate. Analogously, the other pr, Cq-repair sets are as follows: . . .
It is obvious that R i Ş R j " H for each i ‰ j. Therefore, code C is an LRC with locality r and availability t in the PM. For example, for t " 3, n 0 " 5, r " 7, the repair sets R 1 , R 2 , R 3 are shown in Figure 5. Each R i is a subset of the labels of two perpendicular lines without their intersection and without the failed node.
In the SM, suppose that we have at most 2 t´1 failed nodes. From Lemma 16, we can find a pt´1q-dimensional subcube with at most 2 t´1´1 failed nodes; by repeatedly using Lemma 16, we end up with a 2-dimensional subcube (plane) with at most three failed nodes, denoted by L 1 . If n 0 ě 4, then these failed nodes can be repaired using Theorem 14.
Now, suppose that n 0 " 3. If there exists a line X (row or column) in L 1 such that X X E " H, then there exists a line Y in L 1 perpendicular to X satisfying Y X E " tf u; and hence, the failed node f can be repaired based on a proof similar to that given for Theorem 14. Otherwise, if each line in L 1 contains a failed node of E, then from among the n 0 "3 parallel planes perpendicular to L 1 , there is at least one plane that contains one or two failed nodes, and these nodes can be repaired by Theorem 14. Finally, using the same argument, we can repair the remaining failed nodes. The dimension of the constructed code depends on the structure of the cubes. However, by the same argument used in the proof of Theorem 14, we have k ď wpn 0´1 q`1. For the minimum distance of C, we see that the weight of one row in G is n t´1 0 , and thus d ď n t´1 0 . Finally, because u " 2 t´1 , then d ě 2 t . Therefore, 2 t ď d ď n t´1 0 . In the following construction, we introduce w " pn 0´1 q 2 permutation cubes of size n 0 ě 4 such that the code from Theorem 17 achieves the dimension bound with equality, and thus k " wpn 0´1 q`1. Hence, the code rate is pn0´1q 3`1 Note that this construction can be generalized to the case of t-dimensional cubes with 3 ă t, and the obtained code has dimension k " pn 0´1 q t`1 and minimum distance d " 2 t .
From Theorem 17, the code assigned to these w " pn 01 q 2 permutation cubes is an ELRC with dimension k " pn 01 q 3`1 and minimum distance d " 8.
Proof. The proof is similar to the one given in Corollary 15.
1: Construct a set of w permutation cubes of dimension t and size n 0 2: Calculate the binary matrix A L associate to these permutation cubes 3: Construct generator matrix G Output: ppn 0 q t , k, r " 2n 0´3 , t, u " 2 t´1 q-ELRC.
The result in Theorem 17 can be improved for the case of n 0 " 3 when the availability is greater than that given in the general case. In Theorem 22, we show that the codes presented in Theorem 17 can repair 2t failed nodes in the PM for n 0 ě 4, although the availability is not 2t.
The code C with generator matrix G is an pn " 27, k " 9, r " 3, 2t " 6, u " 7q-ELRC with minimum distance d " 8 (calculated using MAGMA [35]) and code rate 1 3 . The code with the same locality and availability constructed in [21] has block length n "`9 6˘" 84, code rate 1 3 , and minimum distance d " 7. Thus, our code achieves a better minimum distance and shorter block length.
In Example 11, we constructed an LRC with the same rate as in [14], but with shorter block length and a high minimum distance. To do this, we used w " 4 cubes. It may be possible to increase the code rate by increasing w.
The repair time is an important issue in the SM. In [33], we showed that the repair time for 2 t´1 failed nodes in the direct product of t copies of rr`1, rs single-parity-check codes is at most t rounds. In the next corollary, we show that the repair time for repairing 2 t´1 failed nodes using the codes obtained in Theorem 17 is at most t´1. In addition, it is shown in Theorem 22 that these codes can repair 2t failed nodes simultaneously in one step.
Corollary 20. The codes obtained in Theorem 17 can repair 2 t´1 failed nodes in at most t´1 steps.
Proof. We prove the corollary by induction on t. For t " 3, take all planes of a cube (they can intersect), such that each of them contains at most three failed nodes. If n 0 ě 4, then the failed nodes in each of these planes can be repaired in one step, based on Theorem 14. Suppose that x ą 0 failed nodes are not repaired at this step (for x " 0, the repair time is 1). All x failed nodes are in the same plane, so a proof similar to that given for Lemma 16, shows that x " 1. This failed node can then be repaired in the second step. Hence, the repair time is at most t´1 " 2. In addition, if n 0 " 3, then the repair time is t´1 " 2, as 6 failed nodes can be repaired simultaneously based on Corollary 19. Now, suppose t ě 4 and that the claim has been proven for t´1. Take all pt´1q-dimensional subcubes of a cube (they can intersect), such that each of them contains at most 2 t´1´1 failed nodes. By applying the induction hypothesis, the failed nodes in each of these pt´1q-dimensional subcubes can be repaired in at most t´2 steps. Suppose that x ą 0 failed nodes are not repaired at these t´2 steps (for x " 0, the repair time is t´2). A proof similar to that given for Lemma 16 shows that x " 1. This failed node can then be repaired in step t´1. Hence, the repair time is at most t1 .
In [34], a new generalization of LRC (pr, t, xq-LRC) was introduced. A linear rn, ks-code C is said to be pr, t, xq-LRC, if for each coordinate i P rns there are t pr, Cq-repair sets with the property that each pair of them can intersect in at most x coordinates. In the next corollary, we want to show that the code C obtained in Theorem 17 is contained in the class of pr, t, xq-LRCs.
Proof. Let f be an arbitrary coordinate (a failed node) of the code C. The cell f is at the intersection of t lines of a tdimensional cube, and let X be one of these lines. If there is a line Y perpendicular to X and X XY " tf 1 u ‰ tf u, then with the same argument used in the proof of Theorem 17, R " pX Y Y qztf, f 1 u is an pr, Cq-repair set for the f -th coordinate.
Note that in the first part of the corollary, in a plane that contains X , there are n 0´1 lines tY paq | f ‰ a P X u satisfying X X Y paq " tau. Hence, we have n 0´1 pr, Cq-repair sets R a " pX Y Y paqq ztf, au, a P X ztf u for the f -th coordinate. For each pair a, a 1 P X ztf u, we have R a X R a 1 " X ztf, a, a 1 u. As f is on t lines, there exist tpn 0´1 q pr, Cq-repair sets for the f -th coordinate, such that the size of the intersection of any two repair sets is at most x " n 0´3 coordinates. Therefore, C is a p2n 0´3 , pn 0´1 qt, n 0´3 q-LRC.
Regarding the second part of the corollary, as X is on the t´1 planes of a cube, for each cell a P X and a ‰ f , there are pt´1q lines Y 1 paq, Y 2 paq,¨¨¨, Y t´1 paq, such that X X Y i paq " tau, 1 ď i ď t´1. Then, there exists pn 0´1 qpt´1q pr, Cq-repair sets R ia " pX Y Y i paqqztf, au, which satisfy R ia X R ja " X ztf, au and R ia X R j a 1 " X ztf, a, a 1 u for 1 ď i, j ď t´1, with a, a 1 P X ; thus, the number of intersections of two repair sets is at most n 0´2 . Finally, as f is on t lines, there are tpn 0´1 qpt´1q pr, Cq-repair sets for the f -th coordinate, such that each pair intersects at most x " n 0´2 coordinates. Therefore, C is a p2n 0´3 , pn 0´1 qpt´1qt, n 0´2 q-LRC.
Example 12. The code C given in Example 11 is an pr " 3, t " 12, x " 1q-LRC with a code rate of 1{3.
To conclude this section, we show that the code C in Theorem 17 is an ELR-MRAC with erasure tolerance 2t in the PM. This result shows that these codes in the joint SPM have high erasure tolerance and short block length compared to previously published works (e.g., [21], [28]).
Proof. Suppose that E Ă rns is a set of at most 2t failed nodes, and f is an arbitrary coordinate in E. The f -th coordinate corresponds to the f -th cell of a t-dimensional permutation cube. By the same argument used in the proof of Theorem 17, it is sufficient to show that there are two perpendicular lines X , Y of a cube, such that the set of cells of X , Y , except its intersection cell, contains f and does not contain any coordinates of Eztf u. Note that for an arbitrary line X of a cube and a cell g on X , there are t´1 lines with intersection cell g that are perpendicular to X . In addition, there are t lines X 1 , X 2 ,¨¨¨, X t of a cube, such that X i contains the cell f and X i , X j are perpendicular if i ‰ j.
There are two cases: ‚ Suppose that there is a line X i such that X i X E " tf u.
As n 0 ě 4, there are at least 3pt´1q lines (separate from the set B " tX 1 , X 2 ,¨¨¨, X t u) perpendicular to X i . Because Eztf u has at most 2t´1 cells and 3t´3 ą 2t´1, there is a line Y perpendicular to X " X i such that Y X E " H. ‚ Suppose that for each line X i in B " tX 1 , X 2 ,¨¨¨, X t u, we have | X i X E |ě 2.
In this case, suppose there is a set of b lines B 1 " tX i1 ,¨¨¨, X i b u Ď B, such that X ij X E " tf, a j u for each X ij P B 1 , and | X i XE |ě 3 for each X i P BzB 1 . There is a set of b lines B 2 " tY 1 ,¨¨¨, Y b u, such that X ij X Y j " ta j u (perpendicular lines with intersection cell a j ) and Y j X Y j 1 " H (no pairs of them are on the same plane), for any j, j1 P rbs and j ‰ j1.
As | X i X E |ě 3 for each X i P BzB 1 , at least 2ptb q`1 cells of E are on the lines in BzB 1 . In addition, b cells of Eztf u are on the lines of B 1 ; thus, as |E|´p 2pt´bq`1`bq " b´1 and | B 2 |" b, there is a line Y " Y 1 j0 P B 2 that is perpendicular to X " X ij 0 P B 1 . Hence, X and Y have the desired conditions.
The other parameters of this code are the same as those given in Theorem 17.
The direct product of t copies of the rr`1, rs single paritycheck code is an ppr`1q t , r t , r, t, u " 2 t´1 q-ELRC, and the code based on Theorem 22 is an pp r`3 2 q t , k, r, 2t, u " 2 t´1 q-ELR-MRAC for any odd r. However, if we use the permutation cubes introduced in Corollary 18, or their extension to t-dimensional cubes with t ą 3, we obtain an pp r`3 2 q t , p r`1 2 q t`1 , r, 2t, u " 2 t´1 q-ELR-MRAC. Thus, for every given parameter t and odd r, the repair tolerance of our code in the PM is twice that of the aforementioned direct product code, and the block length is shorter than that.

V. THE LRC-AL, A NEW CLASS OF LRC
In this section, we introduce a new class of LRC, a locally repairable code with an arbitrary live node (denoted as LRC-AL). The codes in this class have the property that for a failed node i and each arbitrary node j, there is a repair set for node i containing live node j. We also provide a binary construction for these codes in Theorem 24.
Definition 23. Suppose C is an rn, ks-linear code, and r is an integer number. If for any two coordinates i, j P rns, there is at least λ pr, Cq-repair sets R a piq (1 ď a ď λ) for the ith coordinate such that j P R a piq, then we say that C is an pn, r, λq-locally repairable code with an arbitrary live node (LRC-AL).
Note that the λ repair sets in an pn, r, λq-LRC-AL may have intersections between them.
By this definition, if a DSS with n nodes uses an pn, r, λq-LRC-AL as the storage code, any desired live node can be used in the process of repairing a failed node. Theorem 24. Let tL i | 1 ď i ď wu be a set of w Latin squares of size n 0 ě 4, and let A Li be the binary matrix corresponding to L i . Then, code C with the generator matrix is an pn " pn 0 q 2 , r " 2n 0´3 , λ " 2q-LRC-AL.
Proof. Assume that the i-th coordinate of C fails, and that j ‰ i is an arbitrary node (coordinate) of code C. The i-th coordinate corresponds to the pa, bq-th cell (the cell in row a and column b) of a Latin square, where i " an 0`b`1 , and the j-th coordinate corresponds to the pc, dq-th cell, where j " cn 0`d`1 . We use the ordered pair px, yq instead of the corresponding label z " xn 0`y`1 .
Two pr, Cq-repair sets for the i-th coordinate are R 1 piq and R 2 piq, each of which contains the j-th coordinate: E. Yavari et al.: Locally repairable codes based on permutation cubes and Latin squares FIGURE 7. Two repair sets for the failed node 7 which contain the live node 10 § If a ‰ c, b ‰ d, then let R 1 piq " pa, yq, px, dq | 0 ď x, y ď n 0´1 ; y R tb, du; x ‰ a ( , R 2 piq " px, bq, pc, yq | 0 ď x, y ď n 0´1 ; x R ta, cu; y ‰ b ( . § If a " c, then let 0 ď v 1 , v 2 ď n 0´1 , where v 1 , v 2 R tb, du and R 1 piq " pa, yq, px, v 1 q | 0 ď x, y ď n 0´1 ; y R tb, v 1 u; x ‰ a ( , R 2 piq " pa, yq, px, v 2 q | 0 ď x, y ď n 0´1 ; y R tb, v 2 u; x ‰ a ( . § If b " d, then let 0 ď v 1 , v 2 ď n 0´1 , where v 1 , v 2 R ta, cu and R 1 piq " px, bq, pv 1 , yq | 0 ď x, y ď n 0´1 ; x R ta, v 1 u; y ‰ b ( , R 2 piq " px, bq, pv 2 , yq | 0 ď x, y ď n 0´1 ; x R ta, v 2 u; y ‰ b ( . Note that all calculations are done modulo n 0 . In all items, L x`R1 piq˘Y L x ptiuq is a collection containing the values of a row and a column of the Latin square L x , except for the common value of them, for each 1 ď x ď w. The number of appearances of any element of this collection is two; and hence, according to Corollary 11, R 1 piq is an pr, Cq-repair set for the i-th coordinate. With the same argument, R 2 piq is an pr, Cq-repair set for the i-th coordinate. The sizes of R 1 piq and R 2 piq are 2n 0´3 and each repair set contains the j-th coordinate. Example 13. Consider the same parameters as in Example 10. Hence, n 0 " 4 and tL i | 1 ď i ď 4u is a set of four Latin squares of size 4. The code C with generator matrix G presented in Example 10 is a p16, r " 5, λ " 2q-LRC-AL. For instance, assume that the 7-th node (coordinate) of code C fails, and consider node 10 as a live node; then, R 1 p7q " t5, 8, 2, 10, 14u, R 2 p7q " t3, 15, 9, 10, 12u are two repair sets, containing live node 10, for node 7. These two repair sets are shown in Figure 7.

VI. COMPARISON WITH OTHER CONSTRUCTIONS
In the literature, there are LRCs constructed either in the PM or in the SM. In this paper, we presented LRCs that could repair in the joint SPM. Now, we provide some examples and compare them with other constructions. Table 2 provides a comparison of LRCs of short block length constructed following Theorem 13 with their counterparts constructed in the PM.
Based on Theorem 14 and applying w Latin squares of order n 0 , we constructed some pn, k, r, t " 3, u " 3q-ELR-MRACs, which are listed in Table 3. The block lengths of these codes are compared with the bounds given by (2) and the codes presented in [21]. The results confirm that our codes have a code rate nearly equal to the codes given in [21]  in [21] Direct product code in [18], [27] n0 t n Code rate n "`r`t t˘R ate " r r`t n " pr`1q t Rate  A set of codes with parameters r and u, constructed by different methods, and a comparison between them from the erasure tolerance t in the PM and block length n perspectives.
pr`1q t , can repair 2 t´1 failed nodes in the SM, and t failed nodes in the PM. A comparison of these codes with our codes is given in Table 4.
Furthermore, LRCs in the joint SPM were presented in [33], based on t-dimensional variational permutation cubes that are capable of repairing 2 failed nodes in the PM and 3 failed nodes in the SM. In this study, we utilized tdimensional permutation cubes (not necessarily variational permutation cubes) to construct LRCs that can repair 2t failed nodes in the PM and 2 t´1 failed nodes in the SM. In addition, these codes can repair 2 t´1 failed nodes in at most t´1 steps.

VII. CONCLUSIONS
In this paper, we present an explicit construction of generator matrices of pn, k, r, t, uq-ELRCs and pn, k, r, t, uq-ELR-MRACs by using Latin squares, permutation cubes, and back-circulant Latin squares. The constructed codes based on t-dimensional permutation cubes are LRCs with availability t ě 3, and can repair every set of failed nodes of size 2 t´1 in the SM in at most t´1 steps. Further, we showed that these codes are overall local with repair tolerance 2t in the PM. Finally, we have shown that these codes are also a type of pr, t, xq-LRC, in which the repair sets can intersect in at most x coordinates.
One of the most important features of the structures presented here is that they provide many options for selecting a repair set for a failed node. For instance, for the LRC-AL class of codes given in Section V, for each failed node i and for each live node j, we can choose a repair set for node i containing live node j.
For all constructed codes, without using either the generator matrix or the parity check matrix of our code, we can find a repair set for each failed node by using only the corresponding cubes (or Latin squares) of the code. Therefore, finding a repair set for a failed node is much simpler in our construction than in previous constructions.
Obtaining a theoretical bound on the minimum distance of the joint sequential-parallel LRCs may be considered as a future research direction.