Skip to content

StarGraph ​

The star graph on nn vertices — one centre joined to n−1n - 1 leaves.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageStarGraph✓
StarGraph(n)vertex 1 is the centre, joined to vertices 2,…,n2, \dots, n.
Typed signatures
TypePackageApplies
(integer) -> valuecombinatoricsalways

Domain: Collections

Examples

Basic #

The centre of a 6-vertex star has degree 5

live ↗
InVertexDegree(StarGraph(6),1)\mathrm{VertexDegree}(\mathrm{StarGraph}(6), 1)Out55
Scope #

One hub joined to seven leaves

live ↗
InStarGraph(8)\mathrm{StarGraph}(8)OutGraph([1,2,3,4,5,6,7,8],[UndirectedEdge(1,2),UndirectedEdge(1,3),UndirectedEdge(1,4),UndirectedEdge(1,5),UndirectedEdge(1,6),UndirectedEdge(1,7),UndirectedEdge(1,8)])\mathrm{Graph}(\bigl\lbrack1, 2, 3, 4, 5, 6, 7, 8\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(1, 3), \mathrm{UndirectedEdge}(1, 4), \mathrm{UndirectedEdge}(1, 5), \mathrm{UndirectedEdge}(1, 6), \mathrm{UndirectedEdge}(1, 7), \mathrm{UndirectedEdge}(1, 8)\bigr\rbrack)

A hub with five spokes

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

The hub reaches everything in one step; each leaf needs two

live ↗
InMap(()↦VertexEccentricity(StarGraph(6),_1⁡),VertexList(StarGraph(6)))\mathrm{Map}(()↦\mathrm{VertexEccentricity}(\mathrm{StarGraph}(6), \operatorname{\_1}), \mathrm{VertexList}(\mathrm{StarGraph}(6)))Out[1,2,2,2,2,2]\bigl\lbrack1, 2, 2, 2, 2, 2\bigr\rbrack
Properties #

A star is a tree

live ↗
InIsTreeGraph(StarGraph(5))\mathrm{IsTreeGraph}(\mathrm{StarGraph}(5))OutTrue\mathrm{True}

Hub on one side, leaves on the other

live ↗
InIsBipartiteGraph(StarGraph(5))\mathrm{IsBipartiteGraph}(\mathrm{StarGraph}(5))OutTrue\mathrm{True}

A hub joined to six leaves

live ↗
InStarGraph(7)\mathrm{StarGraph}(7)OutGraph([1,2,3,4,5,6,7],[UndirectedEdge(1,2),UndirectedEdge(1,3),UndirectedEdge(1,4),UndirectedEdge(1,5),UndirectedEdge(1,6),UndirectedEdge(1,7)])\mathrm{Graph}(\bigl\lbrack1, 2, 3, 4, 5, 6, 7\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(1, 3), \mathrm{UndirectedEdge}(1, 4), \mathrm{UndirectedEdge}(1, 5), \mathrm{UndirectedEdge}(1, 6), \mathrm{UndirectedEdge}(1, 7)\bigr\rbrack)
About
Examples7
Checked againstWolfram Language 7 agree
CrosswalkWolfram Language

See also: PathGraph, CompleteKaryTree