Function Repository Resource:

GraphCoordinationSequence

Source Notebook

Find the number of vertices at each distance in a symmetric graph

Contributed by: Ed Pegg Jr

ResourceFunction["GraphCoordinationSequence"][g]

finds the number of vertices at distance k for each vertex in the graph g and returns the distinct behaviors.

Details

In a square lattice, the coordination sequence starts 1, 4, 8, 12, 16, 20, 24, ..., with multiples of 4 following. By the taxicab metric, there is one lattice point at distance 0, 4 at distance 1, and so on.
Usually, the coordination sequence is only of interest when it is the same for all vertices.
For a disconnected graph, the number of unreachable points is placed after ∞.
Finding the coordination sequence for a specific graph is compuationally easy. Finding the graph for a specific coordination sequence is extremely difficult. Whether a graph with coordination sequence {1, 57, 3192} exists has been an unsolved question since 1960.

Examples

Basic Examples (3) 

Find the coordination sequence of the Petersen graph:

In[1]:=
ResourceFunction["GraphCoordinationSequence"][PetersenGraph[]]
Out[1]=

Show the GraphDistanceMatrix in unsorted and sorted form:

In[2]:=
g = Graph[PetersenGraph[], ImageSize -> 100];
gdm = GraphDistanceMatrix[g];
Row[Append[Style[MatrixForm[#], 8] & /@ {gdm, Sort[Sort /@ gdm]}, g], Spacer[20]]
Out[4]=

Construct the order-7 middle levels graph (here, the middle levels are 3 and 4):

In[5]:=
mlg7 = Graph3D[
  UndirectedEdge @@@ Select[Subsets[Subsets[Range[7], {3, 4}], {2}], Length[Complement[#[[1]], #[[2]]]] == 0 &]]
Out[5]=

Find the coordination sequence:

In[6]:=
ResourceFunction["GraphCoordinationSequence"][mlg7]
Out[6]=

The coordination sequence for any odd order middle levels graph can be found with a formula:

In[7]:=
With[{n = 7}, Table[Binomial[Ceiling[n/2], Ceiling[k/2]] Binomial[Floor[n/2], Floor[k/2]], {k, 0, n}]]
Out[7]=

Find the coordination sequence for a disconnected graph:

In[8]:=
ResourceFunction["GraphCoordinationSequence"][
 GraphData["TwoOctahedra"]]
Out[8]=

Scope (3) 

Directed graphs may be used, such as seen in CayleyGraph.

The following graph is Fibonacci to ten steps in the coordination sequence:

In[9]:=
fibcayley = CayleyGraph[
  PermutationGroup[{Cycles[{{1, 4}}], Cycles[{{1, 7, 6}, {2, 3, 5, 4}}]}]]; 
ResourceFunction["GraphCoordinationSequence"][fibcayley][[1]]
Out[9]=

The following graph is tribonacci to ten steps in the coordination sequence:

In[10]:=
tribcayley = CayleyGraph[
  PermutationGroup[{Cycles[{{2, 4, 3}}], Cycles[{{1, 7, 2, 6, 3}, {4, 5}}]}]]; Grid[{ResourceFunction[
    "GraphCoordinationSequence"][tribcayley][[1]],
  LinearRecurrence[{1, 1, 1}, {1, 2, 4}, 18]}, Frame -> All]
Out[10]=

The following graph is Padovan to ten steps in the coordination sequence:

In[11]:=
padovancayley = CayleyGraph[
  PermutationGroup[{Cycles[{{1, 5}, {2, 4}, {3, 6}}], Cycles[{{1, 3, 4}, {2, 5, 7}}]}]]; 
ResourceFunction["GraphCoordinationSequence"][padovancayley][[1]]
Out[11]=
In[12]:=
LinearRecurrence[{0, 1, 1}, {2, 3, 4}, 15]
Out[12]=

Properties and Relations (2) 

The coordination sequences of hypercube graphs are binomial:

In[13]:=
Column[Table[
  ResourceFunction["GraphCoordinationSequence"][
   GraphData[{"Hypercube", n}]], {n, 2, 10}], Alignment -> Center]
Out[13]=

The coordination sequences of the Bruhat graphs are the Mahonian numbers, A008302:

In[14]:=
Column[
 Table[ResourceFunction["GraphCoordinationSequence"][
    GraphData[{"Bruhat", n}]][[1]], {n, 3, 6}], Alignment -> Center]
Out[14]=

Possible Issues (4) 

Multiple graphs can have the same coordination sequence:

In[15]:=
graphs = {"SmallRhombicosidodecahedralGraph", {"JohnsonSkeleton", 73}, {"TorusGrid", {6, 10}}};
Grid[{graphs, GraphData /@ graphs, ResourceFunction["GraphCoordinationSequence"][GraphData[#]] & /@ graphs}]
Out[16]=

Some graphs show different distant behaviors for every vertex:

In[17]:=
g = Graph[GraphData[{"UniquelyPancyclic", {14, 3}}], ImageSize -> 100];
gdm = GraphDistanceMatrix[g];
Row[Append[Style[MatrixForm[#], 8] & /@ {gdm, Sort[Sort /@ gdm]}, g], Spacer[20]]
Out[18]=

The coordination sequence for this graph has maximal dis-coordination:

In[19]:=
ResourceFunction["GraphCoordinationSequence"][g]
Out[19]=

Up to 9 vertices, all regular connected graphs have the same coordination sequence for all vertices, with two exceptions:

In[20]:=
graphs = {"PentagonalWedgeGraph", {"MinimalRegularMatchstick", 3}};
Grid[{Style[#, 9] & /@ graphs, GraphData[#] & /@ graphs, ResourceFunction["GraphCoordinationSequence"][GraphData[#]] & /@ graphs}, Frame -> All]
Out[21]=

Graphs with a specific coordination sequence are hard to find. Here are several of the form {1,3,6,x,x,4}:

In[22]:=
graphs = {{"GeneralizedPetersen", {15, 3}}, "DyckGraph", "RollingTriangularDipyramidGraph"};
Grid[{Style[#, 9] & /@ graphs, GraphData[#] & /@ graphs, ResourceFunction["GraphCoordinationSequence"][GraphData[#]][[1]] & /@
    graphs}, Frame -> All]
Out[23]=

Determining the existence of all {1,3,6,10,10,4} graphs currently requires a search of the 453090162062723 cubic graphs on 34 nodes.

Neat Examples (2) 

Here are 947 Cayley graphs with precomputed {order, coordination sequence, generator}:

In[24]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/0540d243-7fb8-4a64-a773-9746fd410b09"]
Out[25]=

Coordination sequences have a rise followed (usually) by a fall:

In[26]:=
ListPlot[#[[2]] & /@ Select[distinctcayley, First[#] == 5040 &], Joined -> True]
Out[26]=

Version History

  • 1.0.0 – 11 October 2022

Related Resources

License Information