Musical Graph

Author

Eric W. Weisstein
April 6, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/MusicalGraph.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/MusicalGraph.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Code

MusicalGraph[n_:12]:=AddEdges[PrismGraph[n],Join[
Transpose[{Range[n],RotateRight[Range[n+1,2n]]}],
Transpose[{Range[n],RotateLeft[Range[n+1,2n]]}]
]]

Main Figure

g=ChangeVertices[MusicalGraph[],Join[Table[1.2,{12}],Table[1,{12}]]Vertices[MusicalGraph[]]];

{v1,v2}=Partition[Vertices[g],12];

{lets1,lets2}=RotateRight[#,7]&/@Reverse/@{{"a","d","g","c","f",Superscript["b","♭"],Row[{Superscript["d","♯"]," == ",Superscript["e","♭"]}],Superscript["g","♯"],Superscript["c","♯"],Superscript["f","♯"],"b","e"},{"C","F",Superscript["B","♭"],Superscript["E","♭"],Superscript["A","♭"],Superscript["D","♭"],Row[{Superscript["F","♯"]," == ",Superscript["G","♭"]}],"B","E","A","D","G"}};

Show[{
GraphPlot[g,Method->None],
Graphics[Text[#[[1]],.74#[[2]]]&/@Transpose[{lets1,v1}]],
Graphics[Text[#[[1]],1.15#[[2]]]&/@Transpose[{lets2,v2}]]
},ImageSize->250]

Figures

gs=MusicalGraph/@Range[3,10];

GraphicsGrid[Partition[GraphPlot[#,Method->None]&/@gs,4,4,{1,1},{}]]

RecognizeGraph/@gs

g2=Table[CirculantGraph[2n,{1,n-1,n}],{n,3,10}]

GraphicsGrid[Partition[GraphPlot[#,Method->None]&/@g2,4,4,{1,1},{}]]

Do[Print[{n,ToCommonEdges[MusicalGraph[n],Graph@{"Circulant",{2n,{1,n-1,n}}}]}],{n,4,7}]

Grid[Table[{n,Take[GraphData[{"Circulant",{2n,{1,n-1,n}}},"AllImages"],All]},{n,3,12}],Dividers->All]

GraphData

GraphClassString

GraphData["Musical*"]

GraphClassString[Table[GraphData[{"Circulant",{2n,{1,n-1,n}}},"#"],{n,3,7}]]

GraphClassString[Table[GraphData[{"Circulant",{2n,{1,n-1,n}}},"#"],{n,4,7}]]

GraphDataString

file=OpenWrite["~/musical.m"]

Table[WriteString[file,GraphDataString[g=CirculantGraph[2n,{1,n-1,n}],
"StandardName"->{"Circulant",{2n,{1,n-1,n}}},
"AlternateStandardNames"->{{"MusicalGraph",n}},
"Name"->ToString[2n]<>"-circulant graph (1,"<>ToString[n-1]<>","<>ToString[n]<>")",
"AlternateNames"->{ToString[n]<>"-musical graph"},
"Vertices"->{Vertices[g],ToCommonEdges[MusicalGraph[n],g]},
"Classes"->{"Circulant"},
Debug->True,
TimeConstraint->120
]],{n,8,12}]

Close[file]