digraph "gin" {

        layout=dot;

        // default values
        node  [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=lightgray, width=1.4];
        graph [fontname="sans-serif"]; // must be specified separately
        edge  [fontname="sans-serif"]; // must be specified separately

        // an unobtrusive background color
        pad="1.0, 0.5";
        bgcolor=whitesmoke;

        // The top node
        m1 [label="meta page", style=filled, fillcolor=beige];

        // other nodes
        subgraph cluster01 {
                 bgcolor=white;
                 label="entry tree";
                 subgraph egroup1 {
                          rank=same;
                          e1;
                  }
                  subgraph egroup2 {
                           rank=same;
                           e2 -> e3 -> e4;
                  }
                  subgraph egroup3 {
                           rank=same;
                           e5 -> e6 -> e7 -> e8 -> e9;
                  }
                  e1 -> e4;
                  e1 -> e3;
                  e1 -> e2;
                  e2 -> e5;
                  e2 -> e6;
                  e3 -> e7;
                  e4 -> e8;
                  e4 -> e9;

                  e5 [fillcolor=cyan];
                  e6 [fillcolor=cyan];
                  e7 [fillcolor=cyan];
                  e8 [fillcolor=cyan];
                  e9 [fillcolor=cyan];

        }

        subgraph cluster02 {
                 bgcolor=white;
                 label="posting tree";
                 subgraph pgroup1 {
                          p1;
                 }
                 subgraph pgroup2 {
                          rank=same;
                          p2 -> p3;
                 }
                 p1 -> p2;
                 p1 -> p3;

                 p2 [fillcolor=deepskyblue];
                 p3 [fillcolor=deepskyblue];
        }

        subgraph cluster03 {
                 bgcolor=white;
                 label="posting tree";
                 subgraph pgroup3 {
                          p4;
                 }

                 p4 [fillcolor=deepskyblue];
        }

        subgraph cluster04 {
                 bgcolor=white;
                 label="posting tree";
                 subgraph pgroup4 {
                          p5;
                 }
                 subgraph pgroup5 {
                          rank=same;
                          p6 -> p7;
                 }
                 p5 -> p6;
                 p5 -> p7;

                 p6 [fillcolor=deepskyblue];
                 p7 [fillcolor=deepskyblue];
        }

        subgraph cluster05 {
                 bgcolor=white;
                 label="pending list";
                 node [fillcolor=wheat, label="pending entries", width=1.8];
                 n1 -> n2 -> n3 -> n4 -> n5;
        }

        m1 -> e1;
        e5 -> p1;
        e7 -> p4;
        e7 -> p5;
        m1 -> n1;

        // Explanations
        expl_1 [shape=plaintext,                 width=2.5, label="Internal tree node"];
        expl_2 [shape=plaintext, fillcolor=cyan, width=5.2, label="<posting list> and/or pointer to <posting tree>"];
        expl_3 [shape=plaintext, fillcolor=deepskyblue, width=2.0, label="Only <posting list>"];
        p6 -> expl_1 [style=invis];
        p6 -> expl_2 [style=invis];
        p6 -> expl_3 [style=invis];

}
