Cooperative Local Repair in Distributed Storage

Erasure-correcting codes, that support {\em local repair} of codeword symbols, have attracted substantial attention recently for their application in distributed storage systems. This paper investigates a generalization of the usual locally recoverable codes. In particular, this paper studies a class of codes with the following property: any small set of codeword symbols is recoverable from a small number of other symbols. This is referred to as {\em cooperative local repair}. The main contribution of this paper is bounds on the trade-off of minimum distance and the dimension of such codes, as well as explicit constructions of families of codes that enable cooperative local repair. Some other results regarding cooperative local repair are also presented, including an analysis for the well-known Hadamard codes.


I. INTRODUCTION
In this paper we explore a new class of codes that enable efficient recovery from the failure of multiple code symbols. In particular, we study codes with (r, )-locality which allow for any failed codes symbols to be recovered by contacting at most r other intact code symbols. Our study of such codes is motivated by their application in distributed storage systems a.k.a. cloud storage, where information is stored over a network of storage nodes (disks). In order to protect the stored information against inevitable node (disk) failures, a distributed storage system encodes the information using an erasure-correcting code. The code symbols from the obtained codeword are then stored on the nodes in the system.
The task of recovering the code symbols stored on failed nodes with the help of the code symbols stored on intact nodes is refereed to as code repair or node repair [1]. An erasurecorrecting code with an efficient code repair process helps quickly restore the state after node failures. This consequently enables seemless operation of the system for a long time period. Recently, multiple classes of erasure-correcting codes have been proposed that optimize the code repair process with respect to various performance metrics. In particular, the codes that minimize repair-bandwidth, i.e., the number of bits communicated during repair of a single node, are studied in [1]- [4] and references therein. The codes that enable small disk-I/O during the repair process are studied in [3], [5]. Another family of erasure codes that focus on small locality, i.e., enabling repair of a single failed code symbol by contacting a small number of other code symbols, are presented in [6]- [11].
A code is said to have all-symbol locality r if every code symbol is a function of at most r other code symbols. This ensures local repair of each code symbol by contacting at most r other code symbols. In this paper we generalize the notion of codes with all-symbol locality to codes with (r, )locality: any set of code symbols are functions of at most r other code symbols. This allows for cooperative local repair of code symbols, where any group of failed code symbols is repaired by contacting at most r other code symbols.
The ability to pefrom code repairs involving more than one failure is a desirable feature in most of the distributed storage systems that can experience multiple simultaneous failures [12]. Moreover, this property also allows for deliberately delaying code repairs when system resources need to be freed to support other system objectives, e.g., queries (accesses) to the stored information by clients. Here, we note that the approach of cooperative code repair has been previously explored in the context of repair-bandwidth efficient codes in [13], [14] and references therein.
In this paper we address two important issues regarding codes with (r, )-locality: 1) obtaining trade-offs among minimum distance, dimension (rate), and locality parameters (r, ) for such code; and 2) presenting explicit constructions for codes with (r, )-locality that are close to the obtained tradeoffs. Towards designing codes with (r, )-locality, we mainly focus on codes with maximum possible rate. We construct a code with (r, )-locality that has rate at least r− r+ . This code construction is based on the regular bipartite graphs with girth at least +1. In the light of an upper bound r r+ on the rate of a code with (r, )-locality that we show later, this construction provides codes that are very close to being optimal. Here, we also note that there are explicit constructions for the regular bipartite graphs with large girth [15]. Thus, one can obtain high (almost optimal) rate codes with (r, )-locality for distributed storage systems. Note that, a minimum distance is not guranteed in this construction. We also show that the codes based on expander graphs enable cooperative local repairs while maintaining both high rate and good minimum distance.
Given a large number of parity constraints with low weights, expander graph based codes are natural candiates for codes to enable locality. However, these codes are overkill when one is interested in code repair of single failed symbol and codes with significantly better rate vs. distance trade-off can be obtained [6], [9], [11], [16]. But as we aim to recover from multiple failures in a local manner, these codes become an attractive option.

A. Contributions and organization
We first present a formal definition of codes with (r, )locality in Section II. In the same section, we also highlight the connections between the notion of cooperative locality as defined in this paper and various other contemporary notions from distributed storage literature [11], [17]- [20] that aim to generalize locally repairable codes (LRCs) [6], [7].
In Section III, we obtain an upper bound on the minimum distance of a code with (r, )-locality which encodes k information symbols to n symbols long codewords. As a corollary of this upper bound, we then bound the best possible rate for a code with (r, )-locality. We address the issue of providing explicit constructions for codes with (r, )-locality in Section IV, VI-A and VI-B.
In Section IV, we present two simple constructions for the codes that have (r, )-locality and comment on their rates with respect to the bound obtained in Section III. In Section VI-A, we consider the codes based on regular bipartite graphs with large girth (girth = length of the smallest cycle). In particular, we show that a code based on regular bipartite graph with girth g allow for cooperative local repair of g − 1 failed code symbols. We further study cooperative locality of the codes based on expander graphs in Section VI-B. We comment on the conditions in terms of expansion ratio or second eigenvalue that the underlying expander graph needs to satisfy for the code to enable cooperative reapir of a certain number of erasures. Table I summarizes the rates and distances obtained by various code constructions considered in this paper.
Certain families of classical algebraic codes may posses local repair property. In Section VII, we study punctured Hadamard codes (a.k.a. Simplex codes) in the context of cooperative local repair. We show that a punctured Hadamard code with n symbols long codewords has (r = +1, )-locality for any ≤ n−1 2 . We conclude this paper in Section VIII with some directions for future work. A short note on notation: we use bold lower case letters to denote vectors. For an integer n ≥ 1, [n] denotes the set {1, 2, . . . , n}. For a code C, we use rate(C) and d min (C) to denote its rate and minimum distance, respectively.

B. Related work
The concept of codes with small locality for distributed storage system is introduced in [6], [8], [21]. In [6], Gopalan et al. study the rate vs. distance trade-off for linear codes with small locality or locally repairable codes 1 . The similar trade-offs under more general definitions of locally repairable codes and constructions of the codes attaining these trade-offs are studied in [7], [9]- [11], [16], [22], [23] and references therein.
In [24], Prakash et al. consider codes that allow for local repair of multiple code symbols. In particular, they focus on codes that can correct two erasures by utilizing two parity checks of weights at most r + 1. Prakash et al. derive the rate vs. distance trade-off for such code and (for large enough field size) show the existence of the codes that attain the trade-off. We note that the definition of cooperative locality considered in this paper is more general than that studied in [24]. Moreover, we do not restrict ourselves to only two erasures. In Section VI-A2, we show that the codes based on regular bipartite graphs with high girth are rate-wise (almost) optimal under the natural generalization of [24] to more than two erasures.
Recently, the codes that enables multiple ways to locally repair a code symbols have received attention. In [11], [17], [18], the codes that enable multiple disjoint repair groups for every code symbol are considered. The codes that provide multiple disjoint repair group for only information symbols are studied in [19], [20]. In Section II-A, we comment on the implication of this line of work for the issue of cooperative locality.
II. CODES WITH (r, )-LOCALITY Definition 1. A code C with length n and dimension k is called an (n, k) code. We define C to be an (n, k) code with (r, )-locality if for each S ⊂ [n] with |S| = , we have a set Γ S ⊆ [n]\S such that 1) |Γ S | ≤ r, 2) For any codeword c = (c 1 , c 2 , . . . , c n ) ∈ C, the code symbols c S := {c i : i ∈ S} are functions of the code symbols c Γ S := {c i : i ∈ Γ S }. Note that Definition 1 ensures that any code symbols can be cooperatively repaired from at most r other code symbols. This generalizes the notion of codes with all-symbol locality r [6]- [8], [16], where locality is defined with respect to one code symbol, i.e., = 1.

Remark 1.
For a code C with all-symbol locality r, we have the following bound on its minimum distance [6], [7].
A. Cooperative locality from codes with multiple disjoint local repair groups for code symbols In [11], [17], [18], codes with multiple disjoint local repair groups for all code symbols are studied. These codes allow for multiple ways to recover a particular code symbol by contacting disjoint sets of small number of other code symbols. In particular, the work in [11], [17], [18] study codes with at least t disjoint local repair groups, each comprising of at most r other codes symbols. We claim, according to our definition, these codes also have (ri, = i)-locality for each i ∈ [t]. Without loss of generality, we establish this for i = t, i.e., we argue that a code with t disjoint repairs groups (each of size at mostr) has (rt, = t)-locality.
Consider a set of t code symbols in failure. For any of these t failed code symbols, each symbol can have at least one failed code symbol in at most t − 1 of its t disjoint repair groups. This implies that the code symbol under cosideration has at least one of its local reapir groups free of any failures. Thus, the code symbol can be repaired with the help of one of its intact local repair groups. This leave us with t − 1 code symbols in failure (erasure). Now, for another code symbol in failure, we can have at most t − 2 of its disjoint local repair groups with at least one failed code symbol. This leaves at least 2 of its disjoint local groups intact; therefore, this code symbol can be repaired with the help of one of its intact local repair groups. Following the similar arguement, we can see that all of the t failed code symbols can be repaired in a code with t disjoint repair groups for all code symbols. In the worst case, we contact at mostrt code symbols to repair all of the t failures. This establishes the (rt, = t)-locality for the codes under consideration.
Similarly the codes with availability [19], [20], which enable multiple disjoint repair groups only for information (systematic) symbols in a codeword, can allow for cooperative local repair for certain ranges of system parameters. In particular, [20, Construction I] can give codes with (r , )-locality and rater r+ .

Remark 2.
Here, we would like to note that the definition of the codes with (r, )-locality (Definition 1) is more general. In particular, we show in Section IV-A, Section V and Section VI-A that it is possible to have codes with (r, )-locality that do not have at least t = disjoint local repair groups for all code symbols (or information symbols).
In this section, for given r and , we present a trade-off between the rate and the minimum distance of a code with (r, )-locality (cf. Definition 1). We employ the general proof technique introduced in [6], [22], [23] to obtain the following result. Theorem 1. Let C be an (n, k) code (linear, or non-linear) with (r, )-locality. Then, the minimum distance of C satisfies Algorithm: Construction of sub-code C ⊂ C.
such that, for every m ∈ [ ], there exist at least two codewords in C j−1 that differ at i j m -th coordinate. 6: Let R j = Γ {i j 1 ,...,i j } be the index of at most r code symbols that cooperatively repair code symbols indexed by {i j 1 , . . . , i j }.

7:
Let y ∈ F |Rj | q be the most frequent element in the multi-set {x Rj : x ∈ C j−1 ⊂ F n q }. 8: if 1 < |C j | ≤ q then 10: 14:   Proof: The proof involves construction of a subcode C ⊂ C such that all but a small number of coordinates in every codeword of C are fixed. Note that we have Given C , one can obtain a code C with |C | = |C | by removing fixed coordinates from all the codeword in C . This implies that d min (C ) = d min (C ), which along with (3) give us the following.
We describe the construction of the subcode C in Fig. 1. Refer to Appendix A for the complete proof.
Note that an (n, k) code with (r, )-locality has its minimum distance at least + 1 as it can recover from the erasure of any code symbols (cf. Definition 1). Combining this observation with Theorem 1, we obtain the following result. Corollary 1. The rate of an (n, k) code with (r, )-locality is bounded as Proof: It follows from (2) and the fact d min (C) ≥ + 1 that

IV. SIMPLE CONSTRUCTIONS OF CODES WITH (r, )-LOCALITY
In this section we address the issue of constructing high rate codes that have (r, )-locality. In particular, we describe two simple constructions that ensure cooperative local repair for the failure of any code symbols: 1) Partition code and 2) Product code. In Partition code, we partition the information symbols in groups of r symbol and encode each group with an ( r + , r )-MDS code (cf. Section IV-A). On the other hand, a product code is obtained by arranging k = r information symbols in an -dimensional array and then introducing parity symbols along different dimensions of the array (cf. Section IV-B).

A. Partition Code
For the ease of exposition, we assume that |r and r |k. Given k information symbol over F q , a Partition code encodes these symbols into n = k r+ 2 r symbols long codewords as follows (see Fig. 2): 1) Partition k information symbols into p = k r groups of size r each.
2) Encode the symbols in each of the p groups using an ( r + , r )-MDS code over F q . We refer to the r + code symbols obtained by encoding r information symbols in the i-th group as i-th local group. As it is clear from the construction, Partition code has rate k n = r r+ 2 . Moreover, a code symbol can be recovered from any r other code symbol from its local group. In the worst case, when failed code symbols belong to distinct local groups, we can recover all symbols from r = r code symbols, downloading r symbols from each of the local groups containing one failed code symbol. Remark 3. Note that the Partition codes presented here are special cases of the LRCs with locality r and multiple parity symbols ( ) per repair group studied in [9], [16]. The parition codes as described above only aim at maximizing the rate of the code. If we are also interested in achieving large minimum distance, then we can take n strictly greater than k r+ 2 r and attain the following relationship between the minimum distance d min and the code dimension k [9] In the above construction of the Partition codes we use an ( r + , r ) MDS code to encode disjoint groups of r message symbols. Note that the rate of this MDS code governs the rate of the overall code. One can potentially use some other code C local of minimum distance at least + 1 to encode disjoint groups of r message symbols. Now, we use r (x), x ∈ [ ] to denote the number of symbols that needs to be contacted to repair x erasure in one local group. For the case when an Let r * (x) denote the upper concave envelope of r (x) on the interval [1, ] ∈ R. Assume that we have p disjoint local groups, then a pattern of erasures can be represented by a vector (l 1 , l 2 , . . . , l p ). Here, l i denotes the number of erasures within the i-th local group. Note that we have For a given local code C local , one needs to access p i=1 r (l i ) number of intact code symbols to repair the erasure pattern (l 1 , l 2 , . . . , l p ). Now, we use concavity of r * (·), the fact that r * (x) ≥ r (x) for x ∈ [ ], and Jensen's inequality to obtain the following.
Since the rate of the Partition code is agnostic to the number of local groups, we can use the value of p which can support k message symbols and minimizes the R.H.S. of (8). This approach optimizes the value of r for a given choice of and C local .

B. Product Code
Product codes are a well known construction of codes in the coding theory literature. Given k = r information symbols and |r, we first arrange k = r information symbols in an -dimensional array with index of each dimension of the array ranging in the set [ r ]. These information symbols are then encoded to obtain an n = r + 1 symbols long code word. In the following we describe the encoding process for = 2-dimensional array (see Fig. 3). The generalization of the encoding process for higher dimensions is straightforward. 1) Arrange k = r 2 2 information symbols in an r 2 × r 2 array. 2) For each row of the array, add a parity symbol by summing all r 2 symbols in the row and append these symbols to their respective rows.
3) For each of the r 2 + 1 columns of the updated array, add a parity by summing all r 2 symbols in the column. Remark 4. An -dimensional product code enables disjoint repair groups for all code symbols. For example, every code symbol in Fig. 3 has two disjoint repair groups, associated with its row and column, respectively. Therefore, cooperative locality of product codes follows from the discussion in Section II-A. We note that product codes along with their minimum distance have been previously been considered in [11], [19] in the context of small locality.
We now compare the rate of Partition code and Product code with the bound in (5). For any ≥ 1, we have r r + ≤ r r + 2 .
Note that (9) follows from the fact that } denote the parity symbols associated with each row of the two dimensional array of information symbols. {p c 1 , p c 2 , . . . , p r r 2 +1 } represent the parity symbols for the columns of the updated array. We use γ to denote ( r 2 − 1) r 2 .
Therefore, Partition code approach provides (r, )-locality with a better rate. However, for all system parameters, the rate of Partition code is smaller than the known bound (5), i.e., r r + 2 ≤ r r + .
Here, we would like to note that the difference between the rate achieved by the Partition code and the bound in (5) gets smaller as the parameter r becomes large as compared to the parameter . It is an interesting problem to either tighten the bound in (5) or present a construction for codes with (r, )locality which have higher rate than that of Partition code. In the next two sections we present two approaches to achieve this goal.

V. CONCATENATED CODES WITH (r, )-LOCALITY
Here, we describe a family of concatenated codes with (r, )-locality. This construction employs an MDS code and a code with small locality as inner and outer codes, respectively. In particular, we employ an [ r +x, r , x+1] MDS code over F q and an [n out , k out ] code with (r out , out )-locality over F q r/ as inner and outer codes, respectively. Let C be the concatenated code. We know that Before we describe the concatenated codes with (r, )locality for general , let's consider a few examples for small values of . 1) = 3: Let us take an [ r 3 + 1, r 3 , 2] MDS code over F q as the inner code. This code can repair any one failed code symbol by contacting the remaining r 3 code symbols. For outer code, we employ an code with (r out , 1)-locality over F q r/3 . This can repair any one super symbol (which consists of r 3 symbols of F q ) by contacting r out symbols over F q r/3 , i.e., r out r 3 symbols over F q . (Note that in order to repair a super symbol, we can obtain the value of r out required super symbol by contacting r 3 symbols over F q from each of their corresponding codewords of the inner code.) If = 3 erasures lie in the inner codewords of 3 different super symbols, then we can repair each of these erasures by contacting r 3 other code symbol. This amounts to using 3 r 3 = r symbols over F q . If at least 2 erasures belong to the inner codeword of a super symbol, we can employ (r out , 1)-locality of the outer code to repair the corresponding super symbol. In the worst case, we contact r out r 3 + r 3 symbols over F q , when 2 erasures belong to one super symbol and the third erasure belongs to another super symbol. Since we want we have r out ≤ 2. Taking r out = 2, we can get the concatenated code with rate .
Moreover, this code has minimum distance at least 4. Now, we compare the rate of the obtained concatenated code with that of the Partition code described in Section IV-A, which has rate r r+9 . 2r 3(r + 3) > r r + 9 ⇒ r < 9.
Hence, for all r < 9, the concatenated codes have a higher rate than the Partition codes.
2) = 4: Here, we focus on obtaining the codes with (r, 4)-locality. We use an [ r 4 + 2, r 4 , 3] MDS code over F q as the inner code. This code can correct 2 erasures within an inner codeword associated with a super symbol. In order to repair a super symbol, we employ a code with (r out , 1)locality over F q r/4 as an outer code. It can be easily verified that (for suitable value of r out ) the concatenated code obtained by this approach allows for the recovery of 4 erasures by contacting at most r symbols over F q . In particular, when the inner codeword associated with one super symbol encounter 3 erasures and the inner codeword associated with another super symbol encounter 1 erasure, we contact at most r out r 4 + r 4 symbols over F q . Since we need to satisfy we have r out ≤ 3. Working with r out = 3, one can obtain a code with (r, 4)-locality and rate R = r/4 r/4 + 2 · r out r out + 1 = 3r 4(r + 8) .
Moreover, the concatenated codes obtained in this manner have minimum distance at leat 2×3 = 6. We obtain better rate as compared to that of the Partition codes (cf. Section IV-A), iff 3r 4(r + 8) > r r + 16 ⇒ r < 16.
3) For general value of : Here, in addition to |r, we assume that is even 2 . For 1 ≤ x ≤ − 1, We now take an [ r + x, r , x + 1] MDS code over F q as the inner code. For outer code, we employ an code over F r/ q that can locally 2 This assumption is just for the ease of exposition and a similar construction for odd can also be proposed. recover x+1 failed (erased) super symbols. Note that there exist such codes with rate (cf. Section IV-A and Section II-A) r r + x+1 , wherer denotes the number of super symbols needed for the local repair of 1 super symbol. In our definition, these codes have (ir, i)-locality for all i ∈ {1, 2, . . . , x+1 }. Now, consider the case where all erasures lie in the inner codewords corresponding to different super symbols, we can repair all erasures by contacting × r = r code symbols over F q . For the case where 1 ≤ y ≤ x+1 super symbols are in erasure, in the worst case, we have (x + 1) erasures in the inner codewords corresponding to y distinct super symbols and 1 erasure in the inner codewords associated with − y(x + 1) different super symbols. In order to repair these erasures, we contact yr r + ( − y(x + 1)) r symbols over F q . Since we need to satisfy, yr r + ( − y(x + 1)) r ≤ r, we getr ≤ x + 1. Therefore, the rate of the concatenated code we get is Note that the concatenated code obtained in this section has minimum distance at least (x + 1)( x+1 + 1).
Remark 5. If we substitute x = 2 in (13), we obtain a code with rate The rate R 2 in (14) is strictly greater than the rate of the parition codes r r+ 2 as long as r <

CODES ON GRAPHS
The concatenated codes described in Section V enable (r, )-locality with better rate and minimum distance as compared to those of Partition codes. However, the improvements obtained by concatenated code approach are small and limited to the bounded values of the parameter r. In this section, we present various graphs based codes that improve upon the previously described approaches for a large range of system parameters.
(a) In this pattern all three erased code symbols appear together in a local contraint associated with the left vertex u1. Therefore, all the erased symbols must appear in different local constraints corresponding to the right vertices. This allows for the recovery of all three erased code symbols by using local constraints associated with the right vertices v1, v2, and v3.
In this pattern two erased code symbols appear together in the local constraint associated with the left vertex u1. This leads to both the erased symbols appearing in two different local constraints defined by the right vertices v1 and v2. Since the third erased symbol can participate in only one of the local constraints associated with the right vertices (v2 here), one can recover all three erased symbols.

A. Bipartite graphs with large girth
The girth of a graph is the number of vertices in the shortest cycle of the graph. In this section, we explore a particular class of codes based on bipartite graphs with high girth. In this construction, the code symbols are associated with the edges of a bipartite graph and both the left and right vertices in the the bipartite graph enforces the constraints on the code symbols associated with the edges incident on these vertices. The analysis of the cooperative locality of the codes obtained in this manner is based on the fact that the underlying bipartite graph has high girth.
Let G = (U ∪ V, E) be a bipartite graph where U and V denote the set of left and right vertices, respectively. In particular, we work with the bipartite graphs that are bi-regular, i.e., all the veritices from one part have the same degree. If all the left vertices and right vertices have degree d 1 and d 2 , respectively, then we refer to such a bipartite graph as a (d 1 , d 2 )-regular bipartite graph. In the case, where we have d 1 = d 2 = d, we simply call the bipartite graph as d-regular bipartite graph. Given the bipartite graph G, we obtain a code C (over F q ) in the following manner: • We assign each edge in the bipartite grpah G(V, E) with a code symbol in the codewords of C. That is, C ⊆ F |E| q . • For every (left or right) vertex in the bipartite graph, all the code symbols associated with the edges incident on the vertex satisfy a linear constraint (over F q ). Before stating our general result on the cooperative locality of the codes obtained in this manner, we consider small values of . Note that any two edges in G (code symbols in a codeword of C) share at most one vertex (appear together in at most one local constraint). Thus, for = 2 code symbols in erasure, it is possible to find two local constraints that contain exactly one of the two erased symbols. This allows for the repair of both the erased symbols by utilizing these two local constraints. In other words, the code C has (2(d max − 1), 2)locality, where d max denotes the maximum degree of the underlying bipartite graph G. Similarly, even in the presence of = 3 erasures, one can find at least two local constraints such that there is only one erasure among the code symbols participating in each of these constraints. Fig. 4a and 4b illustrate this fact by considering two possible patterns of = 3 erasures. Now, using these two constraints one can repair two erasures, which leaves only one erased symbol which can then be recovered with the help of any of the two local constraints it appears in. The repair of = 3 erasures involves at most 3(d max − 1) other code symbols; hence, the code C has (3(d max − 1), 3)-locality. In order to cooperatively repair > 3 erasures in C, we utilize the fact that the underlying bipartite graph G has high girth.
Theorem 2. Let G be a d-regular bipartite graph with girth g, then the code C obtained from the construction described above has ((g − 1)(d − 1), g − 1)-locality.
Proof: A bipartite graph can only have cycles of even length (number of vertices or edges). Note that as we explain this before stating this theorem, the code C can correct upto 3 erasures without any assumption on the girth of the bipartite graph G. Therefore, without loss of generality we can assume that the girth of the bipartite graph G is at least six 3 , i.e., g ≥ 6. We use induction over the number of erasures to prove the claim. For the base case we consider the case of = 3 erasures. As described in the paragraph preceding the statement of this theorem, the code C can recover from 3 erasures in a cooperative manner. Now as an inductive hypothesis, we assume that the code C can repair at most ≤ g − 2 erasures in a cooperative manner and show that it is also possible to repair + 1 ≤ g − 1 erasures. Towards this, we show that given + 1 erasures, it is possible to obtain a local constraint which has a single erasure among the code symbols appearing in the constraint. Finding such a constraint allow for the recovery of one erasure leaving erasures. In order to show a contradiction, we assume that no such local constraint exists. We start with a vertex say u 1 ∈ U with at least 2 of the code symbols associated with the edges incident on it in erasure. We then traverse along one of the edges out of the vertex u 1 which have their corresponding code symbols in erasure. (Note that there are at least 2 of such edges.) Let v 1 ∈ V denote the vertex that we arrive at after traversing the edge. Since v 1 has at least 2 code symbols associated with its edges in erasure, we can now pick an edge associated with one of the erased symbol to reach another vertex u 2 ∈ U which is different from u 1 . We continue this process until we can not traverse to an unexplored vertex through an edge with its associated symbol in erasure. Note that this process is bound to end in at most + 1 steps as there are only + 1 erasures. This process can end with two possibilities: 1) we have traversed through all edges associated with erased symbols or 2) all the unexplored edges from the last vertex leads to previously visited vertices. The first possibility is not feasible under our assumption as it implies that the last vertex has only single erasure associated with the edges incident on it. The second possibility leads to the existence of cycle of length at most +1 which is infeasible as +1 ≤ g −1. This leads to a contradiction. Thus, it is possible to obtain a local constraint which has a single erasure among the code symbols appearing in the constraint. Now that we are remained with erasures, we can employ the inductive hypothesis to complete the proof.
As for the total number of intact code symbols contacted during the repair process, in the worst case, we may need to utilize g − 1 different local constraints to recover from g − 1 erasures. This amounts to contacting (g −1)(d−1) intact code symbols. Remark 6. (Construction of regular bipartite graphs with large girth) The problem of constructing regular bipartite graphs with large girth has received significant attention in the past. Here, we like to point out the work presented in [15], [25] and references therein. For an odd integer k ≥ 1 and prime power q, Lazebnik et al. present explicit construction for q-regular bipartite graphs with girth at least k + 5 and number of edges q k−1 [15]. Therefore, for any , one can design a code using a regular bipartite graph from [15] which ensures cooperative local repair of any erasures.
1) Rate and distance of C obtained from a regular bipartite graph: When G is a regular bipartite graph of degree d, the number of independent linear constrains on the codewords is at most 2|E| d . Hence the rate of the code is Note that Lemma 2 establish that the code C obtained using a d-regular graph with girth g has ((g−1)(d−1), g−1)-locality. If we set (g − 1)(d − 1) = r and g − 1 = , then the following holds for the code C with (r, )-locality.
Remark 7. Compared to (5), this achievability result has a loss of at most r+ from the optimal possible rate.
2) Comparison with the work in [24]: Recently, Prakash et al. study codes which allow for local repair of 2 erasures [24]. In their model, they perform the repair of the two erasures in a successive manner, where a parity constraint of weight at mostr + 1 is used to repair each of the two erasures. In [24], Prakash et al. show that such codes have their rates upper bounded byr r+2 . Note that their model can be generalized to ≥ 2 erasures, and one can consider codes that enable successive local repairs from erasures by contacting parity constraints of weight at mostr + 1. The codes based on bipartite graphs with high girth, as proposed in this section, fall under this setting. Taking r = r , their rate (cf. (15)) is at leastr −1 r+1 . Since the upper boundr r+2 from [24] still applies to these codes, they exhibit almost optimal rate.

B. Expander graphs
The above analysis of the construction based on bipartite graphs fails to show a high minimum distance on top of the local repair property. However with the graphical construction it is also possible to have high distance, and hence protection against catastrophic failures. Next we show how the expansion property of graphs leads to such conclusion.
1) Unbalanced bipartite expanders: Let G = (U ∪ V, E) be an unbalanced left regular biparitite graph with |U| = n ≥ |V| = m and left degree h. We assume that the graph G is an expander graph where expansion happens from left nodes to right nodes. In particular, we assume that for all S ⊆ U such that |S| ≤ , we have Here, Γ(S) ⊆ V denotes the set of right nodes that constitute the neighborhood of the nodes in the set S. We now associate a code symbol with each of the left nodes in the bipartite graph G. For v ∈ V, let Γ(v) ⊆ U denote the neighborhood of the node v. Consider a code C such that for each v ∈ V, the code symbols associated with Γ(v) constitute a codeword in a shorter code with length |Γ(v)| and minimum distance at least t + 1. Note that this approach of constructing codes from unbalanced expander graphs is proposed in [26], [27] and references therein.
Next, we argue that for sufficiently small enough (cf. (16)), the code C should be able to correct any set of at most erasures. Note that the locality parameter r is dictated by the degrees of the right nodes in the graph G. Theorem 3. Let G be an unbalanced (left) expander bipartite graph as defined in (16). If we have < 1 − 1 t+1 , then the code C can be locally repaired from any or less number of erasures.
Proof: We prove the claim using induction on . Note that 1 erasure can be repaired by using one of the local constraints the failed code symbol participates in. Now assume that at most − 1 erasures can be repaired by using local constraints defined by the graph G. We now show that any set of erasures can also be repaired using local constraints.
Let S ⊆ U with |S| ≤ denote the set of erased code symbols. In order to repair these erasures, we start with a right node which has at most t of the code symbols associated with its neighborhood in erasure. These t erasures can be corrected under the local constraints satisfied by the code C. We can then utilize the inductive hypothesis to complete the proof.
Note that what remains to be shown is that the desirable right node with at most t associated erasures exists. Towards this, we assume that there is no such right node. In other words, this implies that the induced subgraph G defined by the nodes S ∪ Γ(S) has at least t + 1 edges incident on every node in Γ(S) from the nodes in S. Thereofore, we have However, for < 1 − 1 t+1 , it follows from (16) that This along with (17) leads to a contradiction. Hence, in the presence of at most erasures it is possible to find the desirable right node (with at most t erasures among the code symbols associated with its neighborhood).
Let αn be such that the graph G allows for expansion of all sets S ⊆ U of size at most αn by a factor of at least (1 − )h, i.e. 4 , Proposition 1. For the code C based on the bipartite graph G above and local codes of minimum distance t + 1, we have, A proof of this fact, which is an extension of existing results (such as [26]) is provided in Appendix B. We further assume that the bipartite graph G is bi-regular with d denoting its right degree, i.e., nh = md. Moreover, let C 0 represent the shorter code of length d used to define the code C. Then we have, where r = d·rate(C 0 ) denotes the maximum number of intact code symbols that need to be contacted to repair erasures.
2) Regular expander graph: We now study the cooperative locality of the codes obtained by the double covers of d-regular expander graphs [26]. The analysis of the cooperative locality is based on the analysis of the decoding algorithm for these codes presented in [28]. Note that we naturally modify the decoding algorithm from [28] to perform erasure correction in a cooperative manner.
Let G = (V, E) be a d-regular graph with |V| = N and λ as the second (absoulte) largest eigenvalue of its adjacency matrix 5 . Given G, we construct a bipartite graph • Each vertex u ∈ V in the original graph G corresponds to a left node u l ∈ V 0 and a right node u r ∈ V 1 in the graph G. • For a pair of vertices (u l , v r ) ∈ V 0 × V 1 , there exists an edge (u l , v r ) ∈ E iff there is an edge between the vertices u and v in the original graph G, i.e., (u, v) ∈ E.
The bipartite graph G is referred to as the double cover of the graph G. Note that the bipartite graph G is d-regular with total n = N d edges. Moreover, the following result holds for the bipartite graph G.

Lemma 1. (Expander Mixing Lemma)
Let G be the dregular bipartite graph as described above. Then, for every S ⊆ V 0 and T ⊆ V 1 , we have where E(S × T ) denotes the collection of the edges from the nodes in the set S to the nodes in the set T .
Given the bipartite graph G and a code C 0 with d-symbol long codewords, we define a code C as a slight generalization of the method of Sec. VI-A. Each edge in G corresponds to a code symbol in the codewords of C. For each node in the bipartite graph G, the d code symbols associated with the d edges incident on the node constitute a codeword in the code C 0 . Note that we assume the local code C 0 to be an MDS code throughtout this paper. In Fig. 6, we present an algorithm which corrects any erasures in C an cooperative manner by contacting at most d · rate(C 0 ) code symbols. The algorithm alternates between the left nodes V 0 and the right nodes V 1 in order to utilize the smaller code C 0 associated with the vertices to correct the erasures.
Let S 1 ⊆ V 0 denotes the set of nodes that have erasures among the code symbols associated with their edges and did not attempt to correct those erasures in the first round of the algorithm. This implies that each vertex in S 1 has at least d min (C 0 ) erasures among the code symbols associated with Algorithm: Erasure correction in C.

Input:
A codeword from C with at most erasures. 1 For every vertex u ∈ V i such that 1 ≤ e ≤ d min (C 0 )−1 code symbols among d code symbols associated with it are in erasure, use erasure correcting algorithm for C 0 to recover from these erasures. 4: j = j + 1 (mod 2). 5: end while its d edges. Therefore, we have We use S i , for i ≥ 2 to denote the set of (left or right) vertices that have erasures among the d code symbols associated with them in the beginning of i-th round and did not attempt to correct those erasures. Note that S i ∈ V 0 and S i ∈ V 1 when i is an odd and even round of decoding, respectively. Next, we employ the expander mixing lemma (cf. Lemma 1) to show that |S 1 |, |S 2 |, |S 3 |, . . . is a strictly decreasing sequence. Lemma 2. Let S 1 , S 2 , . . . be the sequence of sets of (left of right) vertices in the bipartite graph G as defined above. Assume that the minimum distance of C 0 is at least (1 + )λ and ≤ N λ δ 2 = nλ δ 2d . Then, for i ≥ 1, we have Proof: We prove the relation in (20) for i = 1; the proof for general i involves steps similar to those in the proof of the i = 1 case. Note that each code symbol that is in erasures after the first round of decoding is associated with some edge incident on a left node belonging to the set S 1 . By the definition of the set S 2 , it has at least d min (C 0 ) erasures among the d code symbols associated with it after the first round of decoding. In other words, this implies that each vertex in the set S 2 has at least d min (C 0 ) edges incident on it which are emanating from the vertices from the set S 1 . Therefore, we have where (a) and (c) follows from Lemma 1 and (19), respectively. Note that we employ the AM-GM inequality to obtain (b). It follows from (21) that S 2 ≤ λ 2 · d min (C 0 ) − λ − 2d /(N · d min (C 0 )) S 1 . (22) By replacing d min (C 0 ) = δd in (22), we get Under our assumption that 2 N δ ≤ λ, it follows from (23) that Now, under the assumption that δd ≥ (1 + )λ, we get from (24) that It follows from the Lemma 2 that in at most logarithmic (in ) rounds of decoding, the algorithm described in Fig. 6 can correct erasures.
The codes based on the double covers of d-regular expander graphs have been studied in the coding theory literature before (see e.g. [28]). The rate and the minimum distance of the code C depends on the rate and the minimim distance of the code C 0 . Note that C 0 characterizes the local cosntraints associated with the vertices in the bipartite graph G. In particular, if rate(C 0 ) = R and d min (C 0 ) = δd, then we have that rate(C) ≥ 2R − 1 and d min (C) ≥ δ(δ − λ d )n [26], [28]. As we show in this section, for an > 0 and local code C 0 such that d min (C 0 ) = δd ≥ (1 + )λ, it is possible to correct ≤ N λ δ 2 erasures using the algorithm described in Fig. 6. Moreover, in the worst correction of each erasure involves contacting at most rate(C 0 )d ≤ (1 + rate(C))d/2 other intact code symbols (assuming that the local code C 0 is an MDS code). Therefore, the codes based on the double cover of a dregular expander graph and a local code C 0 have (r, )-locality for any ≤ N λ δ 2 = nλ δ 2d and r = (1 + rate(C))d/2, that is, In the next section, we show an explicit family of algebraic codes that exhibit very strong cooperative local repair property, as well as a very high minimum distance.

VII. COOPERATIVE LOCAL REPAIR FOR HADAMARD CODES
In this section, we study the cooperative locality for punctured Hadamard codes. Punctured Hadamard codes are also referred to as Simplex codes, which are the dual codes of Hamming codes. These codes are well known to be locally decodable codes (LDCs) [29] and have multiple disjoint repair groups for each code symbols. Here, we comment on the exact parameters for the cooperative locality of these codes. In particular, we show that an [n = 2 k − 1, k, 2 k−1 ] 2 punctured Hadamard code has (r = + 1, )-locality for any ≤ n−1 2 .
where (a) follows from the fact that I t is union of the disjoint sets A j . Now, we define C = C | It which denotes the code obtained by puncturing the codewords in C at the coordinates associated with the set I t . We have |C | = |C | and d min (C ) = d min (C ). Moreover, the length of the codewords in C is n − |I t |. Next, applying the Singleton bound on C gives us It follows from (32) and (30) that This completes the proof. For any codeword of C whose support is given by the vertexset S ⊂ U, we must have U t (S) = ∅. Clearly, when |S| ≤ αn, |U t (S)| ≥ (1 − − /t)h|S| > 0. Let us assume, |S| > αn but |S| ≤ (2 − − /t)αn. Let Q be a proper subset of S such that |Q| = αn. The number of edges coming out of S \ Q is h(|S| − αn) ≤ h(1 − − /t)αn. On the other hand, U t (Q) ≥ (1 − − /t)hαn. Hence U t (S) = ∅.
This proves that the minimum distance of the expander code is at least (2 − − /t)αn.