gives vertices that are maximally distant to at least one vertex in the graph g.
GraphPeriphery[{vw,…}]
uses rules vw to specify the graph g.
GraphPeriphery
gives vertices that are maximally distant to at least one vertex in the graph g.
GraphPeriphery[{vw,…}]
uses rules vw to specify the graph g.
Details and Options
- GraphPeriphery is also known as peripheral vertices.
- The following options can be given:
-
EdgeWeight Automatic weight for each edge Method Automatic method to use - With the default setting EdgeWeight->Automatic, the edge weight of an edge is taken to be the EdgeWeight of the graph g if available; otherwise, it is 1.
- Possible Method settings include "Dijkstra", "FloydWarshall", "Johnson", and "PseudoDiameter".
Examples
open all close allBasic Examples (1)
Scope (7)
GraphPeriphery works with undirected graphs:
GraphPeriphery[[image]]GraphPeriphery[[image]]GraphPeriphery[[image]]GraphPeriphery[[image]]GraphPeriphery[[image]]Use rules to specify the graph:
GraphPeriphery[{1 -> 2, 2 -> 3, 3 -> 1, 3 -> 4, 4 -> 5, 5 -> 3}]GraphPeriphery works with large graphs:
g = GridGraph[{10, 10, 10, 10}];GraphPeriphery[g]//Length//TimingApplications (1)
Properties & Relations (8)
In a connected graph, the periphery can be found using VertexEccentricity:
g = GridGraph[{3, 4}]VertexEccentricity[g, #]& /@ VertexList[g]Flatten[Position[%, Max[%]]]GraphPeriphery[g]Undirected connected graphs have at least two vertices on the periphery:
Select[RandomGraph[BernoulliGraphDistribution[7, 0.6], 9], ConnectedGraphQ]Length[GraphPeriphery[#]]& /@ %And@@Thread[% ≥ 2]For a CompleteGraph, the periphery includes all vertices:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[CompleteGraph[n, VertexSize -> Small], {n, 3, 6}]For a PathGraph with positive weights, the periphery consists of the endpoints:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[PathGraph[Range[n], VertexSize -> Large], {n, 5, 8}]With non-negative weights, the periphery forms two paths ending at the respective endpoints:
HighlightGraph[#, GraphPeriphery[#]]&[PathGraph[Range[8], VertexSize -> Large, EdgeWeight -> {0, 1, 1, 0, 1, 0, 0}]]For a CycleGraph, all vertices are at the periphery:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[CycleGraph[n, VertexSize -> Small], {n, 3, 6}]For a WheelGraph of size 5 or more, all vertices but the hub are at the periphery:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[WheelGraph[n, VertexSize -> Small], {n, 5, 8}]For a GridGraph, the periphery consists of the vertices at the corners:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[GridGraph[dim, VertexSize -> Small, ImageSize -> {Tiny, Tiny}], {dim, {{3, 3}, {3, 4}, {4, 3}, {4, 4}}}]For a CompleteKaryTree, the periphery consists of the leaves:
HighlightGraph[#, GraphPeriphery[#]]& /@ Table[CompleteKaryTree[n, VertexSize -> Large], {n, 3, 5}]Related Guides
Text
Wolfram Research (2010), GraphPeriphery, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphPeriphery.html (updated 2015).
CMS
Wolfram Language. 2010. "GraphPeriphery." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphPeriphery.html.
APA
Wolfram Language. (2010). GraphPeriphery. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphPeriphery.html
BibTeX
@misc{reference.wolfram_2026_graphperiphery, author="Wolfram Research", title="{GraphPeriphery}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphPeriphery.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_graphperiphery, organization={Wolfram Research}, title={GraphPeriphery}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphPeriphery.html}, note=[Accessed: 13-June-2026]}