|
ADS
Algorithms and Data Structures
|
The compression of the adjacency lists of Boldi and Vigna (chapter 15, Compressed Data Structures, of Ferragina's book), designed for the Web graphs, whose nodes are the pages sorted by URL: locality (most links stay in the host, so that the successors of \( x \) are close to \( x \) and to each other) and similarity (the pages of a host link to the same pages). More...
#include "ADS/Contract.h"#include "ADS/compression/IntegerCodes.h"#include "ADS/succinct/BitStream.h"#include "ADS/succinct/BitVector.h"#include "ADS/succinct/EliasFano.h"#include <algorithm>#include <cstddef>#include <cstdint>#include <iterator>#include <string_view>#include <utility>#include <vector>#include "ADS/succinct/impl/BVGraph.tpp"Go to the source code of this file.
Classes | |
| class | ADS::BVGraph |
| a static directed graph with the lists compressed by reference, copy blocks, intervals and gaps More... | |
Namespaces | |
| namespace | ADS |
The compression of the adjacency lists of Boldi and Vigna (chapter 15, Compressed Data Structures, of Ferragina's book), designed for the Web graphs, whose nodes are the pages sorted by URL: locality (most links stay in the host, so that the successors of \( x \) are close to \( x \) and to each other) and similarity (the pages of a host link to the same pages).
The list of \( x \) is written as:
A list is decoded from its place in the stream, kept for every node in an Elias-Fano sequence [see EliasFano.h], after the list of its reference; the chains of references are at most \( R \) long, so that a list is decoded in \( O( R d ) \) time for outdegrees up to \( d \). With the window \( W = 7 \), the chains \( R = 3 \) and \( L_{\min} = 4 \) (the defaults of the WebGraph framework) the Web graphs take about 3 bits per edge, against the \( \log_2 n \) bits of a plain list and the \( 2 + \log ( n^2 / m ) \) of Elias-Fano [see EliasFanoGraph.h]; the \( k^2 \)-tree [see K2Tree.h] is comparable in space and also gives the predecessors. The WebGraph framework codes the gaps by the \( \zeta \) codes, tuned to their power-law distribution, and reorders the nodes (e.g., by layered label propagation) to make locality stronger; neither is in the same chapter.
copyList(), copyBlocks(), intervals() and residualGaps() are the steps of the coding, given for the examples of the same chapter.
The contracts [see Contract.h]: each list is strictly increasing (an audit) with its nodes in \( [ 0 , n ) \), the window and the chains are at least 1 and \( L_{\min} \ge 2 \); the audit of the construction is that each list is decoded back. The functions are defined in BVGraph.tpp.