Skip to content

HararyGraph ​

The minimum-edge k-connected graph on n vertices (Harary, 1962).

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageHararyGraph!
HararyGraph(k, n)EdgeCount = ceil(k n / 2), minimum vertex degree >= k.
SageMathenumeratio_graph(graphs.HararyGraph(k, n))
Typed signatures
TypePackageApplies
(integer, integer) -> valuecombinatoricsalways

Domain: Collections

Details
  • k even: the circulant CirculantGraph(n, {1, …, k/2}). k odd, n even: that circulant plus the n/2 diametrically-opposite edges. k odd, n odd: that circulant plus vertex 1 joined to BOTH floor(n/2)+1 and ceil(n/2)+1 (1 alone ends up with degree k + 1 -- the one vertex n*k being odd forces to take the remainder), plus i <-> i + ceil(n/2) (1-based) giving everyone else their kth edge.
  • Kernel-verified against Wolfram 15 for the odd/odd case: HararyGraph(3, 7) gives exactly the 7-cycle plus {1-4, 1-5, 2-6, 3-7}. The even-k and (odd-k, even-n) cases follow the standard, unambiguous Harary construction and were not separately kernel-checked.

Examples

Basic #
live ↗
InEdgeCount(HararyGraph(4,7))\mathrm{EdgeCount}(\mathrm{HararyGraph}(4, 7))Out1414

The 7-cycle plus {1-4, 1-5, 2-6, 3-7} -- kernel-verified

live ↗
InEdgeList(HararyGraph(3,7))\mathrm{EdgeList}(\mathrm{HararyGraph}(3, 7))Out[UndirectedEdge(1,2),UndirectedEdge(2,3),UndirectedEdge(3,4),UndirectedEdge(4,5),UndirectedEdge(5,6),UndirectedEdge(6,7),UndirectedEdge(7,1),UndirectedEdge(1,4),UndirectedEdge(1,5),UndirectedEdge(2,6),UndirectedEdge(3,7)]\bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(2, 3), \mathrm{UndirectedEdge}(3, 4), \mathrm{UndirectedEdge}(4, 5), \mathrm{UndirectedEdge}(5, 6), \mathrm{UndirectedEdge}(6, 7), \mathrm{UndirectedEdge}(7, 1), \mathrm{UndirectedEdge}(1, 4), \mathrm{UndirectedEdge}(1, 5), \mathrm{UndirectedEdge}(2, 6), \mathrm{UndirectedEdge}(3, 7)\bigr\rbrack
Scope #

A 3-connected Harary graph on five vertices, with the fewest edges that connectivity allows

live ↗
InHararyGraph(3,5)\mathrm{HararyGraph}(3, 5)OutGraph([1,2,3,4,5],[UndirectedEdge(1,2),UndirectedEdge(2,3),UndirectedEdge(3,4),UndirectedEdge(4,5),UndirectedEdge(5,1),UndirectedEdge(1,3),UndirectedEdge(1,4),UndirectedEdge(2,5)])\mathrm{Graph}(\bigl\lbrack1, 2, 3, 4, 5\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(2, 3), \mathrm{UndirectedEdge}(3, 4), \mathrm{UndirectedEdge}(4, 5), \mathrm{UndirectedEdge}(5, 1), \mathrm{UndirectedEdge}(1, 3), \mathrm{UndirectedEdge}(1, 4), \mathrm{UndirectedEdge}(2, 5)\bigr\rbrack)
Applications #

Every vertex of this 4-connected graph on six vertices sits within distance 2 of all others

live ↗
InMap(_1⁡↦VertexEccentricity(HararyGraph(4,6),_1⁡),VertexList(HararyGraph(4,6)))\mathrm{Map}(\operatorname{\_1}↦\mathrm{VertexEccentricity}(\mathrm{HararyGraph}(4, 6), \operatorname{\_1}), \mathrm{VertexList}(\mathrm{HararyGraph}(4, 6)))Out[2,2,2,2,2,2]\bigl\lbrack2, 2, 2, 2, 2, 2\bigr\rbrack
About
Examples4
Checked againstWolfram Language 3 agree1 differSageMath 1 agree1 differ
CrosswalkWolfram LanguageSageMath

Implementation

mappedsagepackages/oracle/src/mappings.ts

See also: CirculantGraph, IsConnectedGraph