Expander code
In coding theory, expander codes form a class of error-correcting codes that are constructed from bipartite expander graphs. Along with Justesen codes, expander codes are of particular interest since they have a constant positive rate, a constant positive relative distance, and a constant alphabet size. In fact, the alphabet contains only two elements, so expander codes belong to the class of binary codes. Furthermore, expander codes can be both encoded and decoded in time proportional to the block length of the code.
01Expander codes
In coding theory, an expander code is a linear block code whose parity check matrix is the adjacency matrix of a bipartite expander graph. These codes have good relative distance
, where
and
are properties of the expander graph as defined later, rate
, and decodability (algorithms of running time
exist).
02Definition
Let be a
-biregular graph between a set of
nodes
, called variables, and a set of
nodes
, called constraints.
Let be a function designed so that, for each constraint
, the variables neighbouring
are
.
Let be an error-correcting code of block length
. The expander code
is the code of block length
whose code words are the words
such that, for
,
is a code word of
.
It has been shown that nontrivial lossless expander graphs exist. Moreover, we can explicitly construct them.
03Rate
The rate of is its dimension divided by its block length. In this case, the parity check matrix has size
, and hence
has rate at least
.
04Distance
Suppose . Then the distance of a
expander code
is at least
.
Proof
Note that we can consider every code word in
as a subset of vertices
, by saying that vertex
if and only if the
th index of the code word is a 1. Then
is a code word if every vertex
is adjacent to an even number of vertices in
. (In order to be a code word,
, where
is the parity check matrix. Then, each vertex in
corresponds to each column of
. Matrix multiplication over
then gives the desired result.) So, if a vertex
is adjacent to a single vertex in
, we know immediately that
is not a code word. Let
denote the neighbours in
of
, and
denote those neighbours of
which are unique, i.e., adjacent to a single vertex of
.
Lemma 1
For every of size
,
.
Proof
Trivially, , since
implies
.
follows since the degree of every vertex in
is
. By the expansion property of the graph, there must be a set of
edges which go to distinct vertices. The remaining
edges make at most
neighbours not unique, so
.
Corollary
Every sufficiently small has a unique neighbour. This follows since
.
Lemma 2
Every subset with
has a unique neighbour.
Proof
Lemma 1 proves the case , so suppose
. Let
such that
. By Lemma 1, we know that
. Then a vertex
is in
if
, and we know that
, so by the first part of Lemma 1, we know
. Since
,
, and hence
is not empty.
Corollary
Note that if a has at least 1 unique neighbour, i.e.
, then the corresponding word
corresponding to
cannot be a code word, as it will not multiply to the all zeros vector by the parity check matrix. By the previous argument,
. Since
is linear, we conclude that
has distance at least
.
05Encoding
The encoding time for an expander code is upper bounded by that of a general linear code - by matrix multiplication. A result due to Spielman shows that encoding is possible in
time.
06Decoding
Decoding of expander codes is possible in time when
using the following algorithm.
Let be the vertex of
that corresponds to the
index in the code words of
. Let
be a received word, and
. Let
be
, and
be
. Then consider the greedy algorithm:
Input: received word .
Output: fail, or modified code word .
Proof
We show first the correctness of the algorithm, and then examine its running time.
Correctness
We must show that the algorithm terminates with the correct code word when the received code word is within half the code's distance of the original code word. Let the set of corrupt variables be ,
, and the set of unsatisfied (adjacent to an odd number of vertices) vertices in
be
. The following lemma will prove useful.
Lemma 3
If , then there is a
with
.
Proof
By Lemma 1, we know that . So an average vertex has at least
unique neighbours (recall unique neighbours are unsatisfied and hence contribute to
), since
, and thus there is a vertex
with
.
So, if we have not yet reached a code word, then there will always be some vertex to flip. Next, we show that the number of errors can never increase beyond .
Lemma 4
If we start with , then we never reach
at any point in the algorithm.
Proof
When we flip a vertex ,
and
are interchanged, and since we had
, this means the number of unsatisfied vertices on the right decreases by at least one after each flip. Since
, the initial number of unsatisfied vertices is at most
, by the graph's
-regularity. If we reached a string with
errors, then by Lemma 1, there would be at least
unique neighbours, which means there would be at least
unsatisfied vertices, a contradiction.
Lemmas 3 and 4 show us that if we start with (half the distance of
), then we will always find a vertex
to flip. Each flip reduces the number of unsatisfied vertices in
by at least 1, and hence the algorithm terminates in at most
steps, and it terminates at some code word, by Lemma 3. (Were it not at a code word, there would be some vertex to flip). Lemma 4 shows us that we can never be farther than
away from the correct code word. Since the code has distance
(since
), the code word it terminates on must be the correct code word, since the number of bit flips is less than half the distance (so we couldn't have travelled far enough to reach any other code word).
Complexity
We now show that the algorithm can achieve linear time decoding. Let be constant, and
be the maximum degree of any vertex in
. Note that
is also constant for known constructions.
- Pre-processing: It takes
time to compute whether each vertex in
has an odd or even number of neighbours.
- Pre-processing 2: We take
time to compute a list of vertices
in
which have
.
- Each Iteration: We simply remove the first list element. To update the list of odd / even vertices in
, we need only update
entries, inserting / removing as necessary. We then update
entries in the list of vertices in
with more odd than even neighbours, inserting / removing as necessary. Thus each iteration takes
time.
- As argued above, the total number of iterations is at most
.
This gives a total runtime of time, where
and
are constants.
Sources and credits
This article is adapted from the Wikipedia article “Expander code”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Tanner graph example.PNG by Unknown author, BSD
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.