[英]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个相似的图形:
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.