Improving the Kruskal–Katona Bounds for Complete Subgraphs of a Graph

Robert Cowen

An important problem in graph theory is to find the number of complete subgraphs of a given size in a graph. If the graph is very large, it is usually only possible to obtain upper bounds for these numbers based on the numbers of complete subgraphs of smaller sizes. The Kruskal–Katona bounds are often used for these calculations. We investigate these bounds in specific cases and study how they might be improved.

Introduction

Graph theory has many interesting problems that lend themselves to computer investigation. Mathematica has many graph theory functions that can enable these investigations. We shall introduce the reader to Mathematica’s graph theory capability while investigating a problem in extremal graph theory. Extremal graph theory tries to find graphs satisfying certain extreme properties—for example, having the most triangles for a fixed number of edges.

We first introduce some basic graph theory concepts and show how to represent them in Mathematica. Formerly, most graph theory functions were contained in the Combinatorica package; however, this graph theory functionality has, for the most part, been absorbed by the main program, making it unnecessary to load this package.

Graph Theory Basics

A finite graph g consists of two finite sets, V and E. The elements of the set V are called vertices and the elements of the set E consist of (unordered) pairs of vertices called edges. We often write g=(V,E). A graph (Subscript[g, 1])=((Subscript[V, 1]),(Subscript[E, 1])) is called a subgraph of graph g if (Subscript[V, 1])⊂V and (Subscript[E, 1])⊂E; that is, if each vertex in the subgraph (Subscript[g, 1]) is also a vertex in the graph g and each edge of the subgraph (Subscript[g, 1]) is also an edge of the graph g.

Graphs are often depicted as points (the vertices) and line segments (the edges) that join pairs of vertices in E. Thus, to draw the graph g consisting of the five labeled vertices V={1,2,3,4,5} and with edge set E being all pairs of vertices, we enter the following command.

g=CompleteGraph[5,VertexLabels->Automatic]

This graph is known as the complete graph on five vertices and denoted by (Subscript[K, 5]).

In general, (Subscript[K, n]) denotes the complete subgraph on n vertices, that is, the graph with vertex set {1,2,3,…,n} and edge set consisting of all pairs of elements of V.

The complement of the graph g=(V,E) is the graph having the same set of vertices V and whose edges are exactly those pairs of vertices of V that do not belong to E. Thus, the graph complement of the complete graph g=(Subscript[K, 5]) has no edges at all.

GraphComplement[g]

Mathematica can also add vertices to an already existing graph. This adds two vertices labeled A and B to the graph g.

g1=VertexAdd[g,{A,B}]

This is how to add edges to graph (Subscript[g, 1]). (The symbol “<->” can be entered from the keyboard using the Esc key; press Esc, type u and e, then press Esc again.)

g2=EdgeAdd[g1,{A\[UndirectedEdge]1,A\[UndirectedEdge]2,A\[UndirectedEdge]3,A\[UndirectedEdge]4,B\[UndirectedEdge]1,B\[UndirectedEdge]2,B \[UndirectedEdge]3}]

Vertices and edges can be deleted with the commands VertexDelete and EdgeDelete.

Another useful operation, VertexContract, contracts a set of vertices into one vertex. For example, this contracts the graph (Subscript[g, 2]) by contracting the vertices labeled A and B into a single vertex.

VertexContract[g2,{A,B}]

The Number of Complete Subgraphs of a Graph

An important problem in graph theory is to find the number of complete subgraphs (or cliques) of a graph. For example, find the number of cliques of a certain size in a large social network graph. Here, the people are the vertices, an edge joins two people who know each other and a clique consists of people who all know each other; that is, they form a complete subgraph.

There is a dual version of this problem, equally important, that asks for the number of independent sets of a graph. A set of vertices is independent in the graph g if there are no edges of g connecting the vertices in the set. (Clearly, a set of vertices of g is independent if and only if they form a complete graph in the complement of g.)

We consider next how to compute the number of complete subgraphs exactly for small graphs and how one might obtain useful upper bounds for larger graphs.

Given (Subscript[K, 7]), it is easy to determine how many complete subgraphs there are having, say, four vertices; the answer is the number of ways to choose four of the seven vertices, since for each such choice, all edges between the chosen vertices are also present in the original graph. The number of ways to choose four out of seven objects is just the binomial coefficient (({{7}, {4}})).

Binomial[7,4]

However, if the graph is not a complete graph, it is not so easy to determine how many complete subgraphs of a certain size it contains. We turn to this problem next.

Consider the graph (Subscript[g, 2]) previously defined.

g2

Suppose we want to know how many (Subscript[K, 4]) subgraphs (Subscript[g, 2]) contains. We start with the list of its vertices.

V2= VertexList[g2]

Next, we form the set of all subsets of size four of this set.

S2=Subsets[V2,{4}]

Here is an example of a subset of vertices that generates a complete graph in (Subscript[g, 2]).

CompleteGraphQ[g2,{1,2,3,5}]

We now wish to repeat this calculation for all the subsets of size four.

tf=Table[CompleteGraphQ[g2,S2[[i]]],{i,Length[S2]}]

Finally, we count the number of times True occurs in tf.

Count[tf,True]

Let κ(g,r) be the number of complete subgraphs with r vertices contained in the graph g. The following program implements κ(g,r).

CountCompleteSubgraphs[g_,r_]:=Count[CompleteGraphQ[g,#]&/@Subsets[VertexList[g],{r}],True]

Let us count the number of times (Subscript[K, 3]), (Subscript[K, 4]) and (Subscript[K, 5]) occur in the graph (Subscript[g, 2]); that is, we calculate κ(g,3), κ(g,4) and κ(g,5).

CountCompleteSubgraphs[g2,#]&/@{3,4,5}

Bounding the Number of Complete Subgraphs of a Graph

Suppose we know that a certain graph g satisfies κ(g,3)≤19. Can we determine the maximum of κ(g,4)? Surely, g can have no (Subscript[K, 4]) subgraphs; that is, κ(g,4)=0, as in this example.

WheelGraph[20]

However, the example (Subscript[g, 2]) has been shown to have 19 (Subscript[K, 3]) subgraphs and 10 (Subscript[K, 4]) subgraphs.

In fact, we have shown in a joint paper [] that for all graphs g with κ(g,3)≤19, the maximum value of κ(g,4) is 10.

The following definition, due to Bollobás [], is useful in what follows.

Definition

If 2≤p≤r, then (Subscript[k, r])((Subscript[k, p])≤x) is the maximum number of (Subscript[K, r]) subgraphs that a graph can have if the number of its (Subscript[K, p]) subgraphs is less than or equal to x.

Thus, using this notation, we have shown in [] that (Subscript[k, 4])((Subscript[k, 3])≤19)=10.

A Closely Related Problem

Suppose now that the number of triangles a graph can have is fixed and we want to determine the graph with the fewest edges that can have that many triangles.

For example, suppose we want a graph having 23 triangles with the fewest possible edges. Our intuition is to look for graphs that are “tightly packed,” that is, as close to complete graphs as possible. (Subscript[K, 6]) has 20 triangles and (Subscript[K, 7]) has 35. So let us start by adding a vertex A to (Subscript[K, 6]) and then add three edges from A to three of the vertices of (Subscript[K, 6]). This adds (({{3}, {2}}))=3 new triangles.

h=EdgeAdd[VertexAdd[CompleteGraph[6,VertexLabels->Automatic],A],{A\[UndirectedEdge]1,A\[UndirectedEdge]2,A\[UndirectedEdge]3}]

CountCompleteSubgraphs[h,3]

CountCompleteSubgraphs[h,2]

That shows that a graph with 23 triangles can be gotten with just 18 edges. Is there a graph with fewer edges that has 23 (Subscript[K, 3]) subgraphs?

The next theorem is due to Erdös and Hanani (see []).

Theorem

If the number of edges is x=18, then since 18=(({{6}, {2}}))+(({{3}, {1}})), the theorem says that (Subscript[k, 3])((Subscript[k, 2])≤18)=(({{6}, {3}}))+(({{3}, {2}}))=23; that is, the maximum number of (Subscript[K, 3]) subgraphs in a graph with 18 edges is 23.

Is there a graph with fewer edges and 23 triangles? To answer this question, we can use the Erdös–Hanani theorem to compute the various maximum numbers of triangles with fewer edges. The program ErdösHanani gives the maximum number of triangles for a given number of edges, as determined by the Erdös–Hanani theorem; the table computes these values for edge numbers between three and 18.

ErdösHanani[x_]:= Module[
{s=2,t=1,x1}, 
While[Binomial[s,2]⩽x,s++];
s=s-1;
x1 = x-Binomial[s,2];
If[x1==0,t=0,t=x1];
Binomial[s,3]+Binomial[t,2]
]

Text@Grid[
Prepend[
Table[{i,ErdösHanani[i]},{i,3,18}],
{"  number\nof edges", " maximum\nnumber of\n  triangles"}
],
Alignment->Right,Dividers->{False,{False,True,False}}]

We see from the table that there is no graph with fewer than 18 edges having 23 triangles. Hence the fewest edges needed to produce a graph with exactly 23 triangles is indeed 18.

The Kruskal–Katona Bound

If we specify the number of triangles rather than the number of edges a graph can have, computing the maximum numbers of larger complete graphs is not as simple as in the previous section. Exact maximum numbers are not known in most cases, only upper bounds.

A well-known theorem of extremal graph theory (proved independently by Kruskal [] and Katona []) can provide an upper bound for κ(g,r), given κ(g,p), p<r. In fact, the Kruskal–Katona result is for more general objects than graphs, but we will only be using it for graphs and only when p=3; that is, we specify how many triangles a graph g can have and want to bound κ(g,r) for some r>3.

Theorem

For example, if the number of triangular subgraphs of g is 19=(({{5}, {3}}))+(({{4}, {2}}))+(({{3}, {1}})), then the Kruskal–Katona upper bounds for κ(g,4) and κ(g,5) are (({{5}, {4}}))+(({{4}, {3}}))+(({{3}, {2}}))=12 and (({{5}, {5}}))+(({{4}, {4}}))+(({{3}, {3}}))=3.

To use this theorem in Mathematica, we first need to express x as the binomial sum, x=(({{s}, {3}}))+(({{t}, {2}}))+(({{u}, {1}})). Given x, the function KK3 finds the numbers s, t, u.

KK3[x_]:=Module[
{s=3,t=2,u=1,x1},
While[Binomial[s,3]⩽x,s++];
s--;
x1=x-Binomial[s,3];
If[
x1==0,
t=1,
While[Binomial[t,2]⩽x1,t=t+1]
];
t--;
u=x1-Binomial[t,2];
{s,t,u}
]

KK3[19]

Next, we define the functions K4K3 and K5K3, the Kruskal–Katona upper bounds for κ(g,4) and κ(g,5), given that κ(G,3)=x.

K4K3[x_]:=Module[
{s,t,u},
{s,t,u}=KK3[x];
Binomial[s,4]+Binomial[t,3]+Binomial[u,2]
]

K5K3[x_]:=Module[
{s,t,u},
{s,t,u}=KK3[x];
Binomial[s,5]+Binomial[t,4]+Binomial[u,3]
]

Here are the results for 19 triangles.

{K4K3[19],K5K3[19]}

Thus, (Subscript[k, 4])((Subscript[k, 3])≤19)≤12 and (Subscript[k, 5])((Subscript[k, 3])≤19)≤3.

Here again is the graph (Subscript[g, 2]) with 19 triangles. It has 10 (Subscript[K, 4]) subgraphs and two (Subscript[K, 5]) subgraphs.

g2

CountCompleteSubgraphs[g2,#]&/@{3,4,5}

As mentioned, we proved in [] that (Subscript[k, 4])((Subscript[k, 3])≤19)=10 and (Subscript[k, 5])((Subscript[k, 3])≤19)=2.

Finding (Subscript[k, r])((Subscript[k, 3])≤x) exactly is often very difficult and results are not known in most cases. However, if there is a graph g with x triangles, x=(({{s}, {3}}))+(({{t}, {2}}))+(({{u}, {1}})) with κ(g,r)=(({{s}, {r}}))+(({{t}, {r-1}}))+(({{u}, {r-2}})) (the Kruskal–Katona bound), then (Subscript[k, r])((Subscript[k, 3])≤x)=κ(g,r). Complete graphs are obvious examples. Also, as remarked in [], if the number of triangles x=(({{s}, {3}}))+(({{t}, {2}})), we define the graph h by adding to (Subscript[K, s]) a single vertex A and t edges joining A to t vertices of (Subscript[K, s]); then (Subscript[k, r])((Subscript[k, 3])≤x)=κ(h,r)=(({{s}, {r}}))+(({{t}, {r-1}})) (the Kruskal–Katona bound). For example, suppose x=(({{7}, {3}}))+(({{4}, {2}}))=41. We construct such a graph, (Subscript[h, 1]).

h1=EdgeAdd[VertexAdd[CompleteGraph[7,VertexLabels->Automatic],A],{A\[UndirectedEdge]1,A\[UndirectedEdge]2,A\[UndirectedEdge]3,A\[UndirectedEdge]4}]

CountCompleteSubgraphs[h1,#]&/@{3,4,5}

{K4K3[41],K5K3[41]}

Thus, (Subscript[k, 4])((Subscript[k, 3])≤41)=39 and (Subscript[k, 5])((Subscript[k, 3])≤41)=22.

Next, we find those numbers of triangles for which this construction works; that is, the third entry in their binomial representation is 0.

thirdEntryZero[x_]:=Select[Range[x],KK3[#][[3]]==0&]

thirdEntryZero[100]

Also, it is not difficult to see that if x=(({{s}, {3}}))+(({{t}, {2}}))+(({{1}, {1}})), the Kruskal–Katona bound is the same as for (({{s}, {3}}))+(({{t}, {2}})) (since (({{1}, {w}}))=0 for w>1). So the list of the numbers of triangles x for which (Subscript[k, 4])((Subscript[k, 3])≤x) is known can be expanded. Here are the known values for the first 100 positive integers.

known=Union[thirdEntryZero[100],thirdEntryZero[100]+1]

This leaves the following numbers of triangles up to 100 still unknown.

unknown=Complement[Range[100],known]

We have in fact settled (see []) the cases x=9,15,18,19 (where (Subscript[k, 4])((Subscript[k, 3])≤x)=2,6,9,10, respectively). We add these cases to the list of the known values.

known'=Union[known ,{9,15,18,19}]

And these are the unknown values of (Subscript[k, 4])((Subscript[k, 3])≤x) for x≤100.

unknown'=Complement[Range[100],known']

We had started listing the integer sequence (Subscript[a, i])=(Subscript[k, 4])((Subscript[k, 3])≤i) (see []), and the preceding results can be used to add to this sequence; for example, the first term of the sequence, (Subscript[a, 4])=1 (when there are four triangles allowed, the graph has at most one (Subscript[K, 4])); the sequence continued up to (Subscript[a, 20])=15. Since we now know the consecutive values up to (Subscript[a, 24]), we can add four more consecutive values: (Subscript[a, 21])=15, (Subscript[a, 22])=15, (Subscript[a, 23])=16, (Subscript[a, 24])=16. Our conjecture in the next section implies that (Subscript[a, 25])=16. Other selected values of the sequence can obviously also be obtained, given that we know so many of the first 100 cases.

Almost Complete Graphs and Turan Graphs

We have used complete graphs in building the maximal examples. However, even if we remove an edge from a complete graph, the number of (Subscript[K, 4]) subgraphs in this new graph gr1 is the same as the Kruskal–Katona bound based on the number of (Subscript[K, 3]) subgraphs (calculated by K4K3[gr1]), as the following computation shows. (This can also be established with a simple argument that we omit.)

gr1[k_]:=EdgeDelete[CompleteGraph[k,VertexLabels->Automatic],{1\[UndirectedEdge]2}]

gr1[6]

Text@Grid[
Prepend[
Table[{k,CountCompleteSubgraphs[gr1[k],4],K4K3[CountCompleteSubgraphs[gr1[k],3]]},{k,5,15}],
{Style["k",Italic],Row[{"number of ",(Subscript[Style["K",Italic], 4]),"\n    subgraphs"}],Row[{" ",Style["K4K3","MCode"],"\nbound"}]}
],Alignment->Right,Dividers->{False,{False,True,False}}]

In fact, even if we remove several edges from a complete graph, as long as they share a common vertex, the number of (Subscript[K, 4]) subgraphs in the resulting graph g and the Kruskal–Katona bound (based on the number K4K3[g] of (Subscript[K, 3]) subgraphs) remain the same, as the reader can easily check with Mathematica. However, if we remove two edges that do not share a common vertex, this is no longer the case, as the following computations show.

DeleteTwoEdges[k_]:=EdgeDelete[CompleteGraph[k,VertexLabels->Automatic],{1\[UndirectedEdge]2,3\[UndirectedEdge]4}]

DeleteTwoEdges[7]

Text@Grid[
Prepend[
Table[{
k,
CountCompleteSubgraphs[DeleteTwoEdges[k],3],
CountCompleteSubgraphs[DeleteTwoEdges[k],4],
K4K3[CountCompleteSubgraphs[DeleteTwoEdges[k],3]]
},{k,6,15}],
{
Style["k",Italic],
Row[{Spacer[20],(Subscript[Style["K",Italic], 3]),"\nsubgraphs"}],
Row[{Spacer[20],(Subscript[Style["K",Italic], 4]),"\nsubgraphs"}],
Row[{" ",Style["K4K3","MCode"],"\nbound"}]
}
],
Alignment->Right,Dividers->{False,{False,True,False}}]

This time, the number of (Subscript[K, 4]) subgraphs is one less than the K4K3 upper bound! These graphs are also Turan graphs. The Turan graph T(n,k) is the graph formed by partitioning a set of n vertices into k subsets with sizes as equal as possible (differing by at most 1) and connecting two vertices by an edge if and only if they belong to different sets of the partition. The built-in Mathematica function TuranGraph[n,k] draws this graph. For example, T(n,k) partitions the vertices {1,2,3,4,5} into the subsets {1,2}, {3,4}, {5}; the edge 1<->2 is omitted since it would connect vertices in the same subset, {1,2}; 3<->4 is omitted since it would connect vertices in the same subset {3,4}.

TuranGraph[5,3,VertexLabels->Automatic]

The graphs T(k,k-2) are especially interesting to us as they are the same as the graphs DeleteTwoEdges[k], defined before. It may not be immediately apparent that TuranGraph[9,7] is the same graph as DeleteTwoEdges[9]; however, if we chose the right GraphLayout for the Turan graph, it becomes rather obvious.

TuranGraph[9,7,GraphLayout->"CircularEmbedding"]

In addition, IsomorphicGraphQ can always be used to check.

IsomorphicGraphQ[DeleteTwoEdges[9],TuranGraph[9,7]]

Therefore, for the Turan graph T(k,k-2), the actual number of (Subscript[K, 4]) subgraphs is just one less than the Kruskal–Katona bounds! Do these graphs provide the true maximum values of (Subscript[K, 4]) subgraphs based upon the number of their triangles? We conjecture below that they do for k>6. In addition, it is not hard to show that the number of triangles in T(k,k-2) is 4(k-4)+4(({{k-4}, {2}}))+(({{k-4}, {3}})). (This follows because the vertex sets of T(k,k-2) are {1,2}, {3,4}, {5}, {6}, …, {k}; then consider all possible ways of choosing three elements from these sets without choosing two elements from the same set.) This expression can be simplified.

Factor[4 (k-4)+4 Binomial[k-4,2]+Binomial[k-4,3]]

The sequence of these triangle numbers for the graphs T(k,k-2) is the same (with an offset) as the sequence A000297 in []. (We recently added a comment to this entry that mentions this.)

Conjecture

If k>6, the Turan graph T(k,k-2) has the maximum number of (Subscript[K, 4]) subgraphs for any graph with 1/6(k+3) (k-2) (k-4) triangles.

Finding Maximal Examples

Mathematica has a large database of graphs accessible with the function GraphData.

We wish to find maximal examples, that is, graphs that have the greatest number of (Subscript[K, 4]) subgraphs for their number of triangles. We make this precise with the following definition. A graph g is a (Subscript[K, 4])-maximal graph with respect to (Subscript[K, 3]) subgraphs if it has the greatest number of (Subscript[K, 4]) subgraphs for any graph with the same number of (Subscript[K, 3]) subgraphs (triangles) as g. We believe that these (Subscript[K, 4])-maximal graphs are “tightly packed” and thus have a relatively small number of vertices given their number of triangles. Suppose first we wish to find all the (Subscript[K, 4])-maximal graphs with exactly nine triangles. The Kruskal–Katona bound is three.

K4K3[9]

However, the maximal number of (Subscript[K, 4]) subgraphs is really two, that is, (Subscript[k, 4])((Subscript[k, 3])≤9)=2 (see []). We first look for examples in the set of nonisomorphic graphs with six vertices, that is, subgraphs of (Subscript[K, 6]).

GraphData[6]

Here is the first such graph.

GraphData@{6,12}

We apply GraphData to each entry to get the graphs themselves but suppress the large output.

graphdata6=GraphData/@GraphData[6];

Within those, we next search for graphs with nine triangular subgraphs. There is only one.

triangles[6,9]=Select[graphdata6,CountCompleteSubgraphs[#,3]==9&]

We attach labels to the vertices of this graph for later use.

gr2=Graph[EdgeList[First@triangles[6,9]],VertexLabels->Automatic]

This graph gr2 has two (Subscript[K, 4]) subgraphs.

CountCompleteSubgraphs[gr2,4]

Hence gr2 is a (Subscript[K, 4])-maximal example (see []).

This graph embedding is also extremal in another way; see [].

We search for examples in the set of graphs with seven vertices, using the command GraphData[7], which lists all non-isomorphic graphs with seven vertices. (If k>7, GraphData[k] only lists some of the graphs with k vertices). GraphData[7] has 1044 entries, so the result is not immediate.

graphdata7=GraphData/@GraphData[7];

There are 35 examples of graphs with seven vertices and nine triangular subgraphs.

triangles[7,9]=Select[graphdata7,CountCompleteSubgraphs[#,3]==9&];

Length[%]

To see the individual graphs, we use Mathematica’s built-in function Manipulate, where, in addition to the graph, the number of (Subscript[K, 4]) subgraphs of the graph is listed.

Manipulate[Text@Column[{Show[triangles[7,9][[u]],ImageSize->{250,250}],
Spacer[20],
Row[{"number of ",(Subscript[Style["K",Italic], 4])," = ",CountCompleteSubgraphs[triangles[7,9][[u]],4]}]
},Alignment->Center],
{{u,1,""},1,35,1,Appearance->"Labeled"},SaveDefinitions->True]

We suspect that one of the (Subscript[K, 4])-maximal graphs in triangles[7,9] is really a simple modification of the single (Subscript[K, 4])-maximal graph with six vertices found in GraphData[6]; that is, the graph plus an edge. (We obviously do not want to add a triangle!) Stepping through the Manipulate, graph number 22 is easily seen to be that graph.

g3=triangles[7,9][[22]]

We then add the edge A<->4 to the graph gr2 found in GraphData[6] and finally, use IsomorphicGraphQ to verify that they are indeed isomorphic.

gr3=EdgeAdd[VertexAdd[gr2,A],A\[UndirectedEdge]4]

IsomorphicGraphQ[g3,gr3]

Next, suppose we want to find the (Subscript[K, 4])-maximal graphs with 19 triangles. Although (Subscript[K, 6]) has (({{6}, {3}}))=20 triangles, if we remove even one edge from (Subscript[K, 6]), the resulting graph has only 16 triangles! Hence, there are no subgraphs of (Subscript[K, 6]) with exactly 19 triangles. However (Subscript[K, 7]) has (({{7}, {3}}))=35 triangles; thus it is reasonable to search GraphData[7] for examples.

triangles[7,19]=Select[graphdata7,CountCompleteSubgraphs[#,3]==19&]

Sometimes there are hidden edges in graph drawings in Mathematica; the graph in the middle is a case in point (the edge from the center top to center bottom vertices cannot be seen). We therefore redraw the graphs, setting the option GraphLayout.

Graph[EdgeList[#],VertexLabels->"Name",GraphLayout->"CircularEmbedding"]&/@triangles[7,19]

We now ask for the number of (Subscript[K, 4]) subgraphs and the number of (Subscript[K, 5]) subgraphs in these graphs.

CountCompleteSubgraphs[#,4]&/@triangles[7,19]

CountCompleteSubgraphs[#,5]&/@triangles[7,19]

Also, all three graphs have the same number of edges, 17.

CountCompleteSubgraphs[#,2]&/@triangles[7,19]

Thus, we have found three examples of graphs that illustrate our result of [], that (Subscript[k, 4])((Subscript[k, 3])≤19)=10.

We now ask what is the maximal number of (Subscript[K, 4]) subgraphs in a graph with 25 vertices. We again search for graphs with seven vertices and 25 triangles.

triangles[7,25]=Select[graphdata7,CountCompleteSubgraphs[#,3]==25&]

The one example we have found has 16 (Subscript[K, 4]) subgraphs, and the Kruskal–Katona bound for (Subscript[K, 4]) subgraphs is 17.

CountCompleteSubgraphs[triangles[7,25][[1]],4]

K4K3[25]

We investigate this graph further.

Graph[triangles[7,25][[1]],VertexLabels->Automatic,GraphLayout->"CircularEmbedding"]

This is the Turan graph T(7,5); edges 4<->6 and 5<->7 are missing from (Subscript[K, 7]). This can also be seen with the HighlightGraph function.

HighlightGraph[CompleteGraph[7,VertexLabels->Automatic],triangles[7,25][[1]]]

Since this is one of the Turan graphs and we have conjectured that they are (Subscript[K, 4])-maximal, we believe we have found a (Subscript[K, 4])-maximal example with 25 triangles.

Another example: Suppose we have a graph with 29 triangles. The Kruskal–Katona bound is 22.

K4K3[29]

A search in graphdata7 yields no graphs with 29 triangles. If we search in GraphData[8], we find one graph with 29 triangles. It has 16 (Subscript[K, 4]) subgraphs.

graphdata8=GraphData/@GraphData[8];

triangles[8,29]=Select[graphdata8,CountCompleteSubgraphs[#,3]==29&]

CountCompleteSubgraphs[triangles[8,29][[1]],4]

So it looks like the most (Subscript[K, 4]) subgraphs we can find for a graph with 29 triangles is 16. We can do better! For 26 triangles, since 26=(({{6}, {3}}))+(({{4}, {2}})), the Kruskal–Katona bound is (({{6}, {4}}))+(({{4}, {3}}))=19. Thus, if we add vertices A and B to (Subscript[K, 6]) and connect them to four and three vertices of (Subscript[K, 6]), respectively, we get a graph with 29 triangles and 20 (Subscript[K, 4]) subgraphs.

triangles[8,29]= EdgeAdd[VertexAdd[CompleteGraph[6,VertexLabels->Automatic],{A,B}],{A\[UndirectedEdge]1,A\[UndirectedEdge]2,A\[UndirectedEdge]3,A\[UndirectedEdge]4,B\[UndirectedEdge]1,B\[UndirectedEdge]2,B\[UndirectedEdge]3}]

{CountCompleteSubgraphs[triangles[8,29],3],CountCompleteSubgraphs[triangles[8,29],4]}

The graph triangles[8,29] has eight vertices, but it did not show up in GraphData[8], which has only 289 out of 12346 possible graphs. GraphData[7] contains all 1044 graphs with seven vertices.

A Larger Example

We have looked at examples with relatively few vertices, and these examples might give the impression that the Kruskal–Katona bounds do not differ significantly from the real values—so why expend so much effort trying to improve them? We construct a larger example to show that the difference can be quite large.

g4a=RandomGraph[{25,200}]

a4={CountCompleteSubgraphs[g4a,3],CountCompleteSubgraphs[g4a,4]}

Here is another example.

g4b=RandomGraph[{25,200}];b4={CountCompleteSubgraphs[g4b,3],CountCompleteSubgraphs[g4b,4]}

The Kruskal–Katona bound, however, usually yields more than twice as many (Subscript[K, 4]) subgraphs! More extreme examples can easily be constructed.

K4K3@*First/@{a4,b4}

Conclusion

There have been some efforts to improve the Kruskal–Katona bounds in the case of graphs (see, for example [] and []); however these have had very limited success. We feel that not enough insight into this problem has been gained and that perhaps by using computer experiments, conjectures can formulated and then proved to advance our knowledge in this area. For example, if we knew that a maximal (Subscript[K, 4]) example with 19 triangles must occur in a graph with seven vertices, our search of GraphData[7] would be sufficient to prove that the maximum number of (Subscript[K, 4]) subgraphs a graph with 19 (Subscript[K, 3]) subgraphs can have is 10. We succeeded in proving this result in [] without using computers, but only with a great deal of effort.

To read more on using Mathematica’s graph theory capability to investigate other maximal problems in graph theory, see [] and [].

Acknowledgement

I wish to thank the editor, whose sage advice substantially improved this paper’s programing and content.

References

R. Cowen and W. Emerson, “On Finding (Subscript[k, 4])((Subscript[k, 3])≤x),” Graph Theory Notes, New York Academy of Sciences, 34, 1998 pp. 26–30. www.researchgate.net/publication/287991696_On_Finding_k4k3_x.

B. Bollobás, “Relations between Sets of Complete Subgraphs,” Proceedings of the Fifth British Combinatorial Conference, Aberdeen, 1975 pp. 79–84. www.researchgate.net/publication/268543809_Relations_between_sets_of_complete_subgraphs.

P. Erdös, “On the Number of Complete Subgraphs Contained in Certain Graphs,” Publications of the Mathematics Institute of the Hungarian Academy of Sciences, 7, 1962 pp. 459–464.

J. Kruskal, “The Number of Simplices in a Complex,” Mathematical Optimization Techniques (R. Bellman, ed.), Berkeley: University of California Press, 1963 pp. 251–278.

G. Katona, “A Theorem of Finite Sets,” The Theory of Graphs (P. Erdös, ed.), Budapest: Akadémia Kiadó, 1968 pp. 187–207.

N. J. A. Sloane. The Online Encyclopedia of Integer Sequences. oeis.org/A020917.

N. J. A. Sloane. The Online Encyclopedia of Integer Sequences. oeis.org/A000297.

E. W. Weisstein. “Graham’s Biggest Little Hexagon” from MathWorld—A Wolfram Web Resource. mathworld.wolfram.com/GrahamsBiggestLittleHexagon.html.

A. Frohmader, “A Kruskal–Katona Type Theorem for Graphs.” arxiv.org/abs/0710.3960.

E. W. Weisstein. “Cage Graph” from MathWorld—A Wolfram Web Resource. mathworld.wolfram.com/CageGraph.html.

E. W. Weisstein. “Degree-Diameter Problem” from MathWorld—A Wolfram Web Resource. mathworld.wolfram.com/Degree-DiameterProblem.html.

Robert Cowen
16422 75th Avenue
Fresh Meadows, NY 11366
robert.cowen@gmail.com