5D Library › Tarot Hypergeometric Sampling, Lenormand Grid Topology and Kabbalistic Tree Graphs · 中文

Chapter 4. The Tree of Life as a Graph: Spectrum, Centrality and Paths

Ten nodes and twenty-two edges

The book uses the Tree of Life of Kircher’s Oedipus Aegyptiacus (Kircher 1652), the shape later used by the Golden Dawn and by most Western versions after it (Decker et al. 1996). The ten sephiroth are numbered 1 Kether (crown), 2 Chokmah (wisdom), 3 Binah (understanding), 4 Chesed (mercy), 5 Geburah (strength), 6 Tiphereth (beauty), 7 Netzach (victory), 8 Hod (splendour), 9 Yesod (foundation) and 10 Malkuth (kingdom). The 22 paths are numbered 11 to 32 in Kircher’s order, each with a Hebrew letter and a major arcanum (Chapter 7).

As a graph it has 10 vertices and 22 edges, with degree sum 44. The eigenvalues of the graph Laplacian L=D−AL = D – A describe how the graph hangs together: the larger the smallest non-zero eigenvalue (the algebraic connectivity), the harder it is to cut the graph in two; the number of spanning trees is given by the matrix-tree theorem as the determinant of any principal minor of LL.

Calculation

# Chapter 4. p08: The Tree of Life as a graph - Laplacian and centrality.
# Ten sephiroth: 1 Kether, 2 Chokmah, 3 Binah, 4 Chesed, 5 Geburah,
# 6 Tiphereth, 7 Netzach, 8 Hod, 9 Yesod, 10 Malkuth. The 22 paths of the
# Kircher / Golden Dawn tree, numbered 11-32 in Kircher's order.
# L = D - A. Eigenvalues by the cyclic Jacobi method (pure Python);
# spanning trees by the matrix-tree theorem (exact determinant).
from fractions import Fraction

PATHS = [(1, 2), (1, 3), (1, 6), (2, 3), (2, 6), (2, 4), (3, 6), (3, 5),
         (4, 5), (4, 6), (4, 7), (5, 6), (5, 8), (6, 7), (6, 9), (6, 8),
         (7, 8), (7, 9), (7, 10), (8, 9), (8, 10), (9, 10)]
NAMES = ["Kether", "Chokmah", "Binah", "Chesed", "Geburah", "Tiphereth",
         "Netzach", "Hod", "Yesod", "Malkuth"]
n = 10

def adjacency():
    A = [[0] * n for _ in range(n)]
    for a, b in PATHS:
        A[a - 1][b - 1] = A[b - 1][a - 1] = 1
    return A

def jacobi(M, sweeps=60):
    M = [row[:] for row in M]
    for _ in range(sweeps):
        for p in range(n):
            for q in range(p + 1, n):
                if abs(M[p][q]) < 1e-15:
                    continue
                th = (M[q][q] - M[p][p]) / (2 * M[p][q])
                t = (1 if th >= 0 else -1) / (abs(th) + (th * th + 1) ** .5)
                c = 1 / (t * t + 1) ** .5
                s = t * c
                for k in range(n):
                    mkp, mkq = M[k][p], M[k][q]
                    M[k][p], M[k][q] = c * mkp - s * mkq, s * mkp + c * mkq
                for k in range(n):
                    mpk, mqk = M[p][k], M[q][k]
                    M[p][k], M[q][k] = c * mpk - s * mqk, s * mpk + c * mqk
    return sorted(M[i][i] for i in range(n))

def det(M):
    M = [[Fraction(x) for x in row] for row in M]
    d, m = Fraction(1), len(M)
    for i in range(m):
        piv = next(r for r in range(i, m) if M[r][i] != 0)
        if piv != i:
            M[i], M[piv] = M[piv], M[i]
            d = -d
        d *= M[i][i]
        for r in range(i + 1, m):
            f = M[r][i] / M[i][i]
            M[r] = [x - f * y for x, y in zip(M[r], M[i])]
    return d

if __name__ == "__main__":
    A = adjacency()
    deg = [sum(r) for r in A]
    L = [[(deg[i] if i == j else 0) - A[i][j] for j in range(n)]
         for i in range(n)]
    print("   edges {}, degree sum {}".format(len(PATHS), sum(deg)))
    lam = jacobi(L)
    lam[0] = abs(lam[0])            # the zero eigenvalue, sign of rounding
    print("   Laplacian spectrum: " + " ".join("{:.3f}".format(x)
                                             for x in lam[:5]))
    print("                       " + " ".join("{:.3f}".format(x)
                                             for x in lam[5:]))
    print("   algebraic connectivity {:.4f}; largest {:.4f}".format(
        lam[1], lam[-1]))
    trees = det([row[1:] for row in L[1:]])
    print("   spanning trees (matrix-tree theorem): {}".format(trees))
    x = [1.0] * n
    for _ in range(500):
        y = [sum(A[i][j] * x[j] for j in range(n)) for i in range(n)]
        s = max(y)
        x = [v / s for v in y]
    print("   node        degree  eigenvector centrality (max = 1)")
    for i in range(n):
        print("   {:2d} {:9s}  {:5d}   {:.4f}".format(
            i + 1, NAMES[i], deg[i], x[i]))
    print("   largest adjacency eigenvalue {:.4f}".format(s))
#    edges 22, degree sum 44
#    Laplacian spectrum: 0.000 1.281 2.891 3.753 4.329
#                        4.684 5.445 5.738 6.802 9.077
#    algebraic connectivity 1.2805; largest 9.0771
#    spanning trees (matrix-tree theorem): 54349
#    node        degree  eigenvector centrality (max = 1)
#     1 Kether         3   0.4420
#     2 Chokmah        4   0.5469
#     3 Binah          4   0.5469
#     4 Chesed         4   0.6015
#     5 Geburah        4   0.6015
#     6 Tiphereth      8   1.0000
#     7 Netzach        5   0.7010
#     8 Hod            5   0.7010
#     9 Yesod          4   0.5961
#    10 Malkuth        3   0.4218
#    largest adjacency eigenvalue 4.7369

Spectrum and eigenvector centrality

The Laplacian spectrum runs from 0 to 9.0771, the algebraic connectivity is 1.2805 and there are 54349 spanning trees. The largest Laplacian eigenvalue, 9.0771, lies just above the lower bound “largest degree plus one”, that is 9, the trace left by Tiphereth’s degree of 8.

Eigenvector centrality defines the importance of a node as the sum of the importance of its neighbours (the leading eigenvector of the adjacency matrix). Normalised to a maximum of 1, Tiphereth scores 1.0000, followed by Netzach and Hod (0.7010), then Chesed and Geburah (0.6015), Yesod (0.5961), Chokmah and Binah (0.5469), with Kether (0.4420) and Malkuth (0.4218) lowest. The largest eigenvalue of the adjacency matrix is 4.7369.

Betweenness, symmetry and the three pillars

Calculation

# Chapter 4. p09: Who sits on the shortest paths? Betweenness, closeness,
# symmetry and the three pillars.
# Brandes' algorithm for unweighted betweenness (pairs counted once).
# Automorphisms: every relabelling of the ten nodes that keeps the 22
# edges, found by backtracking. Pillars: Mercy 2-4-7, Severity 3-5-8,
# Middle 1-6-9-10.
from fractions import Fraction

PATHS = [(1, 2), (1, 3), (1, 6), (2, 3), (2, 6), (2, 4), (3, 6), (3, 5),
         (4, 5), (4, 6), (4, 7), (5, 6), (5, 8), (6, 7), (6, 9), (6, 8),
         (7, 8), (7, 9), (7, 10), (8, 9), (8, 10), (9, 10)]
N = range(1, 11)
ADJ = {v: set() for v in N}
for a, b in PATHS:
    ADJ[a].add(b)
    ADJ[b].add(a)

def bfs(s):
    dist, sigma, order = {s: 0}, {s: 1}, [s]
    preds = {v: [] for v in N}
    for v in order:
        for w in sorted(ADJ[v]):
            if w not in dist:
                dist[w] = dist[v] + 1
                sigma[w] = 0
                order.append(w)
            if dist[w] == dist[v] + 1:
                sigma[w] += sigma[v]
                preds[w].append(v)
    return dist, sigma, order, preds

def betweenness():
    bc = {v: Fraction(0) for v in N}
    for s in N:
        dist, sigma, order, preds = bfs(s)
        delta = {v: Fraction(0) for v in N}
        for w in reversed(order):
            for v in preds[w]:
                delta[v] += Fraction(sigma[v], sigma[w]) * (1 + delta[w])
            if w != s:
                bc[w] += delta[w]
    return {v: x / 2 for v, x in bc.items()}

def automorphisms():
    found = []
    def extend(m):
        if len(m) == 10:
            found.append(dict(m))
            return
        v = len(m) + 1
        for img in N:
            if img in m.values() or len(ADJ[img]) != len(ADJ[v]):
                continue
            if all((u in ADJ[v]) == (m[u] in ADJ[img]) for u in m):
                m[v] = img
                extend(m)
                del m[v]
    extend({})
    return found

if __name__ == "__main__":
    bc = betweenness()
    pairs = 36                          # pairs of the other nine nodes
    print("   node  betweenness  share of 36 pairs  closeness")
    for v in N:
        d = bfs(v)[0]
        print("   {:4d}  {:11.4f}  {:17.4f}  {:9.4f}".format(
            v, float(bc[v]), float(bc[v]) / pairs, 9 / sum(d.values())))
    tot = sum(bc.values())
    print("   Tiphereth holds {:.4f} of all betweenness".format(
        float(bc[6] / tot)))
    auts = automorphisms()
    print("   automorphisms: {}".format(len(auts)))
    for m in auts:
        moved = {k: v for k, v in m.items() if k != v}
        print("     " + (str(moved) if moved else "identity"))
    pill = {"Mercy": (2, 4, 7), "Severity": (3, 5, 8),
            "Middle": (1, 6, 9, 10)}
    for name, vs in pill.items():
        inside = sum(1 for a, b in PATHS if a in vs and b in vs)
        print("   pillar {:8s} nodes {}  degree sum {:2d}  edges inside {}"
              .format(name, len(vs), sum(len(ADJ[v]) for v in vs), inside))
#    node  betweenness  share of 36 pairs  closeness
#       1       0.0000             0.0000     0.5625
#       2       0.8333             0.0231     0.6000
#       3       0.8333             0.0231     0.6000
#       4       1.4167             0.0394     0.6429
#       5       1.4167             0.0394     0.6429
#       6      13.8333             0.3843     0.9000
#       7       3.2500             0.0903     0.6923
#       8       3.2500             0.0903     0.6923
#       9       1.1667             0.0324     0.6429
#      10       0.0000             0.0000     0.5000
#    Tiphereth holds 0.5321 of all betweenness
#    automorphisms: 2
#      identity
#      {2: 3, 3: 2, 4: 5, 5: 4, 7: 8, 8: 7}
#    pillar Mercy    nodes 3  degree sum 13  edges inside 2
#    pillar Severity nodes 3  degree sum 13  edges inside 2
#    pillar Middle   nodes 4  degree sum 18  edges inside 3

Betweenness centrality counts the share of shortest paths between other pairs of nodes on which a node lies; the program uses Brandes’ algorithm (Brandes 2001). Tiphereth’s betweenness is 13.8333, 0.3843 of the 36 pairs among the other nine nodes and 0.5321 of the total betweenness of the graph; Kether and Malkuth have none. Closeness centrality (the reciprocal of the mean distance to the other nodes) is also highest for Tiphereth, at 0.9000.

The Tree of Life: node area proportional to betweenness centrality; Tiphereth (6) holds more than half of all betweenness (p09).

The automorphism group of the graph has just two elements: the identity and the reflection that swaps the two side pillars (2 with 3, 4 with 5, 7 with 8). The pillar of Mercy (2, 4, 7) and the pillar of Severity (3, 5, 8) are therefore structurally identical, each with degree sum 13 and 2 edges inside; the Middle pillar (1, 6, 9, 10) has degree sum 18 and 3 edges inside. In graph terms, the “balance of the three pillars” means precisely this one symmetry of order two.

Evidence

Tiphereth’s monopoly of centrality is a property of the graph. It is joined to every node except Malkuth, has degree 8, and is the only node lying between both the two side pillars and the upper and lower halves, so it ranks first in all four centralities: degree, eigenvector, betweenness and closeness. The conclusion comes only from the arrangement of the 22 edges, not from any symbolism.

From Malkuth to Kether

Calculation

# Chapter 4. p10: Every way up the Tree - simple paths and random walks.
# (1) All simple paths from Malkuth (10) to Kether (1), by depth-first
#     search, grouped by number of steps and by whether they use 6.
# (2) A walker at a node picks one of its paths uniformly. Expected
#     first-passage times h(v) to Kether solve h(1) = 0,
#     h(v) = 1 + mean of h over the neighbours of v (exact fractions).
# (3) Commute time 10 <-> 1 = 2m * R_eff, R_eff the effective resistance
#     with every path a unit resistor (m = 22 edges).
from fractions import Fraction

PATHS = [(1, 2), (1, 3), (1, 6), (2, 3), (2, 6), (2, 4), (3, 6), (3, 5),
         (4, 5), (4, 6), (4, 7), (5, 6), (5, 8), (6, 7), (6, 9), (6, 8),
         (7, 8), (7, 9), (7, 10), (8, 9), (8, 10), (9, 10)]
ADJ = {v: set() for v in range(1, 11)}
for a, b in PATHS:
    ADJ[a].add(b)
    ADJ[b].add(a)

def simple_paths(s, t):
    out = []
    def go(v, seen):
        if v == t:
            out.append(list(seen))
            return
        for w in sorted(ADJ[v]):
            if w not in seen:
                seen.append(w)
                go(w, seen)
                seen.pop()
    go(s, [s])
    return out

def solve(M, b):
    m = len(b)
    M = [row[:] + [b[i]] for i, row in enumerate(M)]
    for i in range(m):
        piv = next(r for r in range(i, m) if M[r][i] != 0)
        M[i], M[piv] = M[piv], M[i]
        for r in range(m):
            if r != i and M[r][i] != 0:
                f = M[r][i] / M[i][i]
                M[r] = [x - f * y for x, y in zip(M[r], M[i])]
    return [M[i][m] / M[i][i] for i in range(m)]

def hitting(target):
    vs = [v for v in range(1, 11) if v != target]
    idx = {v: i for i, v in enumerate(vs)}
    M = [[Fraction(0)] * len(vs) for _ in vs]
    b = [Fraction(1)] * len(vs)
    for v in vs:
        d = len(ADJ[v])
        M[idx[v]][idx[v]] = Fraction(1)
        for w in ADJ[v]:
            if w != target:
                M[idx[v]][idx[w]] -= Fraction(1, d)
    h = dict(zip(vs, solve(M, b)))
    h[target] = Fraction(0)
    return h

if __name__ == "__main__":
    ps = simple_paths(10, 1)
    by_len, via6 = {}, 0
    for p in ps:
        by_len[len(p) - 1] = by_len.get(len(p) - 1, 0) + 1
        via6 += 6 in p
    print("   simple paths Malkuth -> Kether: {}".format(len(ps)))
    print("   by number of steps: {}".format(dict(sorted(by_len.items()))))
    print("   through Tiphereth: {} ({:.4f})".format(via6, via6 / len(ps)))
    short = [p for p in ps if len(p) - 1 == min(by_len)]
    print("   shortest: {}".format(short))
    up, down = hitting(1), hitting(10)
    print("   expected steps to reach Kether from Malkuth: {} = {:.4f}"
          .format(up[10], float(up[10])))
    print("   expected steps to reach Malkuth from Kether: {} = {:.4f}"
          .format(down[1], float(down[1])))
    comm = up[10] + down[1]
    print("   commute time {:.4f}; effective resistance {:.4f}".format(
        float(comm), float(comm / 44)))
    print("   expected steps to Kether, by starting node:")
    print("     " + "  ".join("{}:{:.2f}".format(v, float(up[v]))
                             for v in range(2, 7)))
    print("     " + "  ".join("{}:{:.2f}".format(v, float(up[v]))
                             for v in range(7, 11)))
#    simple paths Malkuth -> Kether: 573
#    by number of steps: {3: 3, 4: 16, 5: 50, 6: 104, 7: 160, 8: 156, 9: 84}
#    through Tiphereth: 533 (0.9302)
#    shortest: [[10, 7, 6, 1], [10, 8, 6, 1], [10, 9, 6, 1]]
#    expected steps to reach Kether from Malkuth: 8225/391 = 21.0358
#    expected steps to reach Malkuth from Kether: 8451/391 = 21.6138
#    commute time 42.6496; effective resistance 0.9693
#    expected steps to Kether, by starting node:
#      2:12.50  3:12.50  4:17.48  5:17.48  6:16.01
#      7:19.94  8:19.94  9:20.23  10:21.04

There are 573 simple paths (no node visited twice) from Malkuth to Kether, from 3 to 9 steps long; the most common length is 7 steps (160 paths). The three shortest have 3 steps and all pass through Tiphereth; 533 of all simple paths (0.9302) pass through it.

A random walker chooses uniformly among the paths at each node. The expected number of steps from Malkuth to first reach Kether is 8225/391, about 21.0358; in the other direction it is 21.6138. Their sum is the commute time 42.6496, equal to twice the number of edges times the effective resistance between the two nodes, 0.9693, when every edge is a unit resistor (Chandra et al. 1996; Lovász 1993). Of the expected times to Kether from each node, Chokmah and Binah are nearest (12.50), and Tiphereth’s 16.01 is lower than that of any other node on its level or below.

Hypothesis · not established

The author’s reading (not yet tested): the traditional description of Tiphereth as the “seat of balance” can be read as an intuitive grasp of the betweenness structure of this graph. What would show the reading wrong: a tree older than Kircher’s with a different edge set, whose centre is not node 6, yet in which the same tradition still calls node 6 the centre; the description would then not come from the structure of the graph.

Summary

The Tree of Life is a graph of 10 vertices and 22 edges with a single left-right symmetry. Tiphereth leads in all four centralities, holds 0.5321 of the betweenness, and lies on 0.9302 of the simple paths from Malkuth to Kether. Commute times and effective resistance quantify the asymmetry of “ascent” and “descent” as 21.0358 and 21.6138 steps.

References

Brandes, Ulrik. 2001. “A Faster Algorithm for Betweenness Centrality.” Journal of Mathematical Sociology 25 (2): 163–77.
Chandra, Ashok K., Prabhakar Raghavan, Walter L. Ruzzo, Roman Smolensky, and Prasoon Tiwari. 1996. “The Electrical Resistance of a Graph Captures Its Commute and Cover Times.” Computational Complexity 6 (4): 312–40.
Decker, Ronald, Thierry Depaulis, and Michael Dummett. 1996. A Wicked Pack of Cards: The Origins of the Occult Tarot. Duckworth.
Kircher, Athanasius. 1652. Oedipus Aegyptiacus. Vitale Mascardi.
Lovász, László. 1993. “Random Walks on Graphs: A Survey.” In Combinatorics, Paul Erdős Is Eighty, vol. 2. János Bolyai Mathematical Society.

Fan, Y. (2026). Tarot Hypergeometric Sampling, Lenormand Grid Topology and Kabbalistic Tree Graphs: Reversal Binomial Mixtures, Grand-Tableau Manhattan Distances and Twenty-Two-Edge Spectral Centrality [塔罗超几何抽样、雷诺曼网格拓扑与卡巴拉生命树图论] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090191 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).