关于「耦合拓扑与探索:NK 景观上的隔离、环形、小世界与全连通」,《并发拓扑耦合与黑板复用》给出的定量结论是什么?

结论:第五章在 NK 景观上比较四种拓扑:全连通起步最快,到第 80 轮环形以 0.9280 超过全连通的 0.9150;半隔离子群在适度跨组连线时最高,为 0.9259。

数据口径:书中参数为示意,数据为合成,全部计算由书中程序生成;本书是非个人化经营建议,不提供任何加速比承诺。 第一章说明峰值从何而来,示意参数下峰值在 6.78 个窗口附近。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.9150, 0.9259, 0.9280, 80

A. mean agent score / global best, 60 landscapes
roundisolatedringsmallfull
20.70650.77870.78640.8435
50.76050.85880.87070.9003
100.80600.91310.92030.9132
200.84880.92770.92590.9150
400.87510.92800.92590.9150
800.88560.92800.92590.9150
查看完整验算程序
# Chapter 5. p51: search on NK landscapes over four network topologies.
# NK model (Kauffman and Levin 1987): N = 12 bits, each bit's payoff
# depends on itself and K = 5 other bits, payoffs uniform on [0, 1];
# score = mean payoff / best possible score (all 4096 states scored).
# 16 agents start at random states. Each round, in step: if a
# neighbour scores higher, copy the best neighbour; else flip one
# random bit and keep it if better (the Lazer-Friedman rule).
# Topologies: isolated, ring, small world (ring + 3 random chords),
# full. 60 landscapes; mean agent score at several rounds.
import math
import random

NB, KK, AGENTS, LANDS = 12, 5, 16, 60
CHECK = (2, 5, 10, 20, 40, 80)


def landscape(rng):
    deps = []
    for i in range(NB):
        others = [j for j in range(NB) if j != i]
        rng.shuffle(others)
        deps.append([i] + sorted(others[:KK]))
    tables = [[rng.random() for _ in range(2 ** (KK + 1))]
              for _ in range(NB)]
    score = []
    for s in range(2 ** NB):
        parts = []
        for i in range(NB):
            idx = 0
            for j in deps[i]:
                idx = idx * 2 + ((s >> j) & 1)
            parts.append(tables[i][idx])
        score.append(math.fsum(parts) / NB)
    top = max(score)
    return [v / top for v in score]


def graph(kind, rng):
    nb = {i: set() for i in range(AGENTS)}
    if kind in ("ring", "small"):
        for i in range(AGENTS):
            nb[i].add((i + 1) % AGENTS)
            nb[(i + 1) % AGENTS].add(i)
    if kind == "small":
        added = 0
        while added < 3:
            a, b = rng.randrange(AGENTS), rng.randrange(AGENTS)
            if a != b and b not in nb[a]:
                nb[a].add(b)
                nb[b].add(a)
                added += 1
    if kind == "full":
        for i in range(AGENTS):
            nb[i] = set(range(AGENTS)) - {i}
    return {i: sorted(nb[i]) for i in nb}


def run(score, nb, rng):
    pos = [rng.randrange(2 ** NB) for _ in range(AGENTS)]
    out = {}
    for t in range(1, CHECK[-1] + 1):
        new = []
        for i in range(AGENTS):
            best = max(nb[i], key=lambda j: score[pos[j]], default=None)
            if best is not None and score[pos[best]] > score[pos[i]]:
                new.append(pos[best])
            else:
                trial = pos[i] ^ (1 << rng.randrange(NB))
                new.append(trial if score[trial] > score[pos[i]]
                           else pos[i])
        pos = new
        if t in CHECK:
            out[t] = math.fsum(score[p] for p in pos) / AGENTS
    return out


if __name__ == "__main__":
    rng = random.Random(41151)
    kinds = ("isolated", "ring", "small", "full")
    acc = {k: {t: [] for t in CHECK} for k in kinds}
    for _ in range(LANDS):
        score = landscape(rng)
        for k in kinds:
            res = run(score, graph(k, rng), rng)
            for t in CHECK:
                acc[k][t].append(res[t])
    print("A. mean agent score / global best, {} landscapes".format(
        LANDS))
    print("   round " + "".join("{:>9}".format(k) for k in kinds))
    for t in CHECK:
        print("   {:>5} ".format(t) + "".join(
            "{:>9.4f}".format(math.fsum(acc[k][t]) / LANDS)
            for k in kinds))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《多核并发操作拓扑耦合、共享黑板无锁通信与跨节点涌现增益母典》第 5 章「耦合拓扑与探索:NK 景观上的隔离、环形、小世界与全连通」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-411 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026411,
  author    = {Fan, Yafu},
  title     = {Topological Coupling of Concurrent Multi-Core Operations: Lock-Free Blackboard Signalling and Cross-Node Emergent Gains},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论