Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how

Legacy Documentation

Mathematica 8 (2010)

This is documentation for Mathematica 8, which was
based on an earlier version of Wolfram Language.
View current documentation (Version 14.3)

GraphDiameter

GraphDiameter [g]
gives the maximum eccentricity of the vertices in the graph g.
(1)
Give the graph diameter for a complete graph:
Give the graph diameter for a complete graph:
Out[1]=
Out[2]=
(4)
GraphDiameter works with undirected graphs:
Directed graphs:
Weighted graphs:
Large graphs:
(1)
People at a family gathering:
Use Subsets to create edges between all members of the family:
The resulting social graph:
Find the largest number of steps separating two people at the gathering:
(4)
For a connected graph, the diameter can be computed by VertexEccentricity :
If a simple graph has diameter greater than 3, then its complement has diameter less than 3:
The graph diameter is unchanged when reversing every edge:
The graph radius does change:
Illustrate the diameter in two Petersen graphs:
For a CompleteGraph , the diameter is 1:
For a PathGraph of size , the diameter is :
For a CycleGraph of size , the diameter is :
For a WheelGraph of size 5 or more, the diameter is 2:
A WheelGraph of size 4 is a complete graph, so the diameter is 1:
For a GridGraph of size , the diameter is :
For a CompleteKaryTree tree of depth , the diameter is :
New in 8


ja zh

AltStyle によって変換されたページ (->オリジナル) /