How do I force GraphViz to place nodes in the order they're listed? (or: family tree problems pt. 2)

In my previous thread, I worked out how to use GraphViz to produce a somewhat-nice-looking family tree showing a person, their sibling, their aunts & uncles, and their direct ancestors back through great-grandparents. I also worked out that, in order to get the person nodes laid out in the correct positions, I had to list the “definitions” of the person nodes in the order that the persons first appear in the “family clusters,” except that each ancestor should also be listed with their siblings in display order from left to right. (The order of the “family clusters” is based on how my DOT-generating code iterates through the source GEDCOM file[1]; I still have no idea whether the relative ordering of these clusters matters to the final output.)

Unfortunately, when I then tried to add great-aunts and great-uncles to the tree following what I’d learned, the output went wrong again.

Attempt #1
digraph {
    splines = ortho;
    node [shape=box]
    edge [dir=none]

    SMITH_AMANDA [label="Amanda Smith", style=filled, fillcolor=bisque];
    SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];
    JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
    JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
    JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
    SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
    SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
    SMITH_BARTHOLOMEW [label="Bartholomew Smith", style=filled, fillcolor=azure2];
    SMITH_BASIL [label="Basil Smith", style=filled, fillcolor=azure2];
    SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
    SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];
    JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
    JOHNSON_BJORN [label="Bjorn Johnson", style=filled, fillcolor=azure2];
    JONES_HARRISON [label="Harrison Jones", style=filled, fillcolor=azure2];
    JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];
    ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
    ADAMS_ALICIA [label="Alicia Adams", style=filled, fillcolor=bisque];
    ADAMS_ALINE [label="Aline Adams", style=filled, fillcolor=bisque];
    ADAMS_ARTHUR [label="Arthur Adams", style=filled, fillcolor=azure2];
    SMITH_CHARLES [label="Charles Smith", style=filled, fillcolor=azure2];
    NEWTON_CHARLOTTE [label="Charlotte Newton", style=filled, fillcolor=bisque];
    JOHNSON_BAINES [label="Baines Johnson", style=filled, fillcolor=azure2];
    MAXWELL_MARGARET [label="Margaret Maxwell", style=filled, fillcolor=bisque];
    JONES_JEREMIAH [label="Jeremiah Jones", style=filled, fillcolor=azure2];
    PLANK_PATRICIA [label="Patricia Plank", style=filled, fillcolor=bisque];
    ADAMS_DOUGLAS [label="Douglas Adams", style=filled, fillcolor=azure2];
    DENT_URSULA [label="Ursula Dent", style=filled, fillcolor=bisque];

    subgraph cluster_F3 {
        peripheries=0;
        {
            rank=same;
            F3_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_ADAM -> F3_top
            F3_top -> JONES_MARY
        }
    }
    {
        rank=same;
        F3_0 [shape=circle, label="", height=0.01, width=0.01];
        F3_1 [shape=circle, label="", height=0.01, width=0.01];
        F3_2 [shape=circle, label="", height=0.01, width=0.01];
        F3_0 -> F3_1 -> F3_2;
    }
    F3_top -> F3_1;
    F3_0 -> SMITH_JOHN;
    F3_2 -> SMITH_JANE;

    subgraph cluster_F1 {
        peripheries=0;
        {
            rank=same;
            F1_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_BERTRAND -> F1_top
            F1_top -> JOHNSON_BEATRICE
        }
    }
    {
        rank=same;
        F1_0 [shape=circle, label="", height=0.01, width=0.01];
        F1_1 [shape=circle, label="", height=0.01, width=0.01];
        F1_2 [shape=circle, label="", height=0.01, width=0.01];
        F1_0 -> F1_1 -> F1_2;
    }
    F1_top -> F1_1;
    F1_0 -> SMITH_AMANDA;
    F1_2 -> SMITH_ADAM;

    subgraph cluster_F2 {
        peripheries=0;
        {
            rank=same;
            F2_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_HENRY -> F2_top
            F2_top -> ADAMS_ABIGAIL
        }
    }
    {
        rank=same;
        F2_0 [shape=circle, label="", height=0.01, width=0.01];
        F2_1 [shape=circle, label="", height=0.01, width=0.01];
        F2_2 [shape=circle, label="", height=0.01, width=0.01];
        F2_0 -> F2_1 -> F2_2;
    }
    F2_top -> F2_1;
    F2_0 -> JONES_MARY;
    F2_1 -> JONES_HENRY_JR;
    F2_2 -> JONES_DIANA;

    subgraph cluster_F4 {
        peripheries=0;
        {
            rank=same;
            F4_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_CHARLES -> F4_top
            F4_top -> NEWTON_CHARLOTTE
        }
    }
    {
        rank=same;
        F4_0 [shape=circle, label="", height=0.01, width=0.01];
        F4_1 [shape=circle, label="", height=0.01, width=0.01];
        F4_2 [shape=circle, label="", height=0.01, width=0.01];
        F4_3 [shape=circle, label="", height=0.01, width=0.01];
        F4_4 [shape=circle, label="", height=0.01, width=0.01];
        F4_0 -> F4_1 -> F4_2 -> F4_3 -> F4_4;
    }
    F4_top -> F4_2;
    F4_0 -> SMITH_BARTHOLOMEW;
    F4_1 -> SMITH_BASIL;
    F4_3 -> SMITH_BRIDGET;
    F4_4 -> SMITH_BERTRAND;

    subgraph cluster_F5 {
        peripheries=0;
        {
            rank=same;
            F5_top [shape=circle, label="", height=0.01, width=0.01];
            JOHNSON_BAINES -> F5_top
            F5_top -> MAXWELL_MARGARET
        }
    }
    {
        rank=same;
        F5_0 [shape=circle, label="", height=0.01, width=0.01];
        F5_1 [shape=circle, label="", height=0.01, width=0.01];
        F5_2 [shape=circle, label="", height=0.01, width=0.01];
        F5_0 -> F5_1 -> F5_2;
    }
    F5_top -> F5_1;
    F5_0 -> JOHNSON_BEATRICE;
    F5_2 -> JOHNSON_BJORN;

    subgraph cluster_F6 {
        peripheries=0;
        {
            rank=same;
            F6_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_JEREMIAH -> F6_top
            F6_top -> PLANK_PATRICIA
        }
    }
    {
        rank=same;
        F6_0 [shape=circle, label="", height=0.01, width=0.01];
        F6_1 [shape=circle, label="", height=0.01, width=0.01];
        F6_2 [shape=circle, label="", height=0.01, width=0.01];
        F6_0 -> F6_1 -> F6_2;
    }
    F6_top -> F6_1;
    F6_0 -> JONES_HARRISON;
    F6_2 -> JONES_HENRY;

    subgraph cluster_F7 {
        peripheries=0;
        {
            rank=same;
            F7_top [shape=circle, label="", height=0.01, width=0.01];
            ADAMS_DOUGLAS -> F7_top
            F7_top -> DENT_URSULA
        }
    }
    {
        rank=same;
        F7_0 [shape=circle, label="", height=0.01, width=0.01];
        F7_1 [shape=circle, label="", height=0.01, width=0.01];
        F7_2 [shape=circle, label="", height=0.01, width=0.01];
        F7_3 [shape=circle, label="", height=0.01, width=0.01];
        F7_4 [shape=circle, label="", height=0.01, width=0.01];
        F7_0 -> F7_1 -> F7_2 -> F7_3 -> F7_4;
    }
    F7_top -> F7_2;
    F7_0 -> ADAMS_ABIGAIL;
    F7_1 -> ADAMS_ALICIA;
    F7_3 -> ADAMS_ALINE;
    F7_4 -> ADAMS_ARTHUR;
}

[dot]

digraph {
    splines = ortho;
    node [shape=box]
    edge [dir=none]

    SMITH_AMANDA [label="Amanda Smith", style=filled, fillcolor=bisque];
    SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];
    JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
    JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
    JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
    SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
    SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
    SMITH_BARTHOLOMEW [label="Bartholomew Smith", style=filled, fillcolor=azure2];
    SMITH_BASIL [label="Basil Smith", style=filled, fillcolor=azure2];
    SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
    SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];
    JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
    JOHNSON_BJORN [label="Bjorn Johnson", style=filled, fillcolor=azure2];
    JONES_HARRISON [label="Harrison Jones", style=filled, fillcolor=azure2];
    JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];
    ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
    ADAMS_ALICIA [label="Alicia Adams", style=filled, fillcolor=bisque];
    ADAMS_ALINE [label="Aline Adams", style=filled, fillcolor=bisque];
    ADAMS_ARTHUR [label="Arthur Adams", style=filled, fillcolor=azure2];
    SMITH_CHARLES [label="Charles Smith", style=filled, fillcolor=azure2];
    NEWTON_CHARLOTTE [label="Charlotte Newton", style=filled, fillcolor=bisque];
    JOHNSON_BAINES [label="Baines Johnson", style=filled, fillcolor=azure2];
    MAXWELL_MARGARET [label="Margaret Maxwell", style=filled, fillcolor=bisque];
    JONES_JEREMIAH [label="Jeremiah Jones", style=filled, fillcolor=azure2];
    PLANK_PATRICIA [label="Patricia Plank", style=filled, fillcolor=bisque];
    ADAMS_DOUGLAS [label="Douglas Adams", style=filled, fillcolor=azure2];
    DENT_URSULA [label="Ursula Dent", style=filled, fillcolor=bisque];

    subgraph cluster_F3 {
        peripheries=0;
        {
            rank=same;
            F3_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_ADAM -> F3_top
            F3_top -> JONES_MARY
        }
    }
    {
        rank=same;
        F3_0 [shape=circle, label="", height=0.01, width=0.01];
        F3_1 [shape=circle, label="", height=0.01, width=0.01];
        F3_2 [shape=circle, label="", height=0.01, width=0.01];
        F3_0 -> F3_1 -> F3_2;
    }
    F3_top -> F3_1;
    F3_0 -> SMITH_JOHN;
    F3_2 -> SMITH_JANE;

    subgraph cluster_F1 {
        peripheries=0;
        {
            rank=same;
            F1_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_BERTRAND -> F1_top
            F1_top -> JOHNSON_BEATRICE
        }
    }
    {
        rank=same;
        F1_0 [shape=circle, label="", height=0.01, width=0.01];
        F1_1 [shape=circle, label="", height=0.01, width=0.01];
        F1_2 [shape=circle, label="", height=0.01, width=0.01];
        F1_0 -> F1_1 -> F1_2;
    }
    F1_top -> F1_1;
    F1_0 -> SMITH_AMANDA;
    F1_2 -> SMITH_ADAM;

    subgraph cluster_F2 {
        peripheries=0;
        {
            rank=same;
            F2_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_HENRY -> F2_top
            F2_top -> ADAMS_ABIGAIL
        }
    }
    {
        rank=same;
        F2_0 [shape=circle, label="", height=0.01, width=0.01];
        F2_1 [shape=circle, label="", height=0.01, width=0.01];
        F2_2 [shape=circle, label="", height=0.01, width=0.01];
        F2_0 -> F2_1 -> F2_2;
    }
    F2_top -> F2_1;
    F2_0 -> JONES_MARY;
    F2_1 -> JONES_HENRY_JR;
    F2_2 -> JONES_DIANA;

    subgraph cluster_F4 {
        peripheries=0;
        {
            rank=same;
            F4_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_CHARLES -> F4_top
            F4_top -> NEWTON_CHARLOTTE
        }
    }
    {
        rank=same;
        F4_0 [shape=circle, label="", height=0.01, width=0.01];
        F4_1 [shape=circle, label="", height=0.01, width=0.01];
        F4_2 [shape=circle, label="", height=0.01, width=0.01];
        F4_3 [shape=circle, label="", height=0.01, width=0.01];
        F4_4 [shape=circle, label="", height=0.01, width=0.01];
        F4_0 -> F4_1 -> F4_2 -> F4_3 -> F4_4;
    }
    F4_top -> F4_2;
    F4_0 -> SMITH_BARTHOLOMEW;
    F4_1 -> SMITH_BASIL;
    F4_3 -> SMITH_BRIDGET;
    F4_4 -> SMITH_BERTRAND;

    subgraph cluster_F5 {
        peripheries=0;
        {
            rank=same;
            F5_top [shape=circle, label="", height=0.01, width=0.01];
            JOHNSON_BAINES -> F5_top
            F5_top -> MAXWELL_MARGARET
        }
    }
    {
        rank=same;
        F5_0 [shape=circle, label="", height=0.01, width=0.01];
        F5_1 [shape=circle, label="", height=0.01, width=0.01];
        F5_2 [shape=circle, label="", height=0.01, width=0.01];
        F5_0 -> F5_1 -> F5_2;
    }
    F5_top -> F5_1;
    F5_0 -> JOHNSON_BEATRICE;
    F5_2 -> JOHNSON_BJORN;

    subgraph cluster_F6 {
        peripheries=0;
        {
            rank=same;
            F6_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_JEREMIAH -> F6_top
            F6_top -> PLANK_PATRICIA
        }
    }
    {
        rank=same;
        F6_0 [shape=circle, label="", height=0.01, width=0.01];
        F6_1 [shape=circle, label="", height=0.01, width=0.01];
        F6_2 [shape=circle, label="", height=0.01, width=0.01];
        F6_0 -> F6_1 -> F6_2;
    }
    F6_top -> F6_1;
    F6_0 -> JONES_HARRISON;
    F6_2 -> JONES_HENRY;

    subgraph cluster_F7 {
        peripheries=0;
        {
            rank=same;
            F7_top [shape=circle, label="", height=0.01, width=0.01];
            ADAMS_DOUGLAS -> F7_top
            F7_top -> DENT_URSULA
        }
    }
    {
        rank=same;
        F7_0 [shape=circle, label="", height=0.01, width=0.01];
        F7_1 [shape=circle, label="", height=0.01, width=0.01];
        F7_2 [shape=circle, label="", height=0.01, width=0.01];
        F7_3 [shape=circle, label="", height=0.01, width=0.01];
        F7_4 [shape=circle, label="", height=0.01, width=0.01];
        F7_0 -> F7_1 -> F7_2 -> F7_3 -> F7_4;
    }
    F7_top -> F7_2;
    F7_0 -> ADAMS_ABIGAIL;
    F7_1 -> ADAMS_ALICIA;
    F7_3 -> ADAMS_ALINE;
    F7_4 -> ADAMS_ARTHUR;
}

[/dot]

Specifically, Bertrand Smith’s siblings & parents, rather than being placed to the left of & above him, respectively, have been relocated as a group to the right of Bertrand’s wife’s birth family, and the same problem applies to Henry Jones in the same generation and his sibling & parents. This is despite Bertrand’s siblings being listed before him in the DOT source, and likewise for Henry.

So then I thought I should try explicitly telling GraphViz “Put these nodes in this order” by organizing each generation into a subgraph with rank=same; and rankdir=LR;, like so:

Attempt #2
digraph {
    splines = ortho;
    node [shape=box]
    edge [dir=none]

    {
        rank=same;
        rankdir=LR;

        SMITH_CHARLES [label="Charles Smith", style=filled, fillcolor=azure2];
        NEWTON_CHARLOTTE [label="Charlotte Newton", style=filled, fillcolor=bisque];

        JOHNSON_BAINES [label="Baines Johnson", style=filled, fillcolor=azure2];
        MAXWELL_MARGARET [label="Margaret Maxwell", style=filled, fillcolor=bisque];

        JONES_JEREMIAH [label="Jeremiah Jones", style=filled, fillcolor=azure2];
        PLANK_PATRICIA [label="Patricia Plank", style=filled, fillcolor=bisque];

        ADAMS_DOUGLAS [label="Douglas Adams", style=filled, fillcolor=azure2];
        DENT_URSULA [label="Ursula Dent", style=filled, fillcolor=bisque];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_BARTHOLOMEW [label="Bartholomew Smith", style=filled, fillcolor=azure2];
        SMITH_BASIL [label="Basil Smith", style=filled, fillcolor=azure2];
        SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
        SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];

        JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
        JOHNSON_BJORN [label="Bjorn Johnson", style=filled, fillcolor=azure2];

        JONES_HARRISON [label="Harrison Jones", style=filled, fillcolor=azure2];
        JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];

        ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
        ADAMS_ALICIA [label="Alicia Adams", style=filled, fillcolor=bisque];
        ADAMS_ALINE [label="Aline Adams", style=filled, fillcolor=bisque];
        ADAMS_ARTHUR [label="Arthur Adams", style=filled, fillcolor=azure2];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_AMANDA [label="Amanda Smith", style=filled, fillcolor=bisque];
        SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];

        JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
        JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
        JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
        SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
    }

    subgraph cluster_F3 {
        peripheries=0;
        {
            rank=same;
            F3_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_ADAM -> F3_top
            F3_top -> JONES_MARY
        }
    }
    {
        rank=same;
        F3_0 [shape=circle, label="", height=0.01, width=0.01];
        F3_1 [shape=circle, label="", height=0.01, width=0.01];
        F3_2 [shape=circle, label="", height=0.01, width=0.01];
        F3_0 -> F3_1 -> F3_2;
    }
    F3_top -> F3_1;
    F3_0 -> SMITH_JOHN;
    F3_2 -> SMITH_JANE;

    subgraph cluster_F1 {
        peripheries=0;
        {
            rank=same;
            F1_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_BERTRAND -> F1_top
            F1_top -> JOHNSON_BEATRICE
        }
    }
    {
        rank=same;
        F1_0 [shape=circle, label="", height=0.01, width=0.01];
        F1_1 [shape=circle, label="", height=0.01, width=0.01];
        F1_2 [shape=circle, label="", height=0.01, width=0.01];
        F1_0 -> F1_1 -> F1_2;
    }
    F1_top -> F1_1;
    F1_0 -> SMITH_AMANDA;
    F1_2 -> SMITH_ADAM;

    subgraph cluster_F2 {
        peripheries=0;
        {
            rank=same;
            F2_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_HENRY -> F2_top
            F2_top -> ADAMS_ABIGAIL
        }
    }
    {
        rank=same;
        F2_0 [shape=circle, label="", height=0.01, width=0.01];
        F2_1 [shape=circle, label="", height=0.01, width=0.01];
        F2_2 [shape=circle, label="", height=0.01, width=0.01];
        F2_0 -> F2_1 -> F2_2;
    }
    F2_top -> F2_1;
    F2_0 -> JONES_MARY;
    F2_1 -> JONES_HENRY_JR;
    F2_2 -> JONES_DIANA;

    subgraph cluster_F4 {
        peripheries=0;
        {
            rank=same;
            F4_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_CHARLES -> F4_top
            F4_top -> NEWTON_CHARLOTTE
        }
    }
    {
        rank=same;
        F4_0 [shape=circle, label="", height=0.01, width=0.01];
        F4_1 [shape=circle, label="", height=0.01, width=0.01];
        F4_2 [shape=circle, label="", height=0.01, width=0.01];
        F4_3 [shape=circle, label="", height=0.01, width=0.01];
        F4_4 [shape=circle, label="", height=0.01, width=0.01];
        F4_0 -> F4_1 -> F4_2 -> F4_3 -> F4_4;
    }
    F4_top -> F4_2;
    F4_0 -> SMITH_BARTHOLOMEW;
    F4_1 -> SMITH_BASIL;
    F4_3 -> SMITH_BRIDGET;
    F4_4 -> SMITH_BERTRAND;

    subgraph cluster_F5 {
        peripheries=0;
        {
            rank=same;
            F5_top [shape=circle, label="", height=0.01, width=0.01];
            JOHNSON_BAINES -> F5_top
            F5_top -> MAXWELL_MARGARET
        }
    }
    {
        rank=same;
        F5_0 [shape=circle, label="", height=0.01, width=0.01];
        F5_1 [shape=circle, label="", height=0.01, width=0.01];
        F5_2 [shape=circle, label="", height=0.01, width=0.01];
        F5_0 -> F5_1 -> F5_2;
    }
    F5_top -> F5_1;
    F5_0 -> JOHNSON_BEATRICE;
    F5_2 -> JOHNSON_BJORN;

    subgraph cluster_F6 {
        peripheries=0;
        {
            rank=same;
            F6_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_JEREMIAH -> F6_top
            F6_top -> PLANK_PATRICIA
        }
    }
    {
        rank=same;
        F6_0 [shape=circle, label="", height=0.01, width=0.01];
        F6_1 [shape=circle, label="", height=0.01, width=0.01];
        F6_2 [shape=circle, label="", height=0.01, width=0.01];
        F6_0 -> F6_1 -> F6_2;
    }
    F6_top -> F6_1;
    F6_0 -> JONES_HARRISON;
    F6_2 -> JONES_HENRY;

    subgraph cluster_F7 {
        peripheries=0;
        {
            rank=same;
            F7_top [shape=circle, label="", height=0.01, width=0.01];
            ADAMS_DOUGLAS -> F7_top
            F7_top -> DENT_URSULA
        }
    }
    {
        rank=same;
        F7_0 [shape=circle, label="", height=0.01, width=0.01];
        F7_1 [shape=circle, label="", height=0.01, width=0.01];
        F7_2 [shape=circle, label="", height=0.01, width=0.01];
        F7_3 [shape=circle, label="", height=0.01, width=0.01];
        F7_4 [shape=circle, label="", height=0.01, width=0.01];
        F7_0 -> F7_1 -> F7_2 -> F7_3 -> F7_4;
    }
    F7_top -> F7_2;
    F7_0 -> ADAMS_ABIGAIL;
    F7_1 -> ADAMS_ALICIA;
    F7_3 -> ADAMS_ALINE;
    F7_4 -> ADAMS_ARTHUR;
}

[dot]

digraph {
    splines = ortho;
    node [shape=box]
    edge [dir=none]

    {
        rank=same;
        rankdir=LR;

        SMITH_CHARLES [label="Charles Smith", style=filled, fillcolor=azure2];
        NEWTON_CHARLOTTE [label="Charlotte Newton", style=filled, fillcolor=bisque];

        JOHNSON_BAINES [label="Baines Johnson", style=filled, fillcolor=azure2];
        MAXWELL_MARGARET [label="Margaret Maxwell", style=filled, fillcolor=bisque];

        JONES_JEREMIAH [label="Jeremiah Jones", style=filled, fillcolor=azure2];
        PLANK_PATRICIA [label="Patricia Plank", style=filled, fillcolor=bisque];

        ADAMS_DOUGLAS [label="Douglas Adams", style=filled, fillcolor=azure2];
        DENT_URSULA [label="Ursula Dent", style=filled, fillcolor=bisque];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_BARTHOLOMEW [label="Bartholomew Smith", style=filled, fillcolor=azure2];
        SMITH_BASIL [label="Basil Smith", style=filled, fillcolor=azure2];
        SMITH_BRIDGET [label="Bridget Smith", style=filled, fillcolor=bisque];
        SMITH_BERTRAND [label="Bertrand Smith", style=filled, fillcolor=azure2];

        JOHNSON_BEATRICE [label="Beatrice Johnson", style=filled, fillcolor=bisque];
        JOHNSON_BJORN [label="Bjorn Johnson", style=filled, fillcolor=azure2];

        JONES_HARRISON [label="Harrison Jones", style=filled, fillcolor=azure2];
        JONES_HENRY [label="Henry Jones", style=filled, fillcolor=azure2];

        ADAMS_ABIGAIL [label="Abigail Adams", style=filled, fillcolor=bisque];
        ADAMS_ALICIA [label="Alicia Adams", style=filled, fillcolor=bisque];
        ADAMS_ALINE [label="Aline Adams", style=filled, fillcolor=bisque];
        ADAMS_ARTHUR [label="Arthur Adams", style=filled, fillcolor=azure2];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_AMANDA [label="Amanda Smith", style=filled, fillcolor=bisque];
        SMITH_ADAM [label="Adam Smith", style=filled, fillcolor=azure2];

        JONES_MARY [label="Mary Jones", style=filled, fillcolor=bisque];
        JONES_HENRY_JR [label="Henry Jones Junior", style=filled, fillcolor=azure2];
        JONES_DIANA [label="Diana Jones", style=filled, fillcolor=bisque];
    }

    {
        rank=same;
        rankdir=LR;

        SMITH_JOHN [label="John Smith", style=filled, fillcolor=azure2];
        SMITH_JANE [label="Jane Smith", style=filled, fillcolor=bisque];
    }

    subgraph cluster_F3 {
        peripheries=0;
        {
            rank=same;
            F3_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_ADAM -> F3_top
            F3_top -> JONES_MARY
        }
    }
    {
        rank=same;
        F3_0 [shape=circle, label="", height=0.01, width=0.01];
        F3_1 [shape=circle, label="", height=0.01, width=0.01];
        F3_2 [shape=circle, label="", height=0.01, width=0.01];
        F3_0 -> F3_1 -> F3_2;
    }
    F3_top -> F3_1;
    F3_0 -> SMITH_JOHN;
    F3_2 -> SMITH_JANE;

    subgraph cluster_F1 {
        peripheries=0;
        {
            rank=same;
            F1_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_BERTRAND -> F1_top
            F1_top -> JOHNSON_BEATRICE
        }
    }
    {
        rank=same;
        F1_0 [shape=circle, label="", height=0.01, width=0.01];
        F1_1 [shape=circle, label="", height=0.01, width=0.01];
        F1_2 [shape=circle, label="", height=0.01, width=0.01];
        F1_0 -> F1_1 -> F1_2;
    }
    F1_top -> F1_1;
    F1_0 -> SMITH_AMANDA;
    F1_2 -> SMITH_ADAM;

    subgraph cluster_F2 {
        peripheries=0;
        {
            rank=same;
            F2_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_HENRY -> F2_top
            F2_top -> ADAMS_ABIGAIL
        }
    }
    {
        rank=same;
        F2_0 [shape=circle, label="", height=0.01, width=0.01];
        F2_1 [shape=circle, label="", height=0.01, width=0.01];
        F2_2 [shape=circle, label="", height=0.01, width=0.01];
        F2_0 -> F2_1 -> F2_2;
    }
    F2_top -> F2_1;
    F2_0 -> JONES_MARY;
    F2_1 -> JONES_HENRY_JR;
    F2_2 -> JONES_DIANA;

    subgraph cluster_F4 {
        peripheries=0;
        {
            rank=same;
            F4_top [shape=circle, label="", height=0.01, width=0.01];
            SMITH_CHARLES -> F4_top
            F4_top -> NEWTON_CHARLOTTE
        }
    }
    {
        rank=same;
        F4_0 [shape=circle, label="", height=0.01, width=0.01];
        F4_1 [shape=circle, label="", height=0.01, width=0.01];
        F4_2 [shape=circle, label="", height=0.01, width=0.01];
        F4_3 [shape=circle, label="", height=0.01, width=0.01];
        F4_4 [shape=circle, label="", height=0.01, width=0.01];
        F4_0 -> F4_1 -> F4_2 -> F4_3 -> F4_4;
    }
    F4_top -> F4_2;
    F4_0 -> SMITH_BARTHOLOMEW;
    F4_1 -> SMITH_BASIL;
    F4_3 -> SMITH_BRIDGET;
    F4_4 -> SMITH_BERTRAND;

    subgraph cluster_F5 {
        peripheries=0;
        {
            rank=same;
            F5_top [shape=circle, label="", height=0.01, width=0.01];
            JOHNSON_BAINES -> F5_top
            F5_top -> MAXWELL_MARGARET
        }
    }
    {
        rank=same;
        F5_0 [shape=circle, label="", height=0.01, width=0.01];
        F5_1 [shape=circle, label="", height=0.01, width=0.01];
        F5_2 [shape=circle, label="", height=0.01, width=0.01];
        F5_0 -> F5_1 -> F5_2;
    }
    F5_top -> F5_1;
    F5_0 -> JOHNSON_BEATRICE;
    F5_2 -> JOHNSON_BJORN;

    subgraph cluster_F6 {
        peripheries=0;
        {
            rank=same;
            F6_top [shape=circle, label="", height=0.01, width=0.01];
            JONES_JEREMIAH -> F6_top
            F6_top -> PLANK_PATRICIA
        }
    }
    {
        rank=same;
        F6_0 [shape=circle, label="", height=0.01, width=0.01];
        F6_1 [shape=circle, label="", height=0.01, width=0.01];
        F6_2 [shape=circle, label="", height=0.01, width=0.01];
        F6_0 -> F6_1 -> F6_2;
    }
    F6_top -> F6_1;
    F6_0 -> JONES_HARRISON;
    F6_2 -> JONES_HENRY;

    subgraph cluster_F7 {
        peripheries=0;
        {
            rank=same;
            F7_top [shape=circle, label="", height=0.01, width=0.01];
            ADAMS_DOUGLAS -> F7_top
            F7_top -> DENT_URSULA
        }
    }
    {
        rank=same;
        F7_0 [shape=circle, label="", height=0.01, width=0.01];
        F7_1 [shape=circle, label="", height=0.01, width=0.01];
        F7_2 [shape=circle, label="", height=0.01, width=0.01];
        F7_3 [shape=circle, label="", height=0.01, width=0.01];
        F7_4 [shape=circle, label="", height=0.01, width=0.01];
        F7_0 -> F7_1 -> F7_2 -> F7_3 -> F7_4;
    }
    F7_top -> F7_2;
    F7_0 -> ADAMS_ABIGAIL;
    F7_1 -> ADAMS_ALICIA;
    F7_3 -> ADAMS_ALINE;
    F7_4 -> ADAMS_ARTHUR;
}

[/dot]

THAT JUST MADE EVERYTHING WORSE, and many of the nodes still aren’t in the correct order.

Hence, my question: Is there a way to tell GraphViz that I want some set of nodes to be laid out from top to bottom & left to right in the order that they’re listed in the DOT source? Alternatively, is there a simple & predictable way to list the nodes for something like this so that they’re placed where I want them?


  1. To be clear: The family trees I’m showing are all for made-up people, even if they come from a file format for real-world genealogy. ↩︎

No, there is no simple & predictable way to set the output order. There are at least two Issues to provide this capability, but nothing today.