Reputation: 41
In the model I am currently developing is a graph/network based model and the diameter is required. Is it possible for the diameter to be calculated? The diameter will be found using links. For example a line graph of 5 nodes would have a diameter of 4, this becomes more complex with random graph's. This is a qoute of the diamter:
The shortest distance between the two most distant nodes in the network. In other words, once the shortest path length from every node to all other nodes is calculated, the diameter is the longest of all the calculated path lengths.
I have tried to design this but unable to implement this. Any advice or examples would be appreciated.
Upvotes: 2
Views: 408
Reputation: 17678
Have a look at the networks extension for NetLogo (see http://ccl.northwestern.edu/netlogo/docs/nw.html). Unfortunately, it doesn't have the diameter as one of the built-in functions, but you can calculate the distances between each pair of nodes and take the maximum.
Upvotes: 2