不允许随机访问邻接表中边向量的原因

Reason for not allowing random access to the vector of edges in adjacency lists

为什么 edge_iterator 不像 vertex_iterator 那样的 integer_iterator?我正在使用带向量的无向邻接表来存储顶点和边。

邻接列表存储邻接列表。

也就是说,每个顶点,它存储一个相邻顶点的列表。

这意味着顶点可以存储在单个容器中,但每个顶点都包含其自己的(单独的)邻接容器 ("other vertex references")。

这应该可以解释:没有 "the edge container" 这样的东西,因此无法通过索引或作为单个相邻容器直接寻址边缘。

请注意还有其他图形模型(例如 EdgeList concept, as modeled by edge_list