[英]what options of data structure could be used in finding connected components in large datasets?
let's say we have a HashMap with for a graph with node and adjacency list 假设我们有一个HashMap用于带有节点和邻接列表的图
HashMap[node:Long,compId:Long, neighbours:Set[Long])]
what is the best way to update all the nodes with the minimum compId(connected component id) and what is the best data structure that can be used when the size of the data is large? 用最小的compId(连接的组件ID)更新所有节点的最佳方法是什么?当数据大时可以使用的最佳数据结构是什么?
仅使用不相交的集合数据结构,通常情况下,摊销的复杂度将为O(1),非常快!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.