如何计算循环图的密度?

时间:2022-04-04 23:17:25

I'm looking to find the density of a directed cyclic graph.

我正在寻找有向循环图的密度。

According to Wikipedia,

根据*,

For undirected simple graphs, the graph density is defined as:

对于无向简单图,图密度定义为:

2 * |E| / (|V| * (|V| − 1))

2 * | E | /(| V | *(| V | - 1))

For directed simple graphs, the graph density is defined as:

对于有向简单图,图密度定义为:

|E| / (|V| * (|V| − 1))

| E | /(| V | *(| V | - 1))

But I then go on to read the definition of simple graphs:

但我继续阅读简单图的定义:

"A simple graph, as opposed to a multigraph, is an undirected graph in which both multiple edges and loops are disallowed."

“一个简单的图形,与多图形相对,是一个无向图形,其中不允许多个边缘和循环。”

I'm confused because the other article mentioned "directed" and "undirected" simple graphs. Now simple graphs can only be undirected? It also states that simple graphs cannot have loops, so I wasn't sure if I would be able to use either of these formulas on my cyclic graph.

我很困惑,因为另一篇文章提到了“定向”和“无向”的简单图形。现在简单的图表只能是无向的?它还说明简单的图形不能有循环,所以我不确定我是否能够在循环图上使用这些公式中的任何一个。

I go on to read about multigraphs, but there is no mention of calculating their density.
Is density not something one would be concerned about for graphs with cycles?

我继续阅读多图,但没有提到计算它们的密度。对于具有周期的图形,密度不是人们会关心的吗?

On the first article it states:

在第一篇文章中,它指出:

"the maximal density is 1 (for complete graphs)"

“最大密度为1(完整图表)”

And it looks like complete graphs are a specialized version of multigraphs, so I assume calculating density should make sense.

看起来完整的图形是多图的专用版本,所以我认为计算密度应该是有意义的。

What formula do I use?

我用什么配方?

1 个解决方案

#1


1  

I understand your confusion, but it's really not complicated. Yuo just picked inconsistent definitions from different sources.

我理解你的困惑,但这并不复杂。 Yuo刚从不同来源选择了不一致的定义。

The notion of simple graphs to me has nothing (or few) to do with directed or undirected graphs (and I did my PhD in the field).

简单图形的概念对我来说没有(或很少)与定向或无向图形有关(我在该领域做了博士学位)。

Undirected means that an edge has no start or end point. It is a 2-set (or multiset) of vertices {a,b} (undistinguishable from an edge {b,a}, possibly containing the same vertex twice {a,a}, which is called a loop.

未定向意味着边缘没有起点或终点。它是一组2(或多个)顶点{a,b}(与边{b,a}无法区分,可能包含两次{a,a}的相同顶点,称为循环。

Directed means that an edge (also sometimes called arc in this case) has a source vertex and a target vertex. That means that it is a 2-tuple (a,b), and there's a difference between (a,b) and (b,a). Again, (a,a) would be a loop.

定向意味着边(在这种情况下有时也称为弧)具有源顶点和目标顶点。这意味着它是一个2元组(a,b),并且(a,b)和(b,a)之间存在差异。同样,(a,a)将是一个循环。

Simple means that 1. there are no loops (even that's sometimes defined differently) 2. no edge occurs twice or more often (this would be a multigraph)

简单意味着1.没有循环(即使有时定义不同)2。没有边缘出现两次或更多次(这将是一个多图)

Let's forget for the moment the claim that simple graphs should be undirected.

让我们暂时忘记简单图表应该是无向的。

Note that 2. means that if there is an edge {a,b} in an undirected graph, it may not contain an edge {b,a}, because that's the same edge. In a directed simple graph, it is still possible to have (a,b) and (b,a).

请注意,2表示如果在无向图中存在边{a,b},则它可能不包含边{b,a},因为它是相同的边。在有向简单图中,仍然可以有(a,b)和(b,a)。

Now, the density is the number of edges divided by the maximum number of edges. In a multigraph, there is no maximum number of edges, and hence, the definition you found, only works for simple graphs.

现在,密度是边数除以最大边数。在多图中,没有最大边数,因此,您找到的定义仅适用于简单图。

Simple undirected graphs have at most |V|(|V|-1)/2 edges, simple directed graphs have at most |V|(|V|-1) edges.

简单无向图最多具有| V |(| V | -1)/ 2边,简单有向图最多具有| V |(| V | -1)边。

What's confusing is the definition of a simple graph to be undirected. Forget that. In graph theory, there are still inconsistent notions across different sources. I'd prefer not to include undirectedness to simplicity, because it mixes concepts and leaves you with no clear wording for an directed simple graph.

令人困惑的是一个简单的图的定义是无向的。算了。在图论中,不同来源之间仍然存在不一致的概念。我不希望将无向性包含在简单性中,因为它混合了概念,并且对于有向的简单图形没有明确的措辞。

#1


1  

I understand your confusion, but it's really not complicated. Yuo just picked inconsistent definitions from different sources.

我理解你的困惑,但这并不复杂。 Yuo刚从不同来源选择了不一致的定义。

The notion of simple graphs to me has nothing (or few) to do with directed or undirected graphs (and I did my PhD in the field).

简单图形的概念对我来说没有(或很少)与定向或无向图形有关(我在该领域做了博士学位)。

Undirected means that an edge has no start or end point. It is a 2-set (or multiset) of vertices {a,b} (undistinguishable from an edge {b,a}, possibly containing the same vertex twice {a,a}, which is called a loop.

未定向意味着边缘没有起点或终点。它是一组2(或多个)顶点{a,b}(与边{b,a}无法区分,可能包含两次{a,a}的相同顶点,称为循环。

Directed means that an edge (also sometimes called arc in this case) has a source vertex and a target vertex. That means that it is a 2-tuple (a,b), and there's a difference between (a,b) and (b,a). Again, (a,a) would be a loop.

定向意味着边(在这种情况下有时也称为弧)具有源顶点和目标顶点。这意味着它是一个2元组(a,b),并且(a,b)和(b,a)之间存在差异。同样,(a,a)将是一个循环。

Simple means that 1. there are no loops (even that's sometimes defined differently) 2. no edge occurs twice or more often (this would be a multigraph)

简单意味着1.没有循环(即使有时定义不同)2。没有边缘出现两次或更多次(这将是一个多图)

Let's forget for the moment the claim that simple graphs should be undirected.

让我们暂时忘记简单图表应该是无向的。

Note that 2. means that if there is an edge {a,b} in an undirected graph, it may not contain an edge {b,a}, because that's the same edge. In a directed simple graph, it is still possible to have (a,b) and (b,a).

请注意,2表示如果在无向图中存在边{a,b},则它可能不包含边{b,a},因为它是相同的边。在有向简单图中,仍然可以有(a,b)和(b,a)。

Now, the density is the number of edges divided by the maximum number of edges. In a multigraph, there is no maximum number of edges, and hence, the definition you found, only works for simple graphs.

现在,密度是边数除以最大边数。在多图中,没有最大边数,因此,您找到的定义仅适用于简单图。

Simple undirected graphs have at most |V|(|V|-1)/2 edges, simple directed graphs have at most |V|(|V|-1) edges.

简单无向图最多具有| V |(| V | -1)/ 2边,简单有向图最多具有| V |(| V | -1)边。

What's confusing is the definition of a simple graph to be undirected. Forget that. In graph theory, there are still inconsistent notions across different sources. I'd prefer not to include undirectedness to simplicity, because it mixes concepts and leaves you with no clear wording for an directed simple graph.

令人困惑的是一个简单的图的定义是无向的。算了。在图论中,不同来源之间仍然存在不一致的概念。我不希望将无向性包含在简单性中,因为它混合了概念,并且对于有向的简单图形没有明确的措辞。