5D Library › Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation · 中文
Chapter 1. Dream Motifs as a Bipartite Graph, and Spreading Activation in REM Sleep
A dream dictionary is a bipartite graph
A dream dictionary pairs images with matters of life: water with money, a lost tooth with a relative, a wedding with love or with kin. Content analysis of dream reports does something similar from the other side: the Hall-Van de Castle system codes characters, settings, objects, interactions and emotions in each report, so that reports can be counted and compared (Hall and Van de Castle 1966; Domhoff 2003). Both can be written as one object: a weighted bipartite graph with motifs on one side, life domains on the other, and an edge wherever a reading links the two.
Below, 24 common motifs and 8 domains are linked in two ways. Strong links are the one or two readings a dictionary would print first. Weak links are the looser readings an interpreter can reach for (“water may also mean fear”). The motif graph joins two motifs that share a domain.
Two kinds of step must be kept apart. A bipartite step goes from a motif to a domain along one edge of the bipartite graph. A motif-graph step goes from one motif to another in the motif projection and therefore uses two bipartite edges: motif to a shared domain, then domain to the other motif. Distances between motifs (p01) and the hops and end distances of association chains (p02) are counted in motif-graph steps; the share of motif-domain pairs joined “in a single step” is counted in bipartite steps.
Calculation
# Chapter 1. p01: A weighted bipartite graph of dream motifs and life domains.
# 24 motifs drawn from dream dictionaries and Hall-Van de Castle style
# codes; 8 life domains. Each motif has one or two STRONG readings
# (weight 1.0, then 0.7) as a dictionary would list them; other pairs get
# a WEAK link (0.05 to 0.30) with probability 0.35 (seed 89), standing
# for the looser readings an interpreter can reach for. The motif graph
# links two motifs that share a domain; distances are counted in it.
import random
DOMAINS = ("wealth", "health", "kin", "love", "work", "travel",
"conflict", "fear")
STRONG = {
"water": "wealth fear", "fire": "wealth conflict",
"snake": "wealth love", "teeth": "kin health", "flying": "work",
"falling": "fear work", "chased": "fear conflict",
"death": "health kin", "wedding": "love kin", "money": "wealth",
"house": "kin", "road": "travel work", "exam": "work fear",
"child": "kin love", "fish": "wealth", "dog": "conflict kin",
"mountain": "work travel", "rain": "wealth health",
"blood": "health wealth", "boat": "travel", "teacher": "work",
"stranger": "love fear", "food": "health", "phone": "love travel",
}
MOTIFS = sorted(STRONG)
def build(seed=89, p_weak=0.35):
rng = random.Random(seed)
w = {}
for m in MOTIFS:
doms = STRONG[m].split()
for d in DOMAINS:
if d in doms:
w[m, d] = 1.0 if doms.index(d) == 0 else 0.7
elif rng.random() < p_weak:
w[m, d] = round(rng.uniform(0.05, 0.30), 3)
return w
def motif_distances(w, min_w):
nb = {m: set() for m in MOTIFS}
for (m, d), x in w.items():
if x < min_w:
continue
for (m2, d2), y in w.items():
if d2 == d and m2 != m and y >= min_w:
nb[m].add(m2)
dist = {}
for s in MOTIFS:
seen, front, k = {s: 0}, [s], 0
while front:
k += 1
nxt = []
for u in front:
for v in sorted(nb[u]):
if v not in seen:
seen[v] = k
nxt.append(v)
front = nxt
for t in MOTIFS:
if t > s:
dist[s, t] = seen.get(t, None)
return dist
if __name__ == "__main__":
w = build()
strong = sum(1 for x in w.values() if x >= 0.7)
weak = len(w) - strong
print(" motifs {}, domains {}, strong links {}, weak links {}".format(
len(MOTIFS), len(DOMAINS), strong, weak))
print(" density: strong {:.3f}, all {:.3f}".format(
strong / 192, len(w) / 192))
for label, mw in (("strong only", 0.7), ("all links", 0.0)):
dist = motif_distances(w, mw)
n = len(dist)
cnt = {}
for v in dist.values():
cnt[v] = cnt.get(v, 0) + 1
parts = ", ".join("d={} {:.3f}".format(k, cnt[k] / n)
for k in sorted(cnt, key=lambda x: (x is None, x)))
print(" {:11s} ({} pairs): {}".format(label, n, parts))
reach = sum(1 for m in MOTIFS for d in DOMAINS if (m, d) in w)
print(" motif-domain pairs reachable in one step: {} of 192 ({:.3f})"
.format(reach, reach / 192))
# motifs 24, domains 8, strong links 41, weak links 56
# density: strong 0.214, all 0.505
# strong only (276 pairs): d=1 0.308, d=2 0.431, d=3 0.221, d=4 0.040
# all links (276 pairs): d=1 0.942, d=2 0.058
# motif-domain pairs reachable in one step: 97 of 192 (0.505)There are 41 strong links and 56 weak ones. On strong links alone, only 0.308 of motif pairs are neighbours; 0.431 are two steps apart, 0.221 three, 0.040 four. Once the weak links are allowed, 0.942 of all pairs are direct neighbours and the rest are two steps apart, and 0.505 of all motif-domain pairs are joined in a single bipartite step. This is the first structural point of the book: a dictionary with enough loose readings lets almost any image reach almost any matter of life. The flexibility is a property of the graph, not of the dream.
Spreading activation and the REM brain
In memory research, recalling one idea is described as activation spreading along associative links, strongest along the strongest links (Collins and Loftus 1975). During rapid-eye-movement (REM) sleep, imaging studies found the dorsolateral prefrontal cortex relatively deactivated while limbic and visual association areas were active (Maquet et al. 1996; Braun et al. 1997); and subjects woken from REM sleep showed more priming from weak associates than from strong ones, the reverse of the waking pattern (Stickgold et al. 1999). A toy model of that difference: the chain of association goes on longer (probability of another hop), and the choice of the next link is flatter (edge weights raised to a smaller power ).
Calculation
# Chapter 1. p02: Spreading activation on the motif-domain graph of p01.
# A chain of association starts at a motif, steps to a domain and on to
# another motif, with edge choice proportional to weight**beta, and goes
# on for another hop with probability c. "Waking" uses c = 0.50 and a
# sharp beta = 4 (strong links dominate); "REM" uses c = 0.80 and a flat
# beta = 1, a toy stand-in for weakened prefrontal control. Distance is
# counted in the strong-link motif graph of p01. 20,000 chains each.
import random
DOMAINS = ("wealth", "health", "kin", "love", "work", "travel",
"conflict", "fear")
STRONG = {
"water": "wealth fear", "fire": "wealth conflict",
"snake": "wealth love", "teeth": "kin health", "flying": "work",
"falling": "fear work", "chased": "fear conflict",
"death": "health kin", "wedding": "love kin", "money": "wealth",
"house": "kin", "road": "travel work", "exam": "work fear",
"child": "kin love", "fish": "wealth", "dog": "conflict kin",
"mountain": "work travel", "rain": "wealth health",
"blood": "health wealth", "boat": "travel", "teacher": "work",
"stranger": "love fear", "food": "health", "phone": "love travel",
}
MOTIFS = sorted(STRONG)
def build(seed=89, p_weak=0.35):
rng = random.Random(seed)
w = {}
for m in MOTIFS:
doms = STRONG[m].split()
for d in DOMAINS:
if d in doms:
w[m, d] = 1.0 if doms.index(d) == 0 else 0.7
elif rng.random() < p_weak:
w[m, d] = round(rng.uniform(0.05, 0.30), 3)
return w
W = build()
def strong_dist():
nb = {m: {m2 for (m2, d2), y in W.items() if y >= 0.7 and m2 != m
and W.get((m, d2), 0) >= 0.7} for m in MOTIFS}
out = {}
for s in MOTIFS:
seen, front, k = {s: 0}, [s], 0
while front:
k += 1
front2 = []
for u in front:
for v in sorted(nb[u]):
if v not in seen:
seen[v] = k
front2.append(v)
front = front2
out[s] = seen
return out
DIST = strong_dist()
def pick(rng, items, beta):
tot = sum(x ** beta for _, x in items)
r, acc = rng.random() * tot, 0.0
for key, x in items:
acc += x ** beta
if r <= acc:
return key, x
return items[-1]
def chain(rng, c, beta):
start = MOTIFS[rng.randrange(len(MOTIFS))]
m, hops, weak = start, 0, False
while True:
d, x = pick(rng, [(d, W[m, d]) for d in DOMAINS if (m, d) in W],
beta)
m2, y = pick(rng, [(n, W[n, d]) for n in MOTIFS
if (n, d) in W and n != m], beta)
weak = weak or x < 0.7 or y < 0.7
m, hops = m2, hops + 1
if rng.random() > c:
return hops, DIST[start].get(m, 9), weak
def summary(c, beta, n=20000, seed=89):
rng = random.Random(seed)
rows = [chain(rng, c, beta) for _ in range(n)]
hops = sum(r[0] for r in rows) / n
far = sum(1 for r in rows if r[1] >= 2) / n
d3 = sum(1 for r in rows if r[1] >= 3) / n
weak = sum(1 for r in rows if r[2]) / n
return hops, far, d3, weak, rows
if __name__ == "__main__":
for name, c, beta in (("waking", 0.50, 4.0), ("REM", 0.80, 1.0)):
hops, far, d3, weak, _ = summary(c, beta)
print(" {:6s} c={:.2f} beta={:.0f}: hops {:.2f}, end at d>=2 "
"{:.3f}, d>=3 {:.3f}".format(name, c, beta, hops, far, d3))
print(" chains using a weak link: {:.3f}".format(weak))
# waking c=0.50 beta=4: hops 2.02, end at d>=2 0.148, d>=3 0.015
# chains using a weak link: 0.017
# REM c=0.80 beta=1: hops 5.01, end at d>=2 0.570, d>=3 0.195
# chains using a weak link: 0.775With waking settings (, ) a chain makes 2.02 hops on average (each hop is one motif-graph step, motif to domain to motif), ends two or more steps from its start in 0.148 of cases, and uses a weak link in only 0.017. With REM settings (, ) it makes 5.01 hops, ends two or more steps away in 0.570 of cases (three or more in 0.195), and 0.775 of chains pass through a weak link. The two parameters are illustrative, not measured; the point is qualitative. Remote combinations are what such a process produces, so a strange juxtaposition in a dream needs no hidden message to explain it.
Hypothesis · not established
The author’s interpretation (not yet tested): the felt “meaningfulness” of a dream rises with the number of weak links its chain of images crosses, because weak links are what an interpreter must explain. What would show it wrong: in coded dream reports, ratings of how meaningful a dream feels do not rise with the share of motif pairs that are only weakly linked in a standard dictionary graph.
Summary
A dream dictionary and a dream coding system are both bipartite graphs of motifs and domains. With strong readings only, motifs sit in separate clusters; with the loose readings allowed, 0.942 of motif pairs become neighbours. A spreading-activation toy with longer, flatter chains, in the spirit of the REM findings, ends far from its start in 0.570 of cases. Remote combinations are expected; they are not evidence of a message.
References
Fan, Y. (2026). Dream Motif Bipartite Graphs, Deterministic Oracle Decks and Subconscious Prior Activation: REM Semantic Spreading, SHA-256 Fisher-Yates Permutations and Retroactive Coincidence Rates [梦境意象二分图、确定性哈希牌卡与潜意识先验激活] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090233 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).