知识卡片

普通读书笔记卡 · 3648.a.2

稀疏图优先考虑邻接表

理解等级:高级
  • 当 E 远小于 V²,邻接表通常更紧凑;
  • 边接近 V² 或需要频繁判断某两点是否相连时,邻接矩阵可能更合适。

选择表示要结合图密度与主要查询,不能只看一种操作。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 第20章 基本图算法 · 查看原书依据

      You might prefer an adjacency-matrix representation, however, when the graph is dense—|E| is close to |V|2—or when you need to be able to tell quickly whether there is an edge connecting two given vertices.

    参考来源

    - 位置:《算法导论(第4版)》第20章《基本图算法》(OEBPS/chapter020.xhtml,文本字符[0,5000))。 - 结论依据:原文将图密度和边存在性查询作为表示选择条件。 - 原始内容:You might prefer an adjacency-matrix representation, however, when the graph is dense —| E | is close to | V | 2 —or when you need to be able to tell quickly whether there is an edge connecting two given vertices.