获取图形中的信息
你可以使用 center、periphery 和 distance 函数找出图形信息.
g = [image];text[s_] := Style[s, 12, FontFamily -> "Verdana"]Row[{g, Grid[{{text["Vertex count: "], ToString[VertexCount[g]]}, {text["Edge count: "], ToString[EdgeCount[g]]}, {text["Weighted: "], ToString[WeightedGraphQ[g]]}, {text["Strongly connected: "], ToString[ConnectedGraphQ[g]]}, {text["Radius: "], ToString[GraphRadius[g]]}, {text["Diameter: "], ToString[GraphDiameter[g]]}, {text["Center: "], ToString[First@GraphCenter[g]]}, {text["Periphery: "], ToString[First@GraphPeriphery[g]]}}, Alignment -> Left]}, Spacer[20]]