简体   繁体   English

SparseMultigraph有什么区别 <V, E> 和一个SparseGraph <V, E> ?

[英]What's the difference between a SparseMultigraph<V, E> and a SparseGraph<V, E>?

I'm using JUNG2 library and they have 2 similar Graphs which are: 我正在使用JUNG2库,它们具有2个相似的图形:

  • SparseMultigraph 稀疏多图
  • SparseGraph 稀疏图

Can someone tell me the differences between them? 有人可以告诉我他们之间的区别吗?

Thanks. 谢谢。

I think SparseGraph<V, E> does not support parallel edges. 我认为SparseGraph<V, E>不支持平行边。

while SparseMultigraph<V, E> allows parallel edges. SparseMultigraph<V, E>允许平行边。

Multigraph: https://en.wikipedia.org/wiki/Multigraph 多重图: https//en.wikipedia.org/wiki/Multigraph

The name of the class(es) almost tell it. 班级的名称几乎可以说明这一点。

  • SparseMultigraph is a multigraph, which means that there might be multiple (>= 1) or zero edges between two vertices. SparseMultigraph是一个多图,这意味着两个顶点之间可能有多个(> = 1)或零个边。 The SparseMultigraph class implements the Multigraph interface. SparseMultigraph类实现Multigraph接口。

  • SparseGraph is a graph, which means that there is exactly 0 or exactly 1 edge between any two vertices. SparseGraph是一个图形,这意味着在任意两个顶点之间存在正好为0或正好为1边。 The SparseGraph class doesn't not implement the Multigraph interface, but only the Graph interface. SparseGraph类不实现Multigraph接口,而仅实现Graph接口。

  • Both classes extend the AbstractGraph class. 这两个类都扩展了AbstractGraph类。

More info: 更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM