diff --git a/fs-succinct/mixer_chain.asy b/fs-succinct/mixer_chain.asy index 39327d52806c784701c94323f1fae27d6d9b8433..284942b6b3ba27d5216238e431ca04eb2c58f830 100644 --- a/fs-succinct/mixer_chain.asy +++ b/fs-succinct/mixer_chain.asy @@ -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); diff --git a/fs-succinct/succinct.tex b/fs-succinct/succinct.tex index 1b566a8ff5ddb96f6f32a8b147eaa84885c05a68..e343276629ef3f35fd3dbf63b61a01b6e8efa7a5 100644 --- a/fs-succinct/succinct.tex +++ b/fs-succinct/succinct.tex @@ -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 diff --git a/fs-succinct/tree_shapes.asy b/fs-succinct/tree_shapes.asy index d53ba17a68f634281c78a47e40f048af075d6dae..d50059bead808bf81fede9d50b29040aece32a0f 100644 --- a/fs-succinct/tree_shapes.asy +++ b/fs-succinct/tree_shapes.asy @@ -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);