Many classical theorems in extremal graph theory concern the maximum number of copies of a fixed graph in an -vertex graph in some class . Here, a copy means a subgraph isomorphic to . For example, Turán’s Theorem determines the maximum number of copies of (that is, edges) in an -vertex -free graph . More generally, Zykov’s Theorem determines the maximum number of copies of a given complete graph in an -vertex -free graph . The excluded graph need not be complete. The Erdős–Stone Theorem  determines, for every non-bipartite graph , the asymptotic maximum number of copies of in an -vertex graph with no -subgraph. Analogues of the Erdős–Stone Theorem for copies of have recently been studied by Alon and Shikhelman [5, 4]. See [49, 3, 65, 25, 26, 32, 21, 24, 48, 54] for recent related results.
This paper studies similar questions when the class consists of the graphs that embed111See  for background about graphs embedded in surfaces. For , let be the sphere with handles. For , let be the sphere with cross-caps. Every surface is homeomorphic to or . The Euler genus of is . The Euler genus of is . A graph is a minor of a graph if a graph isomorphic to can be obtained from a subgraph of by contracting edges. If embeds in a surface , then every minor of also embeds in . in a given surface (rather than being defined by an excluded subgraph). For a graph and surface , let be the maximum number of copies of in an -vertex graph that embeds in . This paper determines the asymptotic behaviour of as for any fixed surface and any fixed graph .
Before stating our theorem, we mention some related results that determine for specific planar graphs where the surface is the sphere . Alon and Caro  determined precisely if is either a complete bipartite graph or a triangulation without non-facial triangles. Hakimi and Schmeichel  studied where is the -vertex cycle; they proved that and . See [34, 35] for more results on and see  for more results on . Győri et al.  proved that (except for ). Győri et al.  determined precisely, where is the -vertex path. Alon and Caro  and independently Wood  proved that . More generally, Wormald  proved that if is a fixed 3-connected planar graph then . This result was independently proved by Eppstein , who noted the converse also holds: If is planar and then has no -separation.
Eppstein  asked the following two open problems:
Characterise the subgraphs occurring times in graphs of given genus.
Characterise the subgraphs occurring a number of times which is a nonlinear function of .
This paper answers both these questions (and more).
We start with the following natural question: when is bounded by a constant depending only on and (and independent of )? We prove that being 3-connected and non-planar is a sufficient condition. In fact we prove a stronger result that completely answers the question. We need the following standard definitions. A -separation of a graph is a pair of edge-disjoint subgraphs of such that , , , and . A -separation for some is called a -separation. If is a separation of with , then let and be the simple graphs obtained from by removing and adding all edges between vertices in , respectively.
A graph is strongly non-planar if is non-planar and for every -separation of , both and are non-planar. Note that every 3-connected non-planar graph is strongly non-planar. The following is our first main contribution. It says that is bounded if and only if is strongly non-planar.
There exists a function such that for every strongly non-planar graph with vertices and every surface of Euler genus ,
Conversely, for every graph that is not strongly non-planar and for every surface in which embeds, there is a constant such that for all , there is an -vertex graph that embeds in and contains at least copies of ; that is, .
There are two striking observations about Theorem 1.1. First, the characterisation of graphs does not depend on the surface . Indeed, the only dependence on is in the constants. Second, Theorem 1.1 shows that is either bounded or .
Theorem 1.1 is in fact a special case of the following more general theorem. The next definition is a key to describing our results. A flap in a graph is a -separation such that is planar. Separations and of are independent if and . If is not -connected, then the flap-number of is defined as the maximum number of pairwise independent flaps in . If is -connected, then its flap-number is if is non-planar, and if is planar. Let denote the flap-number of .
For every graph and every surface in which embeds,
It is immediate from the definitions that a graph is strongly non-planar if and only if . So Theorem 1.1 follows from the cases of Theorem 1.2. As an aside, note that Theorem 1.2 can be restated as follows: for every graph and every surface in which embeds,
The lower bound in Theorem 1.2 is proved in Section 2. Section 3 introduces some tools from the literature that are used in the proof of the upper bound. Theorem 1.1 is proved in Section 4. The upper bound in Theorem 1.2 is then proved in Section 5. Section 6 presents more precise bounds on when is a complete graph . Section 7 considers the maximum number of copies of a graph in an -vertex graph in a given minor-closed class. Section 8 reinterprets our results in terms of homomorphism inequalities, and presents some open problems that arise from this viewpoint.
Before continuing, to give the reader some more intuition about Theorem 1.2, we now asymptotically determine for a tree .
For every fixed tree , let be the size of a maximum stable set in the subforest of induced by the vertices with degree at most . Then for every fixed surface ,
By Theorem 1.2, it suffices to show that .
Let be a maximum stable set in . Let (and possibly ) be the neighbours of . Let and . Then is a flap of . Since is a stable set, for each neither nor are in , implying that for distinct . Moreover, , so for all distinct . Hence are pairwise independent flaps in . Thus . Theorem 1.2 then implies that . This lower bound is particularly easy to see when is a tree. Let be the graph obtained from by replacing each vertex by vertices with the same neighbourhood as , as illustrated in Section 1. Then is planar with at most vertices and at least copies of . Thus for fixed .
For the converse, let be pairwise independent flaps in . Choose to minimise . A simple case-analysis shows that , and if is the vertex in , then , implying has degree 1 or 2 in . Moreover, for distinct as otherwise . Hence is a stable set of vertices in all with degree at most 2. Hence . ∎
2. Lower Bound
Now we prove the lower bound in Theorem 1.2. Let be an -vertex graph with flap-number . Let be a surface in which embeds. Our goal is to show that for all . We may assume that and is connected. Let be pairwise independent flaps in . If is a 1-separation, then let be the vertex in . If is a 2-separation, then let and be the two vertices in . Let be obtained from as follows: if is a 2-separation, then delete from , and add the edge (if it does not already exist). Note that is a minor of , since we may assume that whenever is a 2-separation, there is a -path in (otherwise can be replaced by a -separation). Since embeds in , so does . By assumption, is planar for each . Fix an embedding of with and (if it exists) on the outerface (which exists since is an edge of in the case of a 2-separation). Let be the graph obtained from an embedding of in by pasting copies of onto (if is a 1-separation) and onto (if is a 2-separation). These copies of can be embedded into a face of , as illustrated in Figure 2.
Since for distinct ,
By construction, has at least copies of . Hence .
Theorem 3.1 ().
There exists a function such that for every planar graph with vertices and no -separation, and every surface of Euler genus ,
For all graphs and , if then the Euler genus of is at least the Euler genus of plus the Euler genus of .
We also use the following result of Erdős and Rado ; see  for a recent quantitative improvement. A -sunflower is a collection of sets for which there exists a set such that for all distinct . The set is called the kernel of .
Lemma (Sunflower Lemma ).
There exists a function such that every collection of many -subsets of a set contains a -sunflower.
Finally, we mention some well-known corollaries of Euler’s Formula that we use implicitly. Every graph with vertices and Euler genus has at most edges. Moreover, for bipartite graphs the above bound is . For example, this implies that the complete bipartite graph has Euler genus greater than .
4. Strongly Non-Planar Graphs
Now we prove the following quantitative version of the upper bound in Theorem 1.1.
For every strongly non-planar graph with vertices, for every surface with Euler genus , if then .
Let be the multiset of the vertex sets of all the copies of in . Assume for the sake of contradiction that . Since there are at most copies of on each -subset of vertices of , there is a subset of of size such that all members of are distinct. By the Sunflower Lemma, contains a -sunflower . Let be the kernel of . Thus for all distinct copies and of in .
Let be the components of the subgraphs of obtained by deleting from each copy of in . Since , . Therefore, each copy of contributes at least one such component. Thus . Since is the kernel, are pairwise disjoint.
Suppose that at least of the have at most one neighbour in . Since is strongly non-planar, these are non-planar, and by the additivity of Euler genus on ()-separations (Theorem 3.2), has Euler genus at least , which is a contradiction. Now assume that at most of the have at most one neighbour in .
Suppose that more than of the have exactly two neighbours in . Then at least of the have the same two neighbours . Label these by . Let be obtained from by contracting to form an edge on . For each , let be the subgraph of induced by , including the edge . By the definition of strongly non-planar, each is non-planar. By Theorem 3.2 again, and thus has Euler genus at least , which is a contradiction since is a minor of . Thus at most of the have exactly two neighbours in .
Suppose that more than of the have at least three neighbours in . Then at least of the have the same three neighbours in . Contract each such to a single vertex, to obtain a minor of , which is a contradiction. Now assume that at most of the have at least three neighbours in .
Thus , which is a contradiction. ∎
5. Proof of Main Theorem
The proof of our main theorem uses a variant of the SPQR tree, which we now introduce.
5.1. SPQRK Trees
The SPQR tree of a -connected graph is a tree that displays all the -separations of . Since we need to consider graphs which are not necessarily -connected, we use a variant of the SPQR tree which we call the SPQRK tree.
Let be a connected graph. The SPQRK tree of is a tree, where each node is associated with a multigraph which is a minor of . Each vertex is a vertex of , that is, . Each edge
is classified either as areal or virtual edge. By the construction of an SPQRK tree each edge appears in exactly one minor as a real edge, and each edge which is classified real is an edge of . The SPQRK tree is defined recursively as follows.
If is -connected, then consists of a single -node with . All edges of are real in this case.
If is a cycle, then consists of a single -node with . Again, all edges of are real in this case.
If is isomorphic to or , then consists of a single -node with . Again, all edges of are real in this case.
If is -connected and has a cutset such that the vertices and have degree at least , we construct inductively as follows. Let () be the connected components of . First add a -node to , for which is the graph with consisting of parallel virtual edges and one additional real edge if is an edge of .
Next let be the graph with the additional edge if it is not already there. Since we include the edge , each is -connected and we can construct the corresponding SPQRK tree by induction. Let be the (unique) node in for which is a real edge in . In order to construct , we make a virtual edge in the node , and connect to in .
If has a cut-vertex and () are the connected components of , then construct inductively as follows. First, add a -node to , for which is the graph consisting of the single vertex . For each , let . Since is connected, we can construct the corresponding SPQRK tree by induction. If there is a unique node such that , then make adjacent to in . If is in at least two nodes of , then for some -separation of . Since is connected, there must be a -node in such that . Note that is not necessarily unique. Choose one such and make adjacent to in .
As a side remark, note that the SPQRK tree of is in fact not unique—there is some freedom in choosing in the last point in the definition above—however, for our purposes we do not need uniqueness, we only need that displays all the -separations of .
The next lemma is the crux of the proof. Let and be graphs and and be cliques in and respectively, with . Let be a copy of in . We say that fixes at if there is an isomorphism such that .
There exists a function with the following property. Let be a surface of Euler genus . Let be a clique with in a planar graph with vertices, such that there does not exist independent flaps and of with . Then for every -vertex graph embeddable in and every clique in with , there are at most copies of in with fixed at .
Let be an -vertex graph embedded in a surface of Euler genus and be a clique in with . Let be the property that there do not exist independent flaps and of with . If , then implies that has no -separation. Thus, we are done by Theorem 3.1. Henceforth, we may assume that .
Suppose is a -separation of with . If , then is a -separation of , where is obtained from by adding the vertices of as isolated vertices. Therefore, and contradict . Thus, . If is a -separation of , then and are two -separations of contradicting . Hence, has no -separations. Since , the number of copies of in with fixed at is at most twice the number of copies of in (since there at most two ways of fixing at ). By Theorem 3.1, this is at most . Thus, we may assume that is connected.
Let be the SPQRK tree of . Suppose . If is a -node, then there are at most copies of in . If is an -node, then there are at most copies of in . If is an -node and , then . If is an -node and , then or . In either case, there is a unique maximal clique of with and . Since there at most choices for , there are at most copies of in with fixed at . We may therefore assume . Moreover, by the above argument we may also assume .
Let be the set of -, -, and -nodes of . Let be a non-empty proper subset of . Define , , , and . The next two claims follow from .
is a path such that and for some leaf of .
Let be the other leaf of . Then for all non-empty such that is not a single -node, .
The next claim also follows from . For completeness, we include the proof.
Let . Then , , and if , then the two vertices in are adjacent in .
Since , for each , is a flap with , where is the subgraph of induced by the edges incident to . Thus, by , is a clique in , and therefore . Moreover, is impossible, since and is connected. Thus, . Since is a flap with , also implies . ∎
By Claim 5.1, there exists an edge such that . Among all such edges, choose so that is minimum.
For all , there are three internally disjoint paths in from to , whose ends in are distinct.
Suppose not. By Menger’s theorem, there is a -separation of with and . Since , for all , it follows that for some or contains a cut-vertex of . Suppose the former holds. Since , we have . This is a contradiction since by Claim 5.1. Thus, contains a cut-vertex of . Let be the -separation of with , and .
For all , let . We claim that for all ,
The first inequality is immediate since is a -separation and is a -separation. For the second inequality, consider a vertex . By definition, ; and or . If , then ; and if , then . Thus, each vertex that is counted on the RHS is also counted on the LHS. Moreover, if is counted twice on the RHS, then . Thus, is also counted twice on the LHS.
Since for all , we have for all .
We say that is proper if and . Thus, if is proper, then is a -separation. Since , at most one of , and is proper by .
Suppose is proper. Thus, neither nor are proper. Since , this implies and . Let . Note that , since . Also, or , since . First suppose that . Then , because . Since , we deduce that . Hence, , contradicting