Commit d003e0a3 authored by Filip Stedronsky's avatar Filip Stedronsky
Browse files

Succinct: finalize 1st version

parent 9abd703e
......@@ -24,4 +24,4 @@ for (int i = 1; i < nmixers; ++i) {
pair endb = (mixgrid * (nmixers-1), 0) + (0.5,0);
draw(endb -- endb + (0.5,0) {E} .. {S} endb + (1.5,-1) -- endb + (1.5,-1.25), e_arrow);
label(endb + (1.5,-1.25), "$2^{M_*}$", S);
label(endb + (1.5,-1.25), "$2^{M_{n+1}}$", S);
......@@ -420,10 +420,50 @@ for possibly the last and in the last level all the vertices in one contiguous s
starting at the very left.
Now let us consider a level at height $h$ (from the bottom). There are at most three
subtree types at that level: full subtrees of height $h$, full subtrees of height $h-1$
and one irregular subtree in the middle (unless the whole tree is full; then there would
be only one kind of subtree). See fig. \figref{tree_shapes}.
three vertex types by subtree shape and they appear on the level in a specific order:
\tightlist{n.}
\: a contiguous segment of vertices with full subtrees of height $h$ (type A)
\: one vertex with an irregular subtree (type B)
\: a contiguous segment of vertices with full subtrees of height $h-1$ (type C)
\endlist
See fig. \figref{tree_shapes}. If the last level happens to be full, there are only
type-A vertices.
\figure[tree_shapes]{tree_shapes.pdf}{}{Vertex types by subtree shape}
Thus, for each level and each vertex type, it is sufficient to remember:
\tightlist{o}
\: Number of vertices of this type on this level. From this, we can easily determine
vertex type from its index by simple comparison.
\: Mixer parameters.
\: Starting address of the output of first vertex of this type in the output stream.
From this, we can easily compute starting address of any vertex by simple addition
and multiplication as all vertices of a given type on a given level have the same
number of output bits (parameter $M$). This will be useful for local decoding.
\endlist
This a precomputed table of $\O(\log n)$ words.
\figure[tree_shapes]{tree_shapes.pdf}{}{Tree and subtree shapes}
Block size and redundancy computation is exactly the same as in the chain case and
we still get $\O(1)$ redundancy. The chain can be thought of as a degenerate case
of the tree construction where the tree has the shape of a path (and thus all subtrees
have distinct shapes and distinct mixer parameters).
Local decoding of $i$-th input block could be done as follows:
\tightlist{o}
\: Convert block index into a position in the tree (level + index on level)
\: Determine the vertex type and mixer parameters, compute position in output stream and extract the
corresponding output $m \in 2^M$
\: Do the same for the parent vertex
\: Using the parent mixer, decode the carry going up from our vertex
\: Using our mixer, decode the original input block from our output and carry
\endlist
Local modification can be done in a similar fashion the other way around. Both take
$\O(1)$ time on RAM.
\theorem{
On a Word-RAM, we can represent a string $A \in [\Sigma]^n$ in space $\lceil n \log \Sigma \rceil + \O(1)$ bits,
with random-access element read and write operations in $\O(1)$ time, using a precomputed table of
$\O(\log n)$ constants dependent on $n$ and $\Sigma$.
}
\endchapter
......@@ -8,11 +8,14 @@ draw((3.2,-3.5)--(3.2,-2), Arrows);
label((3.2, -2.75), "$h-1$", E);
void subtree(path p) {
filldraw(p, 0.5*white);
filldraw(p, 0.65*white);
}
subtree((-1.75, -4)--(-0.75,-4)--(-1.25,-2)--cycle);
subtree((-0.5, -4)--(0,-4)--(0,-3.5)--(0.5,-3.5)--(0,-2)--cycle);
subtree((1.75, -3.5)--(0.75,-3.5)--(1.25,-2)--cycle);
label((-1.25, -3), "A");
label((-0, -3), "B");
label((1.25, -3), "C");
draw((-3, -4) -- (0,-4) -- (0,-3.5) -- (3,-3.5) -- (0, 0) -- cycle, halfthick);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment