What is the distinction between sparse and dense graphs?

后端 未结 5 1631
独厮守ぢ
独厮守ぢ 2020-12-23 02:22

I read it is ideal to represent sparse graphs by adjacency lists and dense graphs by an adjacency matrix. But I would like to understand the main difference between sparse a

5条回答
  •  爱一瞬间的悲伤
    2020-12-23 02:35

    From Data Structures and Algorithms with Object-Oriented Design Patterns in C++ , p. 534, by Bruno P. Reiss:

    Informally, a graph with relatively few edges is sparse, and a graph with many edges is dense.

    Definition (Sparse Graph): A sparse graph is a graph G = (V, E) in which |E| = O(|V|).

    Definition (Dense Graph) A dense graph is a graph G = (V, E) in which |E| = Θ(|V|2).

提交回复
热议问题