1

Tree extraction: the data structure

graph tree · LOUDS, level-order names space in bits (0) 0 (2) 0 (3) 0 (3w) 0 4 7 1 11 15 2 7 16 4 9 1 2 2 5 1 15 11 5 1 3 2 8 10 1 5 2 0 14 9 1 16 6 1 3 8 1 13 4 2 6 14 3 10 12 1 12 13 5 7 15 16 1 5 11 3 10 2 9 6 8 4 14 12 13 0 bits cell width = cost of the entry in bits
A directed graph with vertices and edges. Its vertex names are arbitrary — for an unlabeled graph, only the structure matters. How many bits do we need?
0Adjacency lists. One string of all out-neighborhoods: every edge stores its target's name, bits; plus offsets: .
2Entropy compression (wavelet tree): an edge into costs bits, the in-degree — cheap for hubs, expensive for rarely targeted vertices. Total .
Choose a spanning tree (directions ignored): greedily take edges into vertices of small in-degree — a minimum spanning tree for weights . These are mostly the expensive entries of .
3Tree extraction. Store as LOUDS plus one direction bit per edge ( bits). Its level order renames every vertex. Only edges remain in , with cheaper entries.
Tree extraction saves 40 bits here, 0.63 : the label information we never needed. The worst greedy tree saves only 17 bits — which tree is the question of part 2.
2

Which tree? Minimum-entropy tree extraction

in-degrees, sorted 2 4 6 8 0 bits orientation away from hubs 0 0 0 towards hubs 0 0 0 in-degree entropy in bits greedy: Kruskal on edge weight edges sorted by in-degree of their target 1 1 1 1 1 1 1 1 1 1 1 1 1 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 into the tree would close a cycle NP-hard greedy

NP‑hard even to approximate within additive error for some .

greedy in time; undirected: error .

Both bounds are linear in : approximability settled up to the constant.

MINETREX: extract the spanning tree minimizing . For an undirected graph we also choose an orientation for the remaining edges. Two hubs, a rim of 14 vertices, edges.
Orient every edge away from the hubs: the in-degrees are spread out evenly — high entropy.
Orient towards the larger-degree endpoint: the hubs absorb most edges, the entropy drops a lot.
Extract the ribs (and the spine): what remains is the rim path, every vertex has in-degree 1 — bits, no saving.
Extract the rim instead: everything left points at the two hubs. For the generalized family, instead of bits.
With the bad orientation, the same trees leave 13 edges into 13 different vertices…
…so both stay at bits. Tree and orientation matter.
Greedy: orient towards the larger degree, then a minimum spanning tree for weights (Kruskal): edges into rarely targeted vertices enter the tree first, hub edges are only used to connect.
The greedy tree reaches 12.9 bits here, the optimum. In general it is within an additive — and that is best possible up to the constant.
3

Does it pay off? 18 benchmark graphs

(0)adjacency lists (1)string + bitvector (1u)undirected: edge once (2)wavelet tree (3)TREX, greedy tree (4)+ twin removal Σsaving vs n lg n 0 10 20 30 40 50 60 bits per edge (information-theoretic, redundancy omitted) real-world, directed real-world, undirected synthetic, undirected p2p-Gnutella24 0 Amazon0302 0 C. elegans neural 0 Slashdot0811 0 Cit-HepPh 0 Wiki-Vote 0 Wikilinks de 2005 0 email-Eu-core 0 power-US-Grid 0 roadNet-PA 0 oregon1-010331 0 CA-AstroPh 0 facebook combined 0 bio-grid-yeast 0 twitch gamers 0 Barabási–Albert 0 Erdős–Rényi 0 complete bipartite 0 median over all 18 graphs 0 bits per edge 0 versus adjacency lists 0.6 0.8 1.0 1.2 saving, in units of median 0.95 (2) − (3)
Adjacency lists as in most graph libraries: bits per edge plus one offset per vertex.
Concatenate all neighborhoods into one string and mark the boundaries with a bitvector.
For undirected graphs, store each edge only once (in some orientation).
Entropy-compress the string with a wavelet tree: instead of — a huge step for the sparse undirected graphs.
Tree extraction with the greedy tree: up to two thirds saved on the sparse graphs, a few percent on the dense ones.
Bonus: contracting twins first. Little effect, except where structure repeats — the complete bipartite graph collapses to 25 bits.
Measured in units of , tree extraction recovers almost all label information, consistently across graphs (median 0.95).
Rooting Out Entropy · Ismaili Alaoui, Nakajima, Namrata, Reitlinger, Wild→ / space / click: next · ← back · 1–3: part · F: fullscreenwild-inter.net/publications/trex