algorithm - 如何动态查找连通分量

标签 algorithm boost graph-theory

利用disjoint-set数据结构可以轻松得到Graph的连通分量。而且,它只支持 Incremental Connected Components .

但是,在我的例子中,删除边非常常见,因此我正在寻找一种算法或新结构可以完全动态地(包括添加和删除边)维护连接组件

谢谢

最佳答案

Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity (Holm, de Lichtenberg and Thorup 2001)给出了一种算法,允许任意顺序的边插入、删除和连接查询,更新(插入和删除)需要 O(log(n)^2) 摊销时间,查询需要 O(log(n)/log(log (n))) 时间,其中 n 是图中的顶点数。这些时间范围假设图形开始时没有边。

我只浏览了它 38 页中的前 2 页,但不要(太)害怕——这篇论文描述了一堆关于动态图的新算法(也就是说,可以随着时间的推移进行有效修改)其中连接性最简单。

关于algorithm - 如何动态查找连通分量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7241151/

相关文章:

c++ - 编写通用包装器 : Conditionally Map different Types from Template Arguments onto a Single Class-Internal Type

用于传递大量参数的 C++ 设计模式

algorithm - 比较两个英文字符串的相似性

java - 效率问题

C++ boost ublas + units 维数约束

c++ - 错误 : `boost' has not been declared

algorithm - 为有向图中的每个顶点查找可达顶点

graph-theory - 出队时将节点标记为在 BFS 上访问过

algorithm - 图遍历算法的名称

python - 在 3 个相等和的列表中查找列表分割的 2 个索引的可能性