关于「因果有向图:卡恩拓扑排序与设定版本冲突」,《长篇叙事的因果图、悬念熵与伏笔回收》给出的定量结论是什么?
结论:第一、二章用卡恩拓扑排序与按键分组的版本检查找出时间悖论与同一属性的两个值,并说明跨卷吃书藏在推得出的先后里:示意连载第六卷的一条边与写在第 2 卷到第 6 卷之间的 10 条边相冲突。
数据口径:书中的连载、读者与参数均为示意模型;全部计算由书中程序生成;本书不是法律、财务或投资建议,并坚持一条红线:不得以虚假悬念骗取点击。 第一、二章用卡恩拓扑排序与按键分组的版本检查找出时间悖论与同一属性的两个值,并说明跨卷吃书藏在推得出的先后里:示意连载第六卷的一条边与写在第 2 卷到第 6 卷之间的 10 条边相冲突。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 10
| graph A plan | 12 nodes, 15 edges |
| removed in Kahn order | 12 of 12 |
| order: F1 F2 E1 E2 F3 E3 E4 E5 E6 E7 E8 E9 | |
| verdict: acyclic, a consistent timeline exists | |
| graph B plan+retcon | 12 nodes, 16 edges |
| removed in Kahn order | 2 of 12 |
| order: F2 F3 | |
| stuck (on or behind a cycle) | 10 |
| one cycle: E1 -> E2 -> E4 -> E5 -> E7 -> E8 -> E9 -> F1 -> E1 | |
| on that cycle | 8, stuck but off it: 2 |
| verdict: time paradox, no reading order satisfies all edges |
查看完整验算程序
# Chapter 1. p11: Kahn's topological sort finds a time paradox in a serial.
# Nodes are setting facts (F) and plot events (E) of a toy serial; an edge
# u -> v reads "u must hold or happen before v" (causal or temporal).
# Kahn (1962) repeatedly removes a node of in-degree zero; any node that
# can never be removed lies on a cycle or downstream of one. Graph A is
# the plan; graph B adds one retcon edge written in volume 3. The graph is
# illustrative and is not taken from any published novel.
import heapq
from collections import defaultdict
PLAN = [
("F1", "E1"), ("F2", "E1"), ("E1", "E2"), ("E1", "E3"),
("F3", "E3"), ("E2", "E4"), ("E3", "E4"), ("E4", "E5"),
("E4", "E6"), ("E5", "E7"), ("E6", "E7"), ("E7", "E8"),
("E7", "E9"), ("F3", "E9"), ("E8", "E9"),
]
RETCON = ("E9", "F1") # volume 3: the hero's son, born at E9, forged F1
def kahn(edges):
nodes = sorted({u for u, _ in edges} | {v for _, v in edges})
succ, indeg = defaultdict(list), {n: 0 for n in nodes}
for u, v in edges:
succ[u].append(v)
indeg[v] += 1
heap = [n for n in nodes if indeg[n] == 0]
heapq.heapify(heap)
order = []
while heap:
n = heapq.heappop(heap)
order.append(n)
for v in sorted(succ[n]):
indeg[v] -= 1
if indeg[v] == 0:
heapq.heappush(heap, v)
left = [n for n in nodes if n not in order]
return nodes, order, left, succ
def one_cycle(left, succ):
rest = set(left)
start = sorted(left)[0]
path, seen = [start], {start: 0}
while True:
nxt = sorted(v for v in succ[path[-1]] if v in rest)
# follow a successor that can still reach the start, else any
step = None
for v in nxt:
if reaches(v, start, succ, rest):
step = v
break
if step is None:
return None
if step in seen:
return path[seen[step]:] + [step]
seen[step] = len(path)
path.append(step)
def reaches(a, b, succ, rest):
stack, seen = [a], {a}
while stack:
n = stack.pop()
if n == b:
return True
for v in succ[n]:
if v in rest and v not in seen:
seen.add(v)
stack.append(v)
return False
for name, edges in (("A plan", PLAN), ("B plan+retcon", PLAN + [RETCON])):
nodes, order, left, succ = kahn(edges)
print("graph {}: {} nodes, {} edges".format(name, len(nodes),
len(edges)))
print(" removed in Kahn order: {} of {}".format(len(order),
len(nodes)))
print(" order: " + " ".join(order))
if not left:
print(" verdict: acyclic, a consistent timeline exists")
continue
cyc = one_cycle(left, succ)
on = set(cyc)
print(" stuck (on or behind a cycle): {}".format(len(left)))
print(" one cycle: " + " -> ".join(cyc))
print(" on that cycle: {}, stuck but off it: {}".format(
len(on), len([n for n in left if n not in on])))
print(" verdict: time paradox, no reading order satisfies all edges")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《长篇叙事因果有向无环图校验、章节悬念信息熵锯齿调度与伏笔遗忘衰减回收》第 1 章「因果有向图:卡恩拓扑排序与设定版本冲突」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-178 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026178,
author = {Fan, Yafu},
title = {Causal-DAG Validation of Long-Form Narrative, Sawtooth Scheduling of Chapter Suspense Entropy and Forgetting-Aware Foreshadowing Recovery},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}