# Diameter of a ring network

**URL:** <https://boards.straightdope.com/t/diameter-of-a-ring-network/847536>\
**Category:** Factual Questions\
**Created:** [February 6, 2020, 11:43am UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536 "2020-02-06T11:43:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaverocK](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@MaverocK](https://boards.straightdope.com/u/MaverocK)\
**Post date:** [February 6, 2020, 11:43am UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/1 "2020-02-06T11:43:07Z")

</div>

The diameter of a ring network is calculated by n/2:

> [@](#):
>
> When a node is not connected to every other node, messages may have to go through intervening nodes to reach their final destination. The diameter of a network is the longest path between any two nodes. Again the ring and fully connected network show two extremes. A ring of n nodes has diameter n/2, but a fully connected network has a fixed diameter (1) no matter how many nodes there are.

[https://www.phy.ornl.gov/csep/ca/node22.html](https://www.phy.ornl.gov/csep/ca/node22.html)

The diameter is defined as:  
“the longest of all the calculated shortest paths in a network” (source: [https://www.phy.ornl.gov/csep/ca/node22.html](https://www.phy.ornl.gov/csep/ca/node22.html))  
or  
“the maximum distance between any pair of nodes” (source: a professor’s slides; I cannot give a link, I cannot give you the professor’s name due to privacy reasons; but I can show you a screenshot)

In the picture below, there is a ring network and there are 6 nodes:  
[![](https://i.imgur.com/OW3fmTN.png) ](https://i.imgur.com/OW3fmTN.png)  
(alternative mirror: [https://i.ibb.co/Dkv4Tmm/330px-Network-Topology-Ring.png](https://i.ibb.co/Dkv4Tmm/330px-Network-Topology-Ring.png))

I tried to demonstrate the longest link between the top left and top right node. According to the description(s) of the diameter, the diameter of this ring network should be 6/2 = 3. But I cannot understand why it is (node number)/2 (i.e. 6/2=3). I tried to describe the longest link the picture (the way that I understand the longest link). What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 6, 2020, 12:16pm UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/2 "2020-02-06T12:16:09Z")

</div>

I think you depict a _digraph_, in which a node A links to node B, but not necessarily vice versa. The others are assuming that links are mutual, i.e. that the network is a _graph_, not just a _digraph_.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [February 6, 2020, 12:18pm UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/3 "2020-02-06T12:18:39Z")

</div>

You pictured not even the longest path; the message could have gone around the ring several times and bounced back and forth! What you want is the maximum, over all pairs of vertices, of the shortest path between the two vertices. This should equal the diameter of the network considered as a graph.

---

<div class="post-metadata">

**Author:** ![MaverocK](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@MaverocK](https://boards.straightdope.com/u/MaverocK)\
**Post date:** [February 6, 2020, 2:05pm UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/4 "2020-02-06T14:05:46Z")

</div>

I think I’ve got the definition wrong.

Diameter is the longest among all the shortest paths between any 2 nodes.

Which means in this case with this ring:

1. the shortest distance between thee selected nodes will be 1.
2. however, between the opposite nodes, the shortest distance will be always 3.
3. it is the longest of all shortest paths in the graph.

In a more verbose way, say you calculate the shortest distances between all pair of nodes, if we enumerate them 1-6 then it would mean to calculate the shortest distances between (1, 2), (1,3), …, (1,6), (2,1), …, (5, 6). You will find out that the shortest distances are:

shortest(1,2) = 1  
shortest(1,3) = 2  
shortest(1,4) = 3  
shortest(1,5) = 2  
shortest(1,6) = 1

similarly for all the pairs (it will be the same since the ring is symmetric), and all you need to do now is to find the longest of these paths, which is 3 in this case.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [February 6, 2020, 5:19pm UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/5 "2020-02-06T17:19:05Z")

</div>

Is this homework?

---

<div class="post-metadata">

**Author:** ![MaverocK](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@MaverocK](https://boards.straightdope.com/u/MaverocK)\
**Post date:** [February 7, 2020, 1:29am UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/6 "2020-02-07T01:29:23Z")

</div>

> [@gnoitall](#):
>
> Is this homework?

It isn’t. Exercise with a solution. But the solution only includes the result. No explanation. So, I was confused.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 7, 2020, 3:44am UTC](https://boards.straightdope.com/t/diameter-of-a-ring-network/847536/7 "2020-02-07T03:44:09Z")

</div>

For what it’s worth, this definition of “diameter” is also used for other geometric figures. For instance, the “diameter of a square” is the length of its diagonal, and the “diameter of a triangle” is its longest side.
