({{, (RefLink[HypercubeGraph, paclet:ref/HypercubeGraph])[n] 
gives the n-dimensional hypercube graph (Subscript[Q, n]).}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[HypercubeGraph, paclet:ref/HypercubeGraph])[n] is a graph with (2^n) vertices that is the product of n copies of the complete graph (Subscript[K, 2]).

(RefLink[HypercubeGraph, paclet:ref/HypercubeGraph]) takes the same options as (RefLink[Graph, paclet:ref/Graph]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (95)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The first few hypercubes:

Table[HypercubeGraph[i,PlotLabel->(Subscript[Q, i])],{i,2,4}]

OpenersExampleSection1(Spacer1)Options  (79)

OpenersExampleSubsection0(Spacer1)EdgeLabels  (7)

Label the edge 1<->2:

HypercubeGraph[3,EdgeLabels->{1\[UndirectedEdge]2->"Hello"}]

Label all edges individually:

el=EdgeList[HypercubeGraph[3]]

HypercubeGraph[3,EdgeLabels->Table[el[[i]]->(Subscript["e", i]),{i,Length[el]}]]

Use any expression as a label:

HypercubeGraph[3,EdgeLabels->{2\[UndirectedEdge]4->,3\[UndirectedEdge]4->,1\[UndirectedEdge]3-> }]

Use (RefLink[Placed, paclet:ref/Placed]) with symbolic locations to control label placement along an edge:

Table[HypercubeGraph[2,EdgeLabels->{1\[UndirectedEdge]3->Placed["■■■",p]},PlotLabel->p],{p,{"Start","Middle","End"}}]

Use explicit coordinates to place labels:

Table[HypercubeGraph[2,EdgeLabels->{1\[UndirectedEdge]3->Placed["■■■",p]},PlotLabel->p,BaselinePosition->Bottom],{p,{0,1/4,1/3}}]

Vary positions within the label:

Table[HypercubeGraph[2,EdgeLabels->{1\[UndirectedEdge]3->Placed["■■■",{1/2,p}]},PlotLabel->p,BaselinePosition->Bottom],{p,{{0,0},{1/2,1/2},{1,1}}}]

Place multiple labels:

HypercubeGraph[3,EdgeLabels->{3\[UndirectedEdge]1->Placed[{"lbl1","lbl2"},{"Start","End"}]}]

HypercubeGraph[3,EdgeLabels->{3\[UndirectedEdge]1->Placed[{"lbl1","lbl2","lbl3"},{"Start","Middle","End"}]}]

Use automatic labeling by values through (RefLink[Tooltip, paclet:ref/Tooltip]) and (RefLink[StatusArea, paclet:ref/StatusArea]):

HypercubeGraph[3,EdgeLabels->Placed["Name",Tooltip]]

HypercubeGraph[3,EdgeLabels->Placed["Name",StatusArea]]

OpenersExampleSubsection1(Spacer1)EdgeShapeFunction  (6)

Get a list of built-in settings for (RefLink[EdgeShapeFunction, paclet:ref/EdgeShapeFunction]):

GraphElementData["Edge"]

Undirected edges including the basic line:

HypercubeGraph[2,EdgeShapeFunction->"Line"]

Lines with different glyphs on the edges:

Table[HypercubeGraph[2,EdgeShapeFunction->GraphElementData[ef,"ArrowSize"->0.1],PlotLabel->ef],{ef,{"BoxLine","DiamondLine","DotLine"}}]

Directed edges including solid arrows:

Table[HypercubeGraph[2,EdgeShapeFunction->GraphElementData[ef,"ArrowSize"->0.1],PlotLabel->ef],{ef,GraphElementData["Edge","FilledArrow"]}]

Line arrows:

Table[HypercubeGraph[2,EdgeShapeFunction->GraphElementData[ef,"ArrowSize"->0.1],PlotLabel->ef],{ef,GraphElementData["Edge","UnfilledArrow"]}]

Open arrows:

Table[HypercubeGraph[2,EdgeShapeFunction->GraphElementData[ef,"ArrowSize"->0.1],PlotLabel->ef],{ef,GraphElementData["Edge","CarvedArrow"]}]

Specify an edge function for an individual edge:

HypercubeGraph[2,EdgeShapeFunction->{1\[UndirectedEdge]2->"DotLine"}]

Combine with a different default edge function:

HypercubeGraph[2,EdgeShapeFunction->{1\[UndirectedEdge]2->"BoxLine","DotLine"}]

Draw edges by running a program:

ef[pts_List,e_]:=
Block[{s=0.015,g=},{Arrowheads[{{s,0.33,g},{s,0.67,g}}],Arrow[pts]}]

HypercubeGraph[2,EdgeShapeFunction->ef]

(RefLink[EdgeShapeFunction, paclet:ref/EdgeShapeFunction]) can be combined with (RefLink[EdgeStyle, paclet:ref/EdgeStyle]):

HypercubeGraph[2,EdgeStyle->Blue,EdgeShapeFunction->(Line[#1]&)]

(RefLink[EdgeShapeFunction, paclet:ref/EdgeShapeFunction]) has higher priority than (RefLink[EdgeStyle, paclet:ref/EdgeStyle]):

HypercubeGraph[2,EdgeStyle->Blue,EdgeShapeFunction->({Red,Line[#1]}&)]

OpenersExampleSubsection2(Spacer1)EdgeStyle  (2)

Style all edges:

Table[HypercubeGraph[3,EdgeStyle->style,PlotLabel->style],{style,{Gray,Dashed,Thick}}]

Style individual edges:

HypercubeGraph[3,EdgeStyle->{1\[UndirectedEdge]2->Blue,1\[UndirectedEdge]3->Dashed}]

OpenersExampleSubsection3(Spacer1)EdgeWeight  (2)

Specify a weight for all edges:

HypercubeGraph[2,EdgeWeight->RandomInteger[5,4]]

WeightedAdjacencyMatrix[%]//MatrixForm

Use any numeric expression as a weight:

HypercubeGraph[2,EdgeWeight->{a,b,c,d}]

WeightedAdjacencyMatrix[%]//MatrixForm

OpenersExampleSubsection4(Spacer1)GraphHighlight  (3)

Highlight the vertex 1:

HypercubeGraph[3,VertexSize->Medium,GraphHighlight->{1}]

Highlight the edge 1<->3:

HypercubeGraph[3,VertexSize->Tiny,GraphHighlight->{1\[UndirectedEdge]3}]

Highlight vertices and edges:

HypercubeGraph[3,VertexSize->Tiny,GraphHighlight->{1,2,1\[UndirectedEdge]3,1\[UndirectedEdge]5}]

OpenersExampleSubsection5(Spacer1)GraphHighlightStyle  (2)

Get a list of built-in settings for (RefLink[GraphHighlightStyle, paclet:ref/GraphHighlightStyle]):

GraphElementData["GraphHighlightStyle"]

Use built-in settings for (RefLink[GraphHighlightStyle, paclet:ref/GraphHighlightStyle]):

HypercubeGraph[3,GraphHighlight->{1,1\[UndirectedEdge]3},VertexSize->Small,GraphHighlightStyle->#,PlotLabel->#]&/@Select[GraphElementData["GraphHighlightStyle"],#=!=Automatic&]

OpenersExampleSubsection6(Spacer1)GraphLayout  (5)

By default, the layout is chosen automatically:

HypercubeGraph[3,GraphLayout->Automatic]

Specify layouts on special curves:

Table[HypercubeGraph[5,GraphLayout->l,PlotLabel->l],{l,{"CircularEmbedding","SpiralEmbedding"}}]

Specify layouts that satisfy optimality criteria:

Table[HypercubeGraph[5,GraphLayout->l,PlotLabel->l],{l,{"SpringEmbedding","SpringElectricalEmbedding","HighDimensionalEmbedding"}}]

(RefLink[VertexCoordinates, paclet:ref/VertexCoordinates]) overrides (RefLink[GraphLayout, paclet:ref/GraphLayout]) coordinates:

{HypercubeGraph[3,GraphLayout->"SpringElectricalEmbedding"],
HypercubeGraph[3,GraphLayout->"SpringElectricalEmbedding",VertexCoordinates->Table[{i,i},{i,0,7}]]}

Use (RefLink[AbsoluteOptions, paclet:ref/AbsoluteOptions]) to extract (RefLink[VertexCoordinates, paclet:ref/VertexCoordinates]) computed using a layout algorithm:

HypercubeGraph[3]

AbsoluteOptions[%,VertexCoordinates]

OpenersExampleSubsection7(Spacer1)PlotTheme  (4)

OpenersExampleSubsubsection0(Spacer1)Base Themes  (2)

Use a common base theme:

HypercubeGraph[3,PlotTheme->"Business"]

Use a monochrome theme:

HypercubeGraph[3,PlotTheme->"Monochrome"]

OpenersExampleSubsubsection1(Spacer1)Feature Themes  (2)

Use a large graph theme:

HypercubeGraph[3,PlotTheme->"LargeGraph"]

Use a classic diagram theme:

HypercubeGraph[3,PlotTheme->"ClassicDiagram"]

OpenersExampleSubsection8(Spacer1)Properties  (2)

Specify a property for vertices:

HypercubeGraph[3,Properties->{1->{VertexLabels-> "hello"}}]

Edges:

HypercubeGraph[3,Properties->{2\[UndirectedEdge]4->{EdgeLabels-> "hello"}}]

OpenersExampleSubsection9(Spacer1)VertexCoordinates  (3)

By default, any vertex coordinates are computed automatically:

HypercubeGraph[3]

Extract the resulting vertex coordinates using (RefLink[AbsoluteOptions, paclet:ref/AbsoluteOptions]):

AbsoluteOptions[%,VertexCoordinates]

Specify a layout function along an ellipse:

ellipseLayout[n_,{a_,b_}]:=Table[{a Cos[2Pi/n u],b Sin[2Pi/n u]},{u,1,n}]

Graphics[Point[ellipseLayout[20,{2,1}]]]

Use it to generate vertex coordinates for a graph:

HypercubeGraph[4,VertexCoordinates->ellipseLayout[16,{2,1}]]

(RefLink[VertexCoordinates, paclet:ref/VertexCoordinates]) has higher priority than (RefLink[GraphLayout, paclet:ref/GraphLayout]):

HypercubeGraph[3,VertexCoordinates->Table[{i,i},{i,8}],GraphLayout->"CircularEmbedding"]

OpenersExampleSubsection10(Spacer1)VertexLabels  (13)

Use vertex names as labels:

HypercubeGraph[3,VertexLabels->"Name"]

Label individual vertices:

HypercubeGraph[3,VertexLabels->{2->"one"}]

Label all vertices:

HypercubeGraph[3,VertexLabels->Table[i->(Subscript[v, i]),{i,8}]]

Use any expression as a label:

HypercubeGraph[3,VertexLabels->{1->,2->,3->}]

Use (RefLink[Placed, paclet:ref/Placed]) with symbolic locations to control label placement, including outside positions:

Table[HypercubeGraph[2,VertexSize->0.1,VertexShapeFunction->"Square",VertexLabels->Table[i->Placed["■■",p],{i,4}],PlotLabel->p],{p,{Before,After,Below,Above}}]

Symbolic outside corner positions:

pl={{Before,Below},{After,Below},{Before,Above},{After,Above}};

Table[HypercubeGraph[2,VertexSize->0.1,VertexShapeFunction->"Square",VertexLabels->Table[i->Placed["■■",p],{i,4}],PlotLabel->p],{p,pl}]

Symbolic inside positions:

Table[HypercubeGraph[2,VertexSize->0.25,VertexLabels->Table[i->Placed["■■■",p],{i,4}],VertexShapeFunction->"Square",PlotLabel->p],{p,{Left,Top,Right,Bottom}}]

Symbolic inside corner positions:

pl={{Left,Bottom},{Right,Bottom},{Left,Top},{Right,Top}};

Table[HypercubeGraph[2,VertexSize->0.25,VertexShapeFunction->"Square",VertexLabels->Table[i->Placed["■■■",p],{i,4}],PlotLabel->p],{p,pl}]

Use explicit coordinates to place the center of labels:

Table[HypercubeGraph[2,VertexSize->0.25,VertexShapeFunction->"Square",VertexLabels->Table[i->Placed[,p],{i,4}],PlotLabel->p,BaselinePosition->Bottom],{p,{{0,0},{1/2,1/2},{1,1}}}]

Place all labels at the upper-right corner of the vertex and vary the coordinates within the label:

Table[HypercubeGraph[2,VertexSize->0.35,VertexShapeFunction->"Square",VertexLabels->Table[i->Placed[,{{1,1},p}],{i,4}],PlotLabel->p,BaselinePosition->Bottom],{p,{{0,0},{1/2,1/2},{1,1}}}]

Place multiple labels:

HypercubeGraph[3,VertexLabels->{1->Placed[{"lbl1","lbl2"},{Above,Below}]}]

Any number of labels can be used:

HypercubeGraph[3,VertexLabels->{1->Placed[{"lbl1","lbl2","lbl3","lbl4"},{Above,After,Below,Before}]}]

Use the argument to (RefLink[Placed, paclet:ref/Placed]) to control formatting including (RefLink[Tooltip, paclet:ref/Tooltip]):

HypercubeGraph[3,VertexLabels->Placed["Name",Tooltip]]

Or (RefLink[StatusArea, paclet:ref/StatusArea]):

HypercubeGraph[3,VertexLabels->Placed["Name",StatusArea]]

Use more elaborate formatting functions:

rotateLabel[lab_]:=Rotate[lab,45Degree]

HypercubeGraph[3,VertexLabels->Table[i->Placed["xxx",Below,rotateLabel],{i,4}]]

panelLabel[lab_]:=Panel[lab,FrameMargins->0,Background->Lighter[Yellow,0.7]]

HypercubeGraph[3,VertexLabels->Table[i->Placed["xxx",Center,panelLabel],{i,4}]]

hyperlinkLabel[lab_]:=Hyperlink[lab,"http://www.wolfram.com"]

HypercubeGraph[3,VertexLabels->Table[i->Placed["xxx",Center,hyperlinkLabel],{i,4}]]

OpenersExampleSubsection11(Spacer1)VertexShape  (5)

Use any (RefLink[Graphics, paclet:ref/Graphics]), (RefLink[Image, paclet:ref/Image]), or (RefLink[Graphics3D, paclet:ref/Graphics3D]) as a vertex shape:

Table[HypercubeGraph[3,VertexShape->s,VertexSize->Large],{s,{,,}}]

Specify vertex shapes for individual vertices:

HypercubeGraph[3,VertexShape->{2->},VertexSize->Large]

(RefLink[VertexShape, paclet:ref/VertexShape]) can be combined with (RefLink[VertexSize, paclet:ref/VertexSize]):

Table[HypercubeGraph[3,VertexSize->s,VertexShape->,PlotLabel->s],{s,{Medium,Large}}]

(RefLink[VertexShape, paclet:ref/VertexShape]) is not affected by (RefLink[VertexStyle, paclet:ref/VertexStyle]):

HypercubeGraph[3,VertexSize->0.4,VertexShape->,VertexStyle->Blue]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) has higher priority than (RefLink[VertexShape, paclet:ref/VertexShape]):

HypercubeGraph[3,VertexSize->0.3,VertexShapeFunction->"Square",VertexShape->]

OpenersExampleSubsection12(Spacer1)VertexShapeFunction  (10)

Get a list of built-in collections for (RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]):

GraphElementData["Vertex"]

Use built-in settings for (RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) in the "Basic" collection:

GraphElementData["Vertex","Basic"]

Simple basic shapes:

Table[HypercubeGraph[2,VertexShapeFunction->vf,VertexSize->0.2,PlotLabel->vf],{vf,{"Triangle","Square","Rectangle","Pentagon","Hexagon","Octagon"}}]

Common basic shapes:

Table[HypercubeGraph[2,VertexShapeFunction->vf,VertexSize->0.2,PlotLabel->vf],{vf,{"DownTrapezoid","UpTrapezoid","Parallelogram","FiveDown","Circle","Diamond","Star","Capsule"}}]

Use built-in settings for (RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) in the "Rounded" collection:

GraphElementData["Vertex","Rounded"]

Table[HypercubeGraph[2,VertexShapeFunction->vf,VertexSize->0.2,PlotLabel->vf],{vf,GraphElementData["Vertex","Rounded"]}]

Use built-in settings for (RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) in the "Concave" collection:

GraphElementData["Vertex","Concave"]

Table[HypercubeGraph[2,VertexShapeFunction->vf,VertexSize->0.2,PlotLabel->vf],{vf,GraphElementData["Vertex","Concave"]}]

Draw individual vertices:

HypercubeGraph[3,VertexShapeFunction->{ 1->"Square"},VertexSize->0.2]

Combine with a default vertex function:

HypercubeGraph[3,VertexShapeFunction->{ 1->"Square","Triangle"},VertexSize->0.2]

Draw vertices using a predefined graphic:

HypercubeGraph[3,VertexShapeFunction->(Inset[,#]&)]

Draw vertices by running a program:

vf[{xc_,yc_},name_,{w_,h_}]:=
Block[{xmin=xc-w,xmax=xc+w,ymin=yc-h,ymax=yc+h},
Polygon[{{xmin,ymin},{xmax,ymax},{xmin,ymax},{xmax,ymin}}]
];

HypercubeGraph[3,VertexShapeFunction->vf,VertexSize->0.2]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) can be combined with (RefLink[VertexStyle, paclet:ref/VertexStyle]):

vf1[{xc_,yc_},name_,{w_,h_}]:=Rectangle[{xc-w,yc-h},{xc+w,yc+h}]

HypercubeGraph[3,VertexSize->0.2,VertexStyle->Blue,VertexShapeFunction->vf1]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) has higher priority than (RefLink[VertexStyle, paclet:ref/VertexStyle]):

vf2[{xc_,yc_},name_,{w_,h_}]:={Red,Rectangle[{xc-w,yc-h},{xc+w,yc+h}]}

HypercubeGraph[3,VertexSize->0.2,VertexStyle->Blue,VertexShapeFunction->vf2]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) can be combined with (RefLink[VertexSize, paclet:ref/VertexSize]):

HypercubeGraph[3,VertexShapeFunction->"Star",VertexSize->{1->Small,Medium}]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) has higher priority than (RefLink[VertexShape, paclet:ref/VertexShape]):

HypercubeGraph[3,VertexSize->0.3,VertexShapeFunction->"Star",VertexShape->]

OpenersExampleSubsection13(Spacer1)VertexSize  (8)

By default, the size of vertices is computed automatically:

HypercubeGraph[3,VertexSize->Automatic]

Specify the size of all vertices using symbolic vertex size:

Table[HypercubeGraph[3,VertexSize->s,PlotLabel->s],{s,{Tiny,Small,Medium,Large}}]

Use a fraction of the minimum distance between vertex coordinates:

Table[HypercubeGraph[3,VertexSize->s,PlotLabel->s],{s,0.1,1,0.3}]

Use a fraction of the overall diagonal for all vertex coordinates:

Table[HypercubeGraph[3,VertexSize->{"Scaled", s},PlotLabel->{"Scaled", s}],{s,0.1,1,0.3}]

Specify size in both the x and y directions:

Table[HypercubeGraph[3,VertexSize->s,PlotLabel->s],{s,{{0.1,0.2},{0.2,0.1}}}]

Specify the size for individual vertices:

HypercubeGraph[3,VertexSize->{1->0.2,2->0.3}]

(RefLink[VertexSize, paclet:ref/VertexSize]) can be combined with (RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]):

Table[HypercubeGraph[3,VertexSize->s,VertexShapeFunction->"Square",PlotLabel->s],{s,{0.05,0.1,0.2}}]

(RefLink[VertexSize, paclet:ref/VertexSize]) can be combined with (RefLink[VertexShape, paclet:ref/VertexShape]):

Table[HypercubeGraph[3,VertexSize->s,VertexShape->,PlotLabel->s],{s,{0.1,0.2,0.4}}]

OpenersExampleSubsection14(Spacer1)VertexStyle  (5)

Style all vertices:

Table[HypercubeGraph[3,VertexStyle->style,VertexSize->0.3,PlotLabel->style],{style,{Yellow,EdgeForm[Dashed]}}]

Style individual vertices:

HypercubeGraph[3,VertexStyle->{1->Blue,2->Red},VertexSize->0.3]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) can be combined with (RefLink[VertexStyle, paclet:ref/VertexStyle]):

vf1[{xc_,yc_},name_,{w_,h_}]:=Rectangle[{xc-w,yc-h},{xc+w,yc+h}]

HypercubeGraph[3,VertexSize->0.3,VertexStyle->Blue,VertexShapeFunction->vf1]

(RefLink[VertexShapeFunction, paclet:ref/VertexShapeFunction]) has higher priority than (RefLink[VertexStyle, paclet:ref/VertexStyle]):

vf2[{xc_,yc_},name_,{w_,h_}]:={Red,Rectangle[{xc-w,yc-h},{xc+w,yc+h}]}

HypercubeGraph[3,VertexSize->0.3,VertexStyle->Blue,VertexShapeFunction->vf2]

(RefLink[VertexStyle, paclet:ref/VertexStyle]) can be combined with (RefLink[BaseStyle, paclet:ref/BaseStyle]):

HypercubeGraph[3,VertexStyle->LightBlue,BaseStyle->EdgeForm[Dotted],VertexSize->0.3]

(RefLink[VertexStyle, paclet:ref/VertexStyle]) has higher priority than (RefLink[BaseStyle, paclet:ref/BaseStyle]):

HypercubeGraph[3,VertexStyle->LightBlue,BaseStyle->Gray,VertexSize->0.3]

(RefLink[VertexShape, paclet:ref/VertexShape]) is not affected by (RefLink[VertexStyle, paclet:ref/VertexStyle]):

HypercubeGraph[3,VertexSize->0.3,VertexShape->,VertexStyle->Blue]

OpenersExampleSubsection15(Spacer1)VertexWeight  (2)

Set the weight for all vertices:

HypercubeGraph[2,VertexWeight->{2,3,4,5}]

PropertyValue[{%,1},VertexWeight]

Use any numeric expression as a weight:

HypercubeGraph[2,VertexWeight->{a,b,c,d}]

PropertyValue[{%,1},VertexWeight]

OpenersExampleSection2(Spacer1)Applications  (6)

The (RefLink[GraphCenter, paclet:ref/GraphCenter]) of hypercube graphs:

Table[HighlightGraph[#,GraphCenter[#]]&[HypercubeGraph[i,VertexSize->0.2]],{i,2,5}]

The (RefLink[GraphPeriphery, paclet:ref/GraphPeriphery]):

Table[HighlightGraph[#,GraphPeriphery[#]]&[HypercubeGraph[i,VertexSize->0.2]],{i,2,5}]

The (RefLink[VertexEccentricity, paclet:ref/VertexEccentricity]):

VertexEccentricity[HypercubeGraph[3],#]&/@VertexList[HypercubeGraph[3]]

Highlight the vertex eccentricity path:

FindVertexEccentricityPath[g_?UndirectedGraphQ,u_]/;MemberQ[VertexList[g],u]:=Module[{d=GraphDistanceMatrix[g],v,posu,posv,vl=VertexList[g]},posu=VertexIndex[g,u];
posv=First@First@Position[d[[posu]],Max[d[[posu]]]];
PathGraph[FindShortestPath[g,u,vl[[posv]]]]]

Table[HighlightGraph[g=HypercubeGraph[3],FindVertexEccentricityPath[g,u]],{u,Range[4]}]

The (RefLink[GraphRadius, paclet:ref/GraphRadius]):

Table[GraphRadius[HypercubeGraph[i]],{i,2,5}]

Highlight the radius path:

FindRadiusPath[g_?UndirectedGraphQ]:=Module[{c=First@GraphCenter[g],d,v,pos},d=Table[GraphDistance[g,c,u],{u,VertexList[g]}];
pos=First@Position[d,Max[d]];
v=First@Part[VertexList[g],pos];
PathGraph[FindShortestPath[g,c,v]]]

Table[HighlightGraph[#,FindRadiusPath[#]]&[HypercubeGraph[i,VertexSize->Tiny]],{i,2,5}]

The (RefLink[GraphDiameter, paclet:ref/GraphDiameter]):

Table[GraphDiameter[HypercubeGraph[i]],{i,2,5}]

Highlight the diameter path:

FindDiameterPath[g_?UndirectedGraphQ]:=Module[{d=GraphDistanceMatrix[g],u,v,pos},pos=First@Position[d,Max[d]];
{u,v}=Part[VertexList[g],pos];
PathGraph[FindShortestPath[g,u,v]]]

Table[HighlightGraph[#,FindDiameterPath[#]]&[HypercubeGraph[i,VertexSize->Tiny]],{i,2,5}]

Highlight the vertex degree for (RefLink[HypercubeGraph, paclet:ref/HypercubeGraph]):

HighlightCentrality[g_, cc_]:=HighlightGraph[g,Table[Style[VertexList[g][[i]],ColorData["TemperatureMap"][cc[[i]]/Max[cc]]],{i,VertexCount[g]}]];

g=HypercubeGraph[3,VertexSize->Large];

HighlightCentrality[g,VertexDegree[g]]

Highlight the closeness centrality:

HighlightCentrality[g,ClosenessCentrality[g]]

Highlight the eigenvector centrality:

HighlightCentrality[g,EigenvectorCentrality[g]]

OpenersExampleSection3(Spacer1)Properties & Relations  (6)

(RefLink[HypercubeGraph, paclet:ref/HypercubeGraph])[n] has (2^n) vertices:

VertexCount[HypercubeGraph[n]]

(RefLink[HypercubeGraph, paclet:ref/HypercubeGraph])[n] has n (2^(n-1)) edges:

EdgeCount[HypercubeGraph[n]]

Hypercube graph (Subscript[Q, 2]) is a cycle graph (Subscript[C, 4]):

HypercubeGraph[2]

Hypercube graph is bipartite:

BipartiteGraphQ[HypercubeGraph[3]]

Hypercube graph is Hamiltonian:

HamiltonianGraphQ[HypercubeGraph[4]]

The eigenvalues of the adjacency matrix of a hypercube graph are -n,2-n,…, –2, 0, 2,…, n-2, n:

Eigenvalues[AdjacencyMatrix[HypercubeGraph[4]]]//Sort

OpenersExampleSection4(Spacer1)Possible Issues  (1)

The setting (RefLink[DirectedEdges, paclet:ref/DirectedEdges])->(RefLink[True, paclet:ref/True]) does not apply to (RefLink[HypercubeGraph, paclet:ref/HypercubeGraph]):

HypercubeGraph[3,DirectedEdges-> True]

OpenersExampleSection5(Spacer1)Neat Examples  (2)

Table[HypercubeGraph[k],{k,5,8}]

MatrixPlot[AdjacencyMatrix[HypercubeGraph[17]]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Graph, paclet:ref/Graph])  ▪  (RefLink[GraphData, paclet:ref/GraphData])  ▪  (RefLink[CompleteGraph, paclet:ref/CompleteGraph])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graph Construction & Representation, paclet:guide/GraphConstructionAndRepresentation])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/21-graphs-and-networks.html])(WebLink[: Graphs and Networks, https://www.wolfram.com/language/elementary-introduction/21-graphs-and-networks.html])}})}})