arXiv:2106.06827v2 [math.CO] 22 Sep 2021 n emnlg o endhr,w ee h edrt [2]. to reader the refer we here, defined not terminology any steodro ags needn no fciusin cliques of union independent largest a of order the is by and n imtradlretpsil eea oiinnumber. position Keywords: general gr possible the largest classify we and Finally diameter number. and possible position the monophonic characterise and and Tur´an order numbers given a proble position monoph solve and then and We order general given result. given with realisation with a graph to ‘geodesic’. a applications of First of with order place parameters. possible in these smallest path’ for the ‘induced problems with extremal but some similarly, investigate defined is graph a ihnihorodta nue lqein clique a induces that neighbourhood with G n w vertices two any path a called is Introduction 1. graph a of number position general The Abstract ogoei of geodesic no 00MSC: 2000 path. h ags lqein clique largest the H onThomas), John fDdny[1.Ti rbe a nrdcdi h otx fgraph of context the in introduced was problem This [11]. Dudeney of rpitsbitdt Elsevier to submitted Preprint b ilb eoe by denoted be will eateto ahmtc,MrIaisClee Universit College, Ivanios Mar Mathematics, of Department of l h eea oiinpolmfrgah a etae akt one to back traced be can graphs for problem position general The nti ae l rpswl etknt esml n nietd The undirected. and simple be to taken be will graphs all paper this In mi addresses: Email ( v G a monophonic G eateto ahmtc n ttsis pnUniversity Open Statistics, and Mathematics of Department nagraph a in .Asubgraph A ). uhta vr opnn of component every that such geodesic 51,0C5 05C69 05C35, 05C12, eea oiin oohncpsto,Tra rbes ie diam size, Tur´an problems, position, monophonic position, general c eateto ahmtc,MhtaGnh olg,Univer College, Mahatma Mathematics, of Department [email protected] nsm xrmlpsto rbesfrgraphs for problems position extremal some On G ae Tuite James otismr hntoeeet of elements two than more contains ,v u, h ubro evs(rpnatvrie)o graph a of vertices) pendant (or leaves of number The . G [email protected] nidcdpt sapt ihu n hrs ewl locl uha such call also will we chords; any without path a is path induced An . G stelnt ftesots ahin path shortest the of length the is n of H An . n t ieby size its and H of seult h distance the to equal is G needn no fcliques of union independent hrvnnhprm650,Krl, , -695004, a san is la onThomas John Elias , UlsCada .V.) S. Chandran (Ullas smti subgraph isometric m H The . G eaa India Kerala, saciu.The clique. a is JmsTuite), (James stesz ftelretsto vertices of set largest the of size the is G lqenumber clique h distance The . b d la hnrnS V. S. Chandran Ullas , G S ( fKrl,Thiruvananthapuram-695015, Kerala, of y ,v u, h oohncpsto ubrof number position monophonic The . ftedistance the if [email protected] nagraph a in atnHl,Mlo ens UK Keynes, Milton Hall, Walton , G G ewe hs etcsin vertices these between ) needn lqenumber clique independent An . from ω ( d G ( yw ics h rbe of problem the discuss we ly ,v u, fagraph a of ) u extreme G iyo Kerala, of sity to imtr fgah with graphs of diameters ewe w vertices two between ) o h ieo graphs of size the for m sa nue subgraph induced an is ncpsto numbers, position onic d v pswt ie order given with aphs H hoyindependently theory ftemn puzzles many the of n hretpath shortest a and ( ,v u, G re ftegraph the of order etxi vertex a is vertex c etme 3 2021 23, September nti ae we paper this In G ilb denoted be will in ) steodrof order the is tr induced eter, S H uhthat such between G (Elias α For . ω ( G u ) by several authors [5, 13, 15]. A set S of vertices of a graph G is in general position if no geodesic of G contains more than two points of S; in this case S is a general position set, or, for short, a gp-set. The general position problem asks for the largest possible size of a gp-set for a given graph G; this number is denoted by gp(G). This problem has applications in navigation in networks [15], social sciences [22] and the study of social networks [3]. An excellent monograph on the subject is [18]. In such works as [9, 10, 18] various problems in geodetic convexity in graphs were gen- eralised to monophonic paths. In the same spirit, in the paper [20] the present authors introduced a parameter defined similarly to the gp-number, but with ‘shortest path’ replaced by ‘induced path’. We say that a set S of vertices in a graph G is in monophonic position if there is no monophonic path in G that contains more than two elements of S. A set satisfy- ing this condition is called a monophonic position set or simply an mp-set. It was shown in [5, 20] that the mp- and gp-numbers of trees have a particularly simple form. Theorem 1.1. [5, 20] For any tree T we have mp(T ) = gp(T )= l(T ). In this paper we consider several extremal problems for mp- and gp-sets. In [20] it was shown that for any a, b ∈ N there exists a graph with mp-number a and gp-number b if and only if 2 ≤ a ≤ b or a = b = 1. In Section 2 we discuss the problem of finding the smallest possible order of a graph with given mp- and gp-numbers. We then apply the resulting constructions to give a partial answer to the following realisation question: for which n, a, b ∈ N does there exist a graph G with mp(G)= a, gp(G)= b and order n? In Section 3 we introduce the Tur´an-type problem of the largest possible size of a graph with given order and mp-number. We solve this problem asymptotically and present exact values for mp-number two, along with a classification of the extremal graphs. In Section 4 we consider the problem of the possible diameters of graphs with given order and mp-number. Finally in Section 5 we characterise the graphs with given order and diameter and largest possible general position number.

2. The smallest graph with given mp- and gp-numbers In a previous paper [20] the authors proved the following realisation theorem. Theorem 2.1. For all a, b ∈ N there exists a graph with mp-number a and gp-number b if and only if 2 ≤ a ≤ b or a = b =1. Continuing this line of investigation, it is interesting to ask for which values of a, b, n ∈ N there exists a graph G with mp(G)= a, gp(G)= b and order n? In fact this question largely reduces to an extremal problem: what is the smallest order of a graph with mp-number a and gp-number b? Having found a small graph with order n and given mp- and gp-numbers, we can typically use the following lemma to derive graphs with the same mp- and gp-numbers and any larger order n′ ≥ n. Lemma 2.2. [20] Let G′ be a graph obtained from G by adding a pendant vertex u to a vertex v in G. If v is an extreme vertex in G, then mp(G) = mp(G′). Corollary 2.3. If there exists a graph G with order n, mp(G) = a and gp(G) = b with an optimal mp-set M and an optimal gp-set K such that there is an extreme vertex v ∈ M ∩ K, then for any n′ ≥ n there exists a graph G′ with order n′, mp(G′)= a and gp(G′)= b.

2 x

c1 c2 c3 c4

b1 b2 b3 b4

a1 a2 a3 a4

Figure 1: Pag(4) with the monophonic path P1,2 in blue

Proof. Suppose that there exists a graph G with mp(G) = a and gp(G) = b and order n and that there exist maximal mp- and gp-sets M and K such that M ∩ K is non-empty and contains an extreme vertex v of G. By Lemma 2.2, if we add a leaf to v then the resulting graph G′ has the same mp- and gp-number as G and order n+1. The new leaf in G′ is also an extreme vertex and by [20] there are largest mp- and gp-sets of G′ containing v; therefore we can repeatedly add leaves by Lemma 2.2 to construct a graph with mp-number a, gp-number b and any order n′ ≥ n. In order to study this extremal problem we make the following definition.

Definition 2.4. For all a, b ∈ N such that 2 ≤ a ≤ b the order of the smallest graph G with mp(G)= a and gp(G)= b will be denoted by µ(a, b).

By the result of [20] the notation µ(a, b) is well-defined for 2 ≤ a ≤ b. We introduce three families of graphs that will give strong upper bounds on µ(a, b); the pagoda graphs P ag(r), the chalice graphs C(r, s, t) and the mask graphs Mas(r, s). We first observe that for a ≥ 2 the complete graph Ka has mp(Ka) = gp(Ka)= a and is obviously the smallest graph with these parameters, so that µ(a, a)= a for all a ≥ 2.

Lemma 2.5. For each r ≥ 3, there exists a graph with order n =3r +1, mp-number 2 and gp-number 2r and a graph with order n =3r, mp-number 2 and gp-number 2r − 1.

Proof. For r ≥ 3 we define the pagoda graph P ag(r) as follows. The vertex set of P ag(r) consists of three sets A = {a1, a2,...,ar}, B = {b1,...,br},C = {c1,...,cr} of size r and an additional vertex x. The adjacencies of P ag(r) are defined as follows. For 1 ≤ i ≤ r we set bi to be adjacent to aj and cj for j =6 i. Also every vertex in C is adjacent to x. An example P ag(4) is illustrated in Figure 1. For r ≥ 3 we will also denote the graph P ag(r) −{ar} ′ formed by deleting the vertex ar by P ag (r). The order of P ag(r) is n =3r + 1. We now show that for r ≥ 3 we have mp(P ag(r))=2 and gp(P ag(r))= 2r. Trivially any two vertices constitute an mp-set and A ∪ C is a gp-set of size 2r. It therefore suffices to show that mp(P ag(r)) ≤ 2 and gp(P ag(r)) ≤ 2r.

3 For a contradiction, let M be an mp-set in P ag(r) with size ≥ 3. For 1 ≤ i, j ≤ r and i =6 j let Pi,j be the monophonic path ai, bj,ci,x,cj, bi, aj. The existence of this path shows that if x ∈ M, then M cannot contain two other vertices of P ag(r), so we can assume that x 6∈ M. Suppose that M contains two vertices from the same ‘layer’ A, B or C. For the sake of argument say a1, a2 ∈ M; the other cases are similar. The path P1,2 shows that b1, b2,c1,c2 6∈ M. If another element of A, say a3, belonged to M, then we would have the monophonic path a1, b2, a3, b1, a2, a contradiction. For 3 ≤ i ≤ r the path a1, bi, a2 is trivially monophonic, so M ∩B = ∅. It follows that there must be a point ci ∈ M for some 3 ≤ i ≤ r. However a1, b2,ci, b1, a2 is a monophonic path, another contradiction. As M cannot contain ≥ 3 points of P ag(r) we obtain the necessary inequality. Now assume that K is any gp-set in P ag(r) with size ≥ 2r. For 1 ≤ i, j, k ≤ r, j 6∈ {i, k}, let Qi,j,k be the geodesic ai, bj,ck, x. Suppose that x ∈ K. If also K ∩ C =6 ∅, say c1 ∈ K, then as c1,x,ci is a geodesic for 2 ≤ i ≤ r, it follows that K ∩{c2,...,cr} = ∅. Also, letting j 6∈ {1, i} in the path Qi,j,1 also shows that K ∩ A = K ∩ (B −{b1})= ∅, so that we would have |K| ≤ 3 < 2r. Hence K ∩C = ∅. Furthermore if some bj lies in K, then for 1 ≤ i, k ≤ r and j 6∈ {i, k} the geodesic Qi,j,k contains x, bj and ai, so that we would have K ⊆ B ∪{ai, x} and |K| ≤ r +2 < 2r. Therefore K ⊆ A ∪{x} and |K| ≤ r +1 < 2r. Therefore x is not contained in any gp-set of P ag(r) of size ≥ 2r. Suppose now that K ∩ B =6 ∅, say b1 ∈ K. For 2 ≤ i, k ≤ r the existence of the geodesic Qi,1,k shows that K cannot intersect both A −{a1} and C −{c1}. Therefore if |K| ≥ 2r + 1, K must either have the form A ∪ B ∪{c1} or {a1} ∪ B ∪ C; however, a1, b2,c1 is a geodesic that contains three points from both of these sets. It follows that |K| ≤ 2r. Furthermore, if |K ∩ B| ≥ 2, say b2 ∈ K, then K ∩ ((A −{a1, a2}) ∪ (C −{c1,c2})) = ∅ and also K cannot contain both ai and ci for i = 1, 2, so that |K| would be bounded above by r + 2, which is strictly less than 2r, whereas if K contains a unique vertex of B, then again |K| ≤ r + 2; therefore A ∪ C is the unique gp-set in P ag(r) with size 2r. The optimal gp-set in P ag(4) is shown in Figure 2. ′ In a similar fashion it can be shown that the graphs P ag (r)= P ag(r) −{ar} have order 3r, mp-number 2 and gp-number 2r − 1 for r ≥ 3. We will now define our second family of graphs. We need a result from [20] on the mp- and gp-numbers of the join of graphs. Lemma 2.6. [20] The monophonic and general position numbers of the join G ∨ H of graphs G and H is related to the monophonic and general position numbers of G and H by

mp(G ∨ H) = max{ω(G)+ ω(H), mp(G), mp(H)} and gp(G ∨ H) = max{ω(G)+ ω(H),αω(G),αω(H)}. For r, s, t ≥ 0 we define T (r, s, t) to be the starlike tree that has r branches of length one, s branches of length two and one branch of length t; in other words, T (r, s, t) is the tree containing a vertex x such that T (r, s, t) − x consists of r copies of K1, s copies of K2 and one copy of Pt, where Pt is the path of length t − 1. We use T (r, s, t) as a ‘base graph’. We define the graph C(r, s, t) to be the join T (r, s, t) ∨ K1, where K1 is a complete graph with vertex set {y}. If t = 0 we will write C(r, s) for C(r, s, 0).

4 Figure 2: The optimal gp-set in Pag(4)

Lemma 2.7. If t ≥ 1 and r + s ≥ 2, then C(r, s, t) has order n = r +2s + t +2 and we have t mp(C(r, s, t)) = r + s +1 and gp(C(r, s, t)) = r +2s + t − ⌊ 3 ⌋. Also if r + s ≥ 3, then C(r, s) has order r +2s +2 and mp(C(r, s)) = r + s and gp(C(r, s)) = r +2s.

Proof. By Theorem 1.1 we have mp(T (r, s, t)) = r + s + 1 if t ≥ 1 and mp(T (r, s, 0)) = r + s. Therefore by Lemma 2.6 if r + s + t ≥ 1 we obtain

mp(C(r, s, t)) = mp(T (r, s, t) ∨ K1) = max{3,r + s +1} if t ≥ 1 and similarly mp(C(r, s)) = max{3,r + s}. Therefore if t ≥ 1 and r + s ≥ 2 then mp(C(r, s, t)) = r + s + 1 and if r + s ≥ 3 then mp(C(r, s)) = r + s. As αω(T (r, s, t)) = t r +2s + t − ⌊ 3 ⌋, the result for the gp-number follows in a similar fashion. Our third family does not provide better bounds than those in Lemma 2.7; however, we will see that they provide a distinct family of extremal graphs of independent interest.

2b Lemma 2.8. For all a and b such that 3 ≤ b, 3 ≤ a < b there exists a graph G with mp(G)= a, gp(G)= b and order n = b +2.

r Proof. Let s ≥ ⌊ 2 ⌋. We define a graph Mas(r, s) as follows. Let R be a set of r vertices ′ ′′ ′ and draw the complete graph Kr on R. Divide R into two parts R and R , where |R | = r ′′ r ∅ ⌈ 2 ⌉, |R | = ⌊ 2 ⌋. Let S be an independent set with S ∩ R = and |S| = s. Introduce two new vertices x, y and connect x to every vertex in S ∪ R′ and y to every vertex in S ∪ R′′. The order of Mas(r, s) is n = r + s + 2. The graph Mas(6, 5) is shown in Figure 5. As vertices in S are twins and vertices in R′ are adjacent twins, it is easily seen that ′ r S ∪ R is an mp-set in Mas(r, s). It follows that mp(Mas(r, s)) ≥ s + ⌈ 2 ⌉. We show that r this mp-set is optimal. Suppose that M is an mp-set in Mas(r, s) containing ≥ s + ⌈ 2 ⌉ +1 vertices. If M contains x, then M can contain points in at most one of the sets S, R′, R′′, so r r |M| ≤ 1 + max{s, ⌈ 2 ⌉} ≤ s + ⌈ 2 ⌉. Similarly M cannot contain y. M does not intersect all three of S, R′ and R′′, as any such three points are connected by a monophonic path, so that r r again |M| ≤ s + ⌈ 2 ⌉. Therefore mp(Mas(r, s)) = s + ⌈ 2 ⌉.

5 Figure 3: C(0, 4, 5) with an optimal gp-set in red

Figure 4: C(1, 4) with an optimal gp-set in red

6 Figure 5: Mas(6, 5) with an optimal mp-set in red

The only geodesics between two elements of S or a vertex of S and a vertex of R have length two and pass through x or y. Also the distance between vertices in R is one. It follows that R ∪ S is in general position and it is clear that Mas(r, s) can contain no larger gp-set. Thus gp(Mas(r, s)) = r + s. For given a, b in the above range setting r = 2(b − a) and s =2a − b yields the required graph. We first prove a lower bound that shows that the graphs with order b + 2 from Lemmas 2.7 and 2.8 are extremal. Lemma 2.9. For 2 ≤ a < b we have µ(a, b) ≥ b +2. Proof. Suppose that a = mp(G) < gp(G) = b and that G has order n. As b > a, G is not a complete graph and so n ≥ b +1. Let K be a gp-set with order b. As a =6 b there must exist vertices x, y, z ∈ K such that there exists a monophonic x, z-path passing through y; let P be the shortest such path in G. As P is monophonic, there is no edge from x to z and thus d(x, z) ≥ 2. Any geodesic contains at most two points of K, so if d(x, z) ≥ 3, then this geodesic would contain at least two vertices outside of K and n ≥ b + 2, so we can assume that d(x, z) = 2. As P is not a geodesic, the length of P is at least three. We chose P to be a shortest monophonic path containing three points of K, so P must contain a vertex outside of K. As P is induced, the x, z geodesic is internally disjoint with P and we have exhibited at least two vertices of G not lying in K. Table 1 shows the values of µ(a, b) for some small a and b. This data is the result of computational work by Erskine [12]. In cases for which a complete list of graphs with mp- number a, gp-number b and order µ(a, b) have been obtained the number of such graphs is also indicated. The graphs with b ≥ 9 are deduced from the cases in which the lower bound in Lemma 2.9 matches the upper bound from Lemmas 2.7 and 2.8. These three constructions between them yield the following upper bounds on µ(a, b). Theorem 2.10.

• For a ≥ 2, µ(a, a)= a. • 3b µ(2, 3)=5 and for b ≥ 4 we have µ(2, b) ≤ ⌈ 2 ⌉ +1, with equality for 4 ≤ b ≤ 8.

7 a/b 2 3 4 5 6 7 8 9 10 11 2 2 (1) 5 (1) 7 (1) 9 (4) 10 (2) 12 13 3 - 3 (1) 6 (12) 7 (7) 8 (2) 10 (150) 4 - - 4 (1) 7 (43) 8 (41) 9 (8) 10 (2) 5 - - - 5 (1) 8 (104) 9 (133) 10 (62) 11 12 6 - - - - 6 (1) 9 (219) 10 (325) 11 12 13 7 - - - - - 7 (1) 10 (421) 11 12 13 8 ------8 (1) 11 12 13 9 ------9 12 13 10 ------10 13

Table 1: µ(a,b) (number of non-isomorphic solutions in brackets)

Figure 6: Graphs with (a,b)=(2, 3) (left) and (a,b)=(2, 4) (right) with optimal gp-sets in red

• b For 3 ≤ a < b and 2 ≤ a we have µ(a, b)= b +2. • b b For 3 ≤ a< 2 we have µ(a, b) ≤ b − a +2+ ⌈ 2 ⌉.

Proof. If a = b the complete graph Ka has the required properties. Graphs with (a, b)=(2, 3) and (2, 4) are shown in Figure 6. For r ≥ 3 by Lemma 2.5 we have mp(P ag(r)) = 2, gp(P ag(r)) = 2r and mp(P ag′(r)) = 2 and gp(P ag′(r)) = 2r − 1, which gives the stated upper bound. The values of µ(2, b) for 2 ≤ b ≤ 8 follow from Table 1. b Let 3 ≤ a < b and 2 ≤ a. By Lemma 2.7 the graph C(r, s) has mp(C(r, s)) = r + s and gp(C(r, s)) = r +2s. Solving r + s = a, r +2s = b yields the values r =2a − b and s = b − a. Therefore, as C(r, s) has order r +2s + 2, we have µ(a, b) ≤ b + 2. Combined with the lower bound Lemma 2.9 we have equality. 3b+4 Let b> 2a. For even b consider the graph C(0, a − 1, 2 − 3a) and for b odd the graph 3b+5 C(0, a − 1, 2 − 3a). Again by Lemma 2.7 these graphs have mp-number a, gp-number b and order as given in the statement of the theorem.

Conjecture 2.11. For b ≥ 4 we have 3b µ(2, b)= ⌈ ⌉ +1 2

8 and for 3 ≤ a and b> 2a b µ(a, b)= b − a +2+ ⌈ ⌉. 2 It is easily seen that any of the leaves of T (r, s, t) in the construction of the chalice graphs yields an extreme vertex in C(r, s, t). Also trivially every vertex of the complete graph Ka is extreme. We can therefore partially characterise the possible orders of graphs with mp-number a ≥ 3 and gp-number b. Corollary 2.12.

• For a ≥ 2, there exists a graph G with mp(G) = gp(G)= a and order n if and only if a = n =1 or 2 ≤ a ≤ n. • b For 3 ≤ a < b and 2 ≤ a there exists a graph G with mp(G)= a, gp(G)= b and order n if and only if n ≥ b +2. • b For 3 ≤ a < 2 there exists a graph G with mp(G) = a, gp(G) = b and order n if b n ≥ b − a +2+ ⌈ 2 ⌉. For a = 2 extending the extremal results to realisation results is somewhat more difficult. The cycles of length ≥ 5 have mp-number 2 and gp-number 3. Making suitable modifications to the pagoda graphs to yield graphs with same mp- and gp-numbers and larger order appears to be a non-trivial problem. However by making a small adaption to the ‘half-wheel’ graphs from [20] we can construct graphs with a = 2, b ≥ 4 and any order n ≥ 2b +1. For b ≥ 4 and n ≥ 2b + 1 we construct the graph H(n, b) by extending one of the vertices of the ‘half-wheel’ construction from [20] into a path. Let Cn−1 be a cycle of length n − 1, with vertices labelled by the elements of Zn−1 in the natural manner. The graph H(n, b) is obtained by adding an extra vertex x to Cn−1 and joining x by edges to the vertices 0, 2, 4,..., 2(b − 1). The proof that this graph has mp-number two and gp-number b follows trivially from [20]. Corollary 2.13. There exists a graph G with mp(G)=2 and gp(G)=3 and order n if and only if n ≥ 5. Let b ≥ 4. Then there exists a graph G with mp(G)=2 and gp(G) = b and order n if n ≥ 2b +1. We therefore leave the open problem Problem 2.14. For b ≥ 4 do there exist graphs with mp-number 2, gp-number b and all 3b orders n in the range ⌈ 2 ⌉ +1 ≤ n ≤ 2b?

3. Tur´an-type results for position numbers Tur´an problems are one of the foundations of modern extremal graph theory. Such ques- tions typically ask: what is the largest possible size of a graph with order n that contains no subgraph isomorphic to a graph from a family F of forbidden subgraphs? The first such re- sult was proved by Mantel, who showed in [14] that the largest possible size of a triangle-free n2 graph with order n is ⌊ 4 ⌋, the unique extremal graph being the complete bipartite graph n n K⌊ 2 ⌋,⌈ 2 ⌉. This result was later generalised by Tur´an as follows.

9 Theorem 3.1. [21] The number of edges of a Ka+1-free graph H is at most

n − r r +1 +(a − 1) ,  2   2 

n where r = ⌊ a ⌋. Equality holds if and only if H is isomorphic to the Tur´an graph Tn,a, which n n is the complete a-partite graph with every partite set of size ⌊ a ⌋ or ⌈ a ⌉.

We will denote the size of the Tur´an graph Tn,a by tn,a. We now discuss some Tur´an- type problems for the general and monophonic position numbers. We make the following definition.

Definition 3.2. For a ≥ 2 and n ≥ a we define mex(n; a) (respectively gex(n; a)) to be the largest possible size of a graph with order n and mp-number (resp. gp-number) a. For any value of n for which there exists a graph with order n, mp-number a and gp-number b, let ex−(n; a; b) and ex+(n; a; b) be respectively the smallest and largest possible sizes of such a graph.

By Theorem 1.1 for any a, n ∈ N such that 2 ≤ a ≤ n there exists a graph G with order n and mp(G) = gp(G) = a, so the numbers mex(n; a) and gex(n; a) are both defined for n ≥ a. Corollaries 2.12 and 2.13 show that graphs with mp-number a and gp-number b ≥ a exist for all sufficiently large n. As the only graphs with gp-number two are the cycles and paths we trivially have gex(n;2) = n for n ≥ 4. Furthermore if there is a graph G with order n, mp(G)= a and gp(G)= b, then ex−(n; a; b) ≤ ex+(n; a; b) ≤ min{mex(n; a), gex(n; b)}. We can derive a quadratic upper bound for these numbers by an elementary application of Tur´an’s Theorem. To reduce the bound slightly we will need a lemma on the mp-numbers of complete multipartite graphs that extends the result on complete bipartite graphs from [20].

Lemma 3.3. For integers r1 ≥ r2 ≥···≥ rt the mp-number and gp-number of the complete multipartite graph Kr1,r2,...,rt are given by

gp(Kr1,r2,...,rt ) = mp(Kr1,r2,...,rt ) = max{r1, t}.

Proof. Let the partite sets of Kr1,r2,...,rt be W1, W2,...,Wt and let M be a maximum mp-set of Kr1,r2,...,rt . Suppose that M contains two vertices u1,u2 in the same partite set W . Then M cannot contain any vertex v in any other partite set, for u1,v,u2 is a monophonic path. Hence in this case |M|≤|W | ≤ r1. If M contains at most one vertex from every partite set then |M| ≤ t.

For the converse, observe that Kr1,r2,...,rt contains a clique of size t, so that |M| ≥ t. Each partite set is also an mp-set, so that |M| ≥ r1. The proof for gp-sets is identical. Lemma 3.4. For a ≤ n ≤ a2

mex(n; a)= gex(n; a)= tn,a,

2 but for n ≥ a +1 we have the strict inequalities mex(n; a) < tn,a and gex(n; a) < tn,a.

10 Proof. If a graph contains a clique of size ≥ a + 1, then it will have mp- and gp-number ≥ a + 1. Therefore any graph with mp- or gp-number a is Ka+1-free and it follows from Tur´an’s Theorem that gex(n; a) ≤ tn,a and mex(n; a) ≤ tn,a. As the Tur´an graph is the unique extremal graph, we have equality if and only if the Tur´an graph has mp-number a. 2 2 By Lemma 3.3, Tn,a does have mp-number a for a ≤ n ≤ a , but for n ≥ a +1 Tn,a has mp- n and gp-number ⌈ a ⌉ ≥ a + 1. We now show that the upper bound given in Theorem 3.4 is asymptotically tight for the monophonic position number. Theorem 3.5. For a ≥ 2 and n ≥ a2 +1 we have n a tn,a − ⌊ ⌋ ≤ mex(n; a) ≤ tn,a − 1. a 2

n Proof. Take the Tur´an graph Tn,a and label the partite sets T1, T2,...,Ta, where |Ti| = ⌈ a ⌉ n n for 1 ≤ i ≤ s and |Ti| = ⌊ a ⌋ for s +1 ≤ i ≤ a, where s = n − ⌊ a ⌋a. For 1 ≤ i ≤ a we denote n n the vertices of Ti by uij, where 1 ≤ j ≤ ⌈ a ⌉ if i ≤ s and 1 ≤ j ≤ ⌊ a ⌋ if s +1 ≤ i ≤ a. n For each j in the range 1 ≤ j ≤ ⌊ a ⌋ delete the edges of the clique of order a on the ∗ n a vertices uij, 1 ≤ i ≤ a, from Tn,a. This yields a new graph Tn,a with size tn,a − ⌊ a ⌋ 2 . ∗ Considering the vertices uii for 1 ≤ i ≤ a, we see that Tn,a contains a clique of size a, ∗ ∗ so certainly mp(Tn,a) ≥ a. For the converse, let M be a largest mp-set of Tn,a. Suppose that M contains two vertices uij and uik from the same partite set Ti. Then M cannot ′ contain a vertex ui′j′ from a different partite set Ti′ where j 6∈ {j, k}, as uij,ui′j′ ,uik is a monophonic path. We have mex(5;2) = 5, so the lower bound holds for n = 5 and a = 2; 2 n n otherwise for n ≥ a + 1 we have ⌊ a ⌋ ≥ 3. Hence let 1 ≤ l ≤ ⌊ a ⌋ and l 6∈ {j, k}. Then for ′ any i ∈{1, 2,...,a}−{i} the path P = uij,ui′k,uil,ui′j,uik is monophonic, so M ⊆ V (Ti). However the path P shows that no three points of the partite set Ti can all lie in M, so that |M| ≤ 2. Therefore we can assume that any optimal mp-set has at most one point in each ∗ partite set, so that mp(Tn,a) ≤ a, completing the proof. Theorem 3.5 shows us the asymptotic order of mex(n; a); for a ≥ 2 we have mex(n; a) ∼ 1 1 2 2 (1 − a )n . This implies that asymptotically the only significant obstruction to having mp- number ≥ a + 1 is the absence of an (a + 1)-clique. Tables of values of ex−(n; a; b) and ex+(n; a; b) for some small n, a and b are given in Tables 2 and 3 (this data is from Erskine [12]). These data show that the graphs in Theorem 3.5 are not always optimal for n ≥ a2 +1; for example there is a graph with order n = 10, mp-number 3 and size 31, whereas the lower bound given by Theorem 3.5 is just 24. However for a = 2 we are able to push our result further to give an exact formula for mex(n; 2).

(n−1)2 Theorem 3.6. For n ≥ 6 we have mex(n;2) = ⌈ 4 ⌉, with the unique extremal graph ∗ ∗ given by Tn,a for odd n and Tn,a with one edge added between the partite sets for even n. Proof. It is easily verified that for even n the graph formed from the construction in Theorem 3.5 by adding an extra edge between the partite sets (i.e. the graph Kr,r minus a matching of size r − 1) has mp-number two, so that mex(2r;2) ≥ r2 − r + 1 and mex(2r + 1;2) ≥ r2. The data in Tables 2 and 3 confirm that these graphs are extremal for 5 ≤ n ≤ 12 and furthermore our constructions are the unique extremal graph.

11 Now we prove the upper bound. The stability result of [4] states that for n ≥ 2a + 1 any n K(a+1)-free graph with ≥ tn,a − ⌊ a ⌋ + 2 edges must be a-partite. In particular, for n ≥ 5 any triangle-free graph with order 2r and size ≥ r2 − r +2 or order 2r + 1 and size ≥ r2 + 2 must be bipartite. Let G be any bipartite graph with partite sets X and Y , where |X|≥|Y |, and monophonic position number two. Suppose that there are ≥ 2 vertices x1, x2 in X that are connected to every vertex of Y . Then for any x3 ∈ X −{x1, x2} the set {x1, x2, x3} is in monophonic position. It follows that at most one vertex of X is adjacent to every vertex of 2 n n 2 Y , so that the size of G is at most ⌊ 4 ⌋ − ⌈ 2 ⌉ + 1. Therefore mex(2r;2) = r − r + 1 and r2 ≤ mex(2r + 1;2) ≤ r2 + 1. Suppose that G is a graph with order n = 2r + 1, size r2 + 1 and mp-number two. By the previous argument G is not bipartite. For any graph H with k vertices v1, v2,...,vk and positive integers n1, n2,...,nk we let H[n1, n2,...,nk] denote the blow-up graph obtained from H by replacing the vertex vi by a set Vi of ni vertices and joining every vertex in Vi to every vertex in Vj if and only if vi ∼ vj in H. It is shown in [1] that the only non- bipartite triangle-free graphs with order 2r + 1 and size r2 + 1 are given by the blow-up C5[r − 1, k, 1, 1,r − k] of the 5-cycle, where 1 ≤ k ≤ r − 1. The union of the partite sets with size k and r − k in this expanded graph is in monophonic position, so for r ≥ 3 no such graph exists. Hence mex(2r +1;2) = r2 for r ≥ 3. We now classify the extremal graphs. Again by [1] the only non-bipartite triangle-free 2 graphs with order 2r and size r −r+1 are the blow-ups C5[r−2, k, 1, 1,r−k] (1 ≤ k ≤ r−1) and C5[r − 1, k, 1, 1,r − k − 1] (1 ≤ k ≤ r − 2), which both have mp-number ≥ 3 for r ≥ 3, so any extremal graph must be bipartite. Applying our counting argument for bipartite graphs shows that both parts of the bipartition must have size r and there is a matching of size r −1 ∗ missing between X and Y ; hence the graph T2r,2 with an edge added between the partite sets is the unique extremal graph. Now let G be a graph with order n =2r + 1, mp-number two and size r2. For n =7, 9 or 11 the result can be shown by computer search [12] or a slightly more involved argument, so we assume that r ≥ 6. First we show that G must be bipartite. Let δ be the minimum degree of G and x be a vertex of G with degree δ. There must be a vertex of degree ≤ r −1 in G, for 1 2 ′ otherwise the size of G would be at least 2 (2r +1)r>r . Thus δ ≤ r − 1. Then G = G − x is a triangle-free graph with order 2r and size r2 − δ ≥ r2 − r + 1. It follows that either G′ ′ is bipartite, or δ = r − 1 and G is isomorphic to one of the blow-ups C5[r − 2, k, 1, 1,r − k] (1 ≤ k ≤ r − 1) or C5[r − 1, k, 1, 1,r − k − 1] (1 ≤ k ≤ r − 2). Suppose that G′ is bipartite with bipartition (X′,Y ′), where we make no assumption ′ ′ ′ ′ about the relative sizes of X and Y . Write a = |NG(x) ∩ X | and b = |NG(x) ∩ Y |, where a + b = δ. If either a =0or b = 0, then G is bipartite. G′ has size at most |X′||Y ′| ≤ r2 and, ′ ′ as G is triangle-free, there are at least ab edges missing between NG(x) ∩ X and NG(x) ∩ Y , so the size r2 of G is bounded above by r2 + a + b − ab. It follows that ab ≤ a + b, so that either a = 1 or b = 1, or else a = 2, b = 2. If a = 2, b = 2, then we have equality in the ′ preceding bound, so that G must be isomorphic to the complete bipartite graph Kr,r with ′ ′ the four edges between NG(x) ∩ X and NG(x) ∩ Y deleted, in which case the neighbourhood N(x) of x is a set of four vertices in monophonic position, a contradiction. Hence without loss of generality we can assume that a = 1; let x′ be the neighbour of x in X′. As there ′ ′ are b edges missing between NG(x) ∩ X and NG(x) ∩ Y , the size of G is bounded above by |X′||Y ′|+1; thus if either set X′ or Y ′ has size ≤ r −2, then the size of G would be too small,

12 so we can take |X′| ≥ r − 1. As before, at most one vertex in X′ −{x′} can be adjacent to every vertex of Y ′, so there are at least a further r − 3 edges missing between X′ −{x′} and Y ′, implying that r2 ≤ r2 − r +4, or r ≥ 4. This shows that for r ≥ 5 if the graph G′ is bipartite, then G is bipartite. ′ Now consider the case δ = r − 1 and G = C5[r − 2, k, 1, 1,r − k]. There must be at least one edge in G from x to the partite set of size r − 2 in G′, for otherwise this set of r − 2 vertices would be in monophonic position in G. As G is triangle-free, this means that x has no edges to the sets of size k or r − k. Both of these sets will thus constitute mp-sets in G, so that k ≤ 2 and r − k ≤ 2, so that r ≤ 4. Similar reasoning shows that G′ cannot be isomorphic to the blow-up C5[r − 1, k, 1, 1,r − k − 1] for r ≥ 6. Therefore for r ≥ 6 we can assume that G is bipartite with bipartition (X,Y ), where |X| > |Y |. Set t = |X|. Our bipartite counting argument shows that at most one vertex of X is adjacent to every vertex of Y and so there are at most f(t)= t(2r+1−t)−(t−1) = −t2+2rt+1 edges in G. We have f(r+1) = r2 and f is decreasing for t ≥ r, so |X| = r+1 and, as we have equality in the bound, exactly r vertices in X have one edge missing to Y , with the remaining vertex of X adjacent to every vertex of X. Suppose that two vertices of X are non-adjacent to the same vertex of Y , say x1 6∼ y1 and x2 6∼ y1; then for any x3 ∈ X −{x1, x2} the set {x1, x2, x3} would be in monophonic position. It follows that the missing edges between X and Y constitute a matching of size r in the complement of G and we recover our construction ∗ T2r+1,2. In marked contrast to the quadratic size of extremal graphs with given monophonic posi- tion number, the function gex(n; a) is O(n). One graph with order n = 10, general position number 3 and largest size is shown in Figure 7.

Theorem 3.7. There exists a function c(a) such that for a ≥ 2 we have gex(n; a) ≤ c(a)n. For a ≥ 3 the function c(a) is bounded above by the off-diagonal Ramsey number R(a, a +1) as follows: R(a, a + 1) − 1 1 ≤ c(a) ≤ . 2 Proof. Let G be a graph with order n, gp-number a, size gex(n; a) and maximum degree ∆. Suppose that there exists a vertex x with degree d(x) ≥ R(a, a+1) and let X be the subgraph induced by N(x). Then X contains either a clique of order a, which together with x would give a clique of size a + 1, or else X has an independent set of size a + 1; either of these sets constitutes a general position set with more than a vertices. Thus ∆ ≤ R(a, a + 1) − 1 and R(a,a+1)−1 gex(n; a) ≤ 2 n. More generally, any independent union of cliques in the subgraph X induced by the neighbourhood of a vertex of G will yield a gp-set in G. Therefore for a ≥ 3 the subgraph X ω must be Ka-free and have α (X) ≤ a. This raises the following question.

Problem 3.8. What is the asymptotic value of gex(n; a) for fixed a ≥ 3?

For any 2 ≤ a ≤ n − 1 there is always a tree T with order n and mp(T ) = gp(T )= a by a Theorem 1.1, so for n ≥ a the smallest possible size of a graph with mp- or gp-number a is 2 if n = a and n−1 if n > a. However the problem of finding ex−(n; a; b), the smallest possible 

13 Figure 7: A graph with order 10, gp-number 3 and largest size

11 12 13 10 14 w1 9 15

8 0 w2

7 1 w3 6 2 5 4 3

Figure 8: S(3, 3) (left) with an optimal gp-set in red (right) size of a graph with order n, mp-number a and gp-number b, appears to be non-trivial. If − a − a = b then the previous observation shows that ex (a; a; a) = 2 and ex (n; a; a) = n − 1 for n ≥ a + 1 and ex−(n; a; b)= n − 1 if and only if a = b and n > a. Furthermore as cycles − Cn with n ≥ 5 have mp(Cn) = 2 and gp(Cn) = 3 for any n ≥ 5 we obtain ex (n;2;3) = n. The graphs in Tables 2 and 3 suggest the following construction.

5b−3a − Theorem 3.9. If b and a have the same parity, then for n ≥ 2 +4 we have ex (n; a; b) ≤ b−a 5b−3a+1 − n + 2 +1. If a and b have opposite parities, then for n ≥ 2 we have ex (n; a; b) ≤ b−a+1 n + 2 .

Proof. For r ≥ 2 and t ≥ 0 we define a graph S(r, t) as follows. Take a cycle C5r+1 of length 5r + 1 and identify its vertex set with Z5r+1 in the natural way. Join the vertex 0 to the vertices 3+5s for all s ∈ N in the range 0 ≤ s ≤ r−1. Finally append a set W = {w1,...,wt} of t pendant vertices to the vertex 0. An example is shown in Figure 8. We claim that S(r, t) has mp(S(r, t)) = t +2 and gp(S(r, t))=2r + t. The set W ∪{1, −1} is obviously in monophonic position, so mp(S(r, t)) ≥ t +2. Let M be any optimal mp-set of S(r, t). By a result of [20] on triangle-free graphs any set in

14 monophonic position in S(r, t) is an independent set. The path 1, 2, 3,..., 5r − 1, 5r in C5r+1 is monophonic in S(r, t) and hence contains at most two points of M, so if the mp-number of S(r, t) is any greater than t + 2, then M contains three vertices of C5r+1, one of which is 0, so that M ∩ W = ∅ and t = 0. A simple argument shows that the mp-number of S(r, 0) is two. Thus mp(S(r, t)) = t + 2. Consider now the set {2+5s, 4+5s : 0 ≤ s ≤ r − 1} ∪ W . The vertices of this set are at distance at most four from each other and it is easily verified that none of the geodesics between them pass through other vertices of the set. Thus gp(S(r, t)) ≥ 2r + t. Let K be a gp-set of S(r, t) that contains ≥ 2r + t + 1 vertices. For 0 ≤ s ≤ r − 1 the set S[s]= {1+5s, 2+5s, 3+5s, 4+5s, 5+5s} on C5r+1 contains at most two vertices of K. It follows that K must contain the vertex 0, two vertices in each of the aforementioned sets and every vertex of W . As the vertices of W have shortest paths to the vertices of K in S[0], we must have t = 0. For r ≥ 3, if 0 ≤ s a the graph S( 2 +1, a − 2) therefore has the required parameters. By Corollary 2.3 if a ≥ 3 we can add a path to a vertex of W to give a graph with any larger order n′ ≥ n and the same mp- and gp-numbers. If a = 2 then lengthening one of the sections of length five on C5r+1 accomplishes the same aim. If a and b have opposite parities, then shortening one of the sections of length five on C5r+1 in the above constructions by one vertex yields the required graph. For most triples (n, a, b) in Tables 2 and 3 there are graphs with these parameters and size m for any m in the range ex−(n; a; b) ≤ m ≤ ex+(n; a; b). However, there are exceptional cases in which this does not occur; for example for n = 11, a = 2, b = 6 there exist graphs with all sizes in the range 15 ≤ m ≤ 22 and m = 25, but none with size 23 or 24. It therefore appears to be an interesting problem to characterise the values of n, m, a and b for which there exists a graph with order n, size m, mp-number a and gp-number b. The data in Tables 2 and 3 also motivate the following conjecture. Conjecture 3.10. For fixed n and a the sequences of numbers ex−(n; a; b) and ex+(n; a; b) are unimodal for the range of b for which these quantities are defined.

4. The diameters of graphs with given order and mp-number In [17] Ostrand proved the well-known realisation result that for any two positive integers a, b with a ≤ b ≤ 2a there exists a connected graph with radius a and diameter b. Similar realisation results for the diameters of graphs with given position or hull numbers are given in [6, 7]. This raises the following question: what are the possible diameters of a graph with given order and monophonic position number? In particular, what are the largest and smallest possible diameters of such a graph? We now solve this problem. We split our analysis into two parts, beginning with mp-numbers k ≥ 3. Theorem 4.1. For any integers k and n with 3 ≤ k ≤ n−1, there exists a connected graph G with order n, monophonic position number k and diameter D if and only if 2 ≤ D ≤ n−k+1. Proof. For k ≥ 3 the only connected graph with monophonic position number k = n is the complete graph Kn with diameter one. It was shown in [20] that the monophonic position

15 n a b ex−(n; a; b) ex+(n; a; b) 12 2 6 15 31 12 2 7 19 26 12 2 5 14 24 12 2 4 13 20 12 2 3 12 16 11 2 6 15 25 11 2 5 13 22 11 2 4 12 18 11 2 3 11 14 10 9 9 9 44 10 8 8 9 43 10 7 7 9 42 10 6 6 9 41 10 5 5 9 40 10 4 4 9 37 10 7 8 11 36 10 6 7 10 36 10 5 6 10 36 10 4 5 10 34 10 5 7 12 32 10 6 8 12 31 10 4 6 11 31 10 3 4 10 31 10 3 5 10 29 10 4 7 13 28 10 5 8 14 27 10 3 6 12 27 10 3 7 14 23 10 2 5 12 21 10 3 3 9 20 10 4 8 16 17 10 2 6 15 16 10 2 4 11 16 10 2 3 10 13

Table 2: Largest and smallest sizes of graphs with orders 10, 11 and 12 and given mp- and gp-numbers

16 n a b ex−(n; a; b) ex+(n; a; b) 9 8 8 8 35 9 7 7 8 34 9 6 6 8 33 9 5 5 8 32 9 4 4 8 30 9 6 7 10 28 9 5 6 9 28 9 4 5 9 27 9 3 3 8 27 9 3 4 9 25 9 5 7 11 24 9 4 6 11 24 9 3 5 10 23 9 3 6 12 21 9 4 7 13 17 9 2 5 13 16 9 2 4 10 14 9 2 3 9 11 8 7 7 7 27 8 6 6 7 26 8 5 5 7 25 8 4 4 7 24 8 5 6 9 21 8 4 5 8 21 8 3 3 7 21 8 3 4 8 19 8 4 6 10 18 8 3 5 10 17 8 3 6 12 13 8 2 4 9 13 8 2 3 8 10 7 6 6 6 20 7 5 5 6 19 7 4 4 6 18 7 3 3 6 16 7 4 5 8 15 7 3 4 7 14 7 3 5 9 12 7 2 4 9 9 7 2 3 7 8 6 5 5 5 14 6 4 4 5 13 6 3 3 5 12 6 3 4 7 10 6 2 3 6 7

Table 3: Largest and smallest sizes of graphs with17 orders 9, 8, 7, 6 and given mp- and gp-numbers Figure 9: A graph G with order n = 9, mp(G) = 5 and diameter D =5

Figure 10: A graph F (12, 7, 5) with order n = 12, mp-number 7 and diameter D =5 number of a graph with order n and longest monophonic path with length L is bounded above by n − L + 1; rearranging, it follows that L ≤ n − k + 1. As any geodesic in G is induced, it follows that n − k + 1 is the largest possible diameter of a graph G with order n and mp(G) = k. Therefore it remains only to show existence of the required graphs for the remaining values of the parameters. For k = n − 1 and D = 2 this follows easily by considering the star graph K1,n−1, so we can assume that k ≤ n − 2. For n ≥ 2, Theorem 1.1 shows that any caterpillar graph formed by adding k − 2 leaves to the internal vertices of a path of length n − k +1 has order n, mp-number k and diameter D = n − k + 1; an example with n = 9 and k = 5 is the broom graph shown in Figure 9. For k ≥ 3 we can construct a graph F (n, k, n − k) with order n, mp-number k and diameter D = n − k as follows. Take a path P of length n − k; let V (P )= {u0,u1,...,un−k}, where ui ∼ ui+1 for 0 ≤ i ≤ n − k − 1. Introduce a set Q of k − 1 new vertices v1, v2,...,vk−1 and join each of them to u0 and u1. An example is shown in Figure 10. ′ We claim that the set Q ∪{un−k} is an mp-set. Any monophonic path P from un−k to a ′ vertex of Q must pass through u1, which is adjacent to every member of Q, and so P cannot terminate in another vertex of Q. Similarly any monophonic path between two vertices of Q passes through either u0 or u1 and hence cannot include any other vertex of Q or un−k. Thus mp(F (n, k, n − k)) ≥ k. Conversely, if M is any mp-set in F (n, k, n − k) with size ≥ k + 1, then M can contain at most two vertices from P and hence has size exactly k + 1 and consists of Q together with two vertices x, y of P . If x = ui,y = uj, where 1 ≤ i < j ≤ n − k, then there is an induced path from y to Q through x, which is impossible. Hence we can take x = u0. However v1 ∼ u0 ∼ v2 would be a monophonic path in M, so we conclude that mp(F (n, k, n−k)) = k. Finally for 2 ≤ D ≤ n − k − 1 we define the flagellum graph F (n, k, D) as follows. Take a path P of length D − 2 with vertices {x0, x1,...,xD−2}, where xi ∼ xi+1 for 0 ≤ i ≤ D − 3.

18 Figure 11: F (16, 6, 7)

Let Cs be a cycle with length s = n − D − k + 3 and vertex set {u0,u1,...,us−1}, where ui ∼ ui+1 for 0 ≤ i ≤ s − 1 and addition is carried out modulo s. Join x0 to every vertex of Cs, so that Cs ∪{x0} induces a wheel. Finally append a set Q = {v1, v2,...,vk−2} of k − 2 pendant edges to xD−2. An example of this construction is given in Figure 11. This graph has order n and diameter D; we now proceed to show that mp(F (n, k, D)) = k. It is simple to verify that the set Q ∪{u0,u1} is an mp-set and so mp(F (n, k, D)) ≥ k. Suppose that M is an mp-set with size ≥ k + 1. M can contain at most two points of P . If M contains two points of P then M ∩ (Cs ∪ Q) = ∅ and |M| = 2 < k. Suppose that M contains a point of P . Then M cannot contain points of both Cs and Q or else the point of P contained in M would lie on a monophonic path between any point of M in Cs and any point of M in Q. Any mp-set contains at most two points of Cs, so if M contains a point of Cs, it follows that k +1 ≤|M| ≤ 3 ≤ k, which is impossible. Therefore M must contain a point of Q; but as |Q| = k − 2 we have |M| ≤ 1+(k − 2) = k − 1. Thus M ∩ P = ∅. Therefore M consists of at most two points of Cs and at most k − 2 points of Q, so that |M| ≤ 2+(k − 2) = k. It is more difficult to determine the possible diameters of graphs with monophonic position number two.

Theorem 4.2. There exists a graph with order n, monophonic position number k = 2 and n diameter D ≥ 3 if and only if D = n − 1 or 3 ≤ D ≤ ⌊ 2 ⌋. Proof. It follows from the results of [20] that for n ≥ 2r+1 and r ≥ 3 we have mp(H(n, r)) = 2, where H(n, r) is the half-wheel graph defined in Section 2. Moreover H(n, r) has order n n n and diameter D = 3+ ⌈ 2 ⌉ − r if r ≥ 4 and diameter ⌈ 2 ⌉ − 1 if r = 3. Varying r from 3 n−1 to ⌊ 2 ⌋ we obtain graphs with order n, mp-number k = 2 and all diameters in the range

19 n n n 4 ≤ D ≤ ⌈ 2 ⌉ − 1. For odd n we have ⌈ 2 ⌉ − 1 = ⌊ 2 ⌋. For even n ≥ 4 the cycle Cn has n mp-number k = 2 and diameter ⌊ 2 ⌋. ∗ Theorem 3.5 shows that for n ≥ 3 the graph Tn,2, which is a complete bipartite graph K n n n k ⌈ 2 ⌉,⌊ 2 ⌋ minus a matching of size ⌊ 2 ⌋, has mp-number = 2; as this graph has diameter n D = 3, we have proven existence for all D in the range 3 ≤ D ≤ ⌊ 2 ⌋. For n ≥ 2 the path with length n − 1 is a graph with order n, mp-number k = 2 and diameter n − 1. This proves the existence of graphs with mp-number k = 2 and all values of the diameter D claimed in the statement of the theorem. We now show that there is no graph with order n, mp-number k = 2 and diameter D, n where ⌊ 2 ⌋ n, which is impossible. Hence G contains a cut-vertex w. Suppose that d(w) ≥ 3. Then choose a set M of three neighbours of w such that the vertices of M are not all contained in the same component of G − w; it is easily seen that M is an mp-set. Hence we must have d(w) = 2. Each neighbour of w is either a leaf of G or a cut-vertex, so repeating this reasoning shows that G is a path, which contradicts D < n − 1.

Lemma 4.3. If there exists a graph with order r ≥ 4, monophonic position number k =2 and diameter D = 2, then there exist graphs with monophonic position number k = 2, diameter D =2 and orders 3r, 3r +1 and 3r +2.

Proof. Let H be a graph with order r ≥ 4, monophonic position number k = 2 and diameter D = 2. Label the vertices of H as h1, h2,...,hr. We will construct new graphs with orders 3r, 3r +1 and 3r + 2 with mp-number k = 2 and diameter D = 2 from H as follows. First we define the graph G(H) with order 3r +2. Let X = {x1, x2,...,xr} and Y = {y1,y2,...,yr} be two new sets of vertices disjoint from V (H). On X ∪ Y draw a complete bipartite graph with partite sets X and Y and then delete the perfect matching xiyi, 1 ≤ i ≤ r. For 1 ≤ i ≤ r join both xi and yi to the vertex hi by an edge. Finally add two new vertices z1 and z2, join z1 to each vertex of X by an edge, join z2 to each vertex of Y and lastly add the edge z1z2 between the two new vertices. An example of this construction for H = C4 is displayed in Figure 12. It is easily seen that G has diameter D = 2. To show that the mp-number of G is k =2 it is sufficient to show that for any set M of three vertices of G there is an induced path containing each vertex of M. It is evident that for any vertex v ∈ V (G) −{z1, z2} there is an induced path in G containing z1, z2 and v, so we can assume that |M ∩{z1, z2}| ≤ 1. The map fixing every element of H, interchanging xi and yi for 1 ≤ i ≤ r and swapping z1 and z2 is an automorphism of G, which reduces the number of cases that we need to check. Suppose that M is a set of three vertices of G(H) containing one of z1, z2; say z1 ∈ M. ′ Without loss of generality we have the following nine possibilities for M = M −{z1}: i) ′ ′ ′ ′ ′ M = {x1, x2}, ii) M = {x1, h1}, iii) M = {x1, h2}, iv) M = {x1,y1}, v) M = {x1,y2}, vi) ′ ′ ′ ′ M = {h1, h2}, vii) M = {h1,y1}, viii) M = {h1,y2} and ix) M = {y1,y2}. Consider the following two cycles. For 1 ≤ i, j ≤ r, where i =6 j, we define C(i, j) to be the cycle z1, xi,yj, hj, xj, z1 and, if P is a shortest path in H from hi to hj, then D(i, j) is the cycle formed from the path P from hi to hj, followed by the path hj, xj, z1, xi, hi. Both

20 Figure 12: The graph G(C4) of these cycles are induced and so can contain at most two points of M. By varying the parameters i and j we see that the first seven configurations for M ′ above are not possible. For viii) let P be a shortest path in H from h1 to h2. By assumption r ≥ 4, so as P has length at most two, there exists a vertex of H, say h3, not appearing in P . Then the path P , followed by the path h2,y2, x3, z1 contains all three vertices of M. Finally for case ix) the induced path y1, x2, z1, x1,y2 contains all three vertices of {z1,y1,y2}. We can now suppose that M ∩{z1, z2} = ∅. Observe that the subgraph of G induced by ∗ X ∪ Y is isomorphic to the graph T2r,2 from the proof of Theorem 3.5, so we can also assume that M 6⊆ X ∪ Y . Furthermore, as mp(H) = 2, we can take M 6⊆ V (H). For all 1 ≤ i, j ≤ r and i =6 j there is an induced cycle xi, hi,yi, xj, hj,yj, xi, so M must contain vertices with at least three different subscripts i ∈ {1,...,r}. Therefore without loss of generality we are left with the following three cases: i) M = {x1, x2, h3}, ii) M = {x1,y2, h3} and iii) M = {x1, h2, h3}. ′ For cases i) and ii), let P be the shortest path in H from h3 to {h1, h2}; without loss ′ of generality P is a h2, h3-path that does not pass through h1. Then in case i) x1, z1, x2, h2 ′ followed by P contains all three points of M = {x1, x2, h3} and in case ii) the path x1,y2, h2 ′ followed by P contains all three vertices of M = {x1, h3,y2}. ′ ′ For case iii), if P is a shortest h2, h3-path in H, then x1,y2, h2 followed by P contains all ′ three vertices of M = {x1, h2, h3} unless d(h2, h3) = 2 and P is the path h2, h1, h3, in which case the path h3,y3, x1,y2, h2 suffices. ′ This analysis also shows that the graphs G (H) = G(H) −{z2} with order 3r + 1 and ′′ the graph G (H)= G(H) −{z1, z2} with order 3r also have mp-number k = 2 and diameter D = 2. Hence for any r ≥ 4 if there is a graph with order r, mp-number k = 2 and diameter D = 2 there also exists such a graph for orders 3r, 3r +1 and 3r + 2.

21 Theorem 4.4. There is a graph with order n, monophonic position number k = 2 and diameter D =2 if and only if n ∈{3, 4, 5, 8} or n ≥ 11.

Proof. The statement of the theorem has been verified by computer search for all n ≤ 32 [12]. For n ∈{3, 4, 5, 8} the graphs with order n, mp-number k = 2 and diameter D = 2 are unique. The graph with order 8 is a circulant graph isomorphic to G(K2). There are two such graphs with order 11, one of which is the graph G(P3), where P3 is the path with length two, and the other is the circulant graph on Z11 with connection set {−3, −1, 1, 3}. For all orders in the range 11 ≤ n ≤ 32 there are circulant graphs with the required parameters (the existence of graphs with the necessary parameters with orders in the ranges 12 ≤ n ≤ 17 and 24 ≤ n ≤ 26 also follows from the construction in Lemma 4.3 applied to the graphs with orders 4, 5 and 8). Let n ≥ 33 and assume that the result is true for all orders < n. Write n =3r + s, where s is the remainder on division of n by 3. Then r ≥ 11 and by the induction hypothesis there exists a graph with order r, mp-number k = 2 and diameter D = 2. Then by Lemma 4.3 there exists a graph with order n, mp-number k = 2 and diameter D = 2. The theorem follows by induction. In fact the search mentioned in the proof of the preceding theorem suggests the following stronger result.

Conjecture 4.5. For any n ≥ 11, there is a circulant graph with order n, monophonic position number k =2 and diameter D =2.

5. Graphs with given diameter and largest general position number

Many results in graph theory concern upper bounds for certain graph invariants in terms of the order and diameter of a graph; one well-known example is the inequality χ(G) ≤ n−d+1 for the chromatic number of a graph with given order n and diameter d [8]. Such bounds have also been considered for position problems [5, 6, 7]. We will now classify the graphs with largest possible general position number and given order and diameter or girth. It is shown in [16] that if H is an isometric subgraph of a graph G, then a set S of vertices of H is in general position in H if and only if S is in general position in G. As H can contain at most gp(H) vertices in general position, we obtain the following lemma.

Lemma 5.1. If G is a graph with order n and H is an isometric subgraph of G with order n′, then gp(G) ≤ n − n′ + gp(H). If this bound is met, then any optimal gp-set K of G consists of gp(H) vertices of H in general position together with all vertices of G − H.

Graphs that meet the bound in Lemma 5.1 have a highly constrained structure.

Lemma 5.2. Let G be a graph that meets the upper bound in Lemma 5.1, where H is an isometric subgraph of G. Then every component of G − H is complete and every vertex of G − H has a neighbour in H.

22 Figure 13: An extremal graph with given diameter (gp-set in red)

Proof. Let G be a graph that meets the upper bound in Lemma 5.1 and K be any largest gp-set of G. If there is a non-complete component of G − H, then there will be a geodesic of length two contained in G − H, which by Lemma 5.1 contains three vertices of K, a contradiction. Let u be any vertex of G − H. Fix a vertex v ∈ K ∩ V (H) and let P be a u, v-geodesic in G. As P already contains two vertices of K, namely u and v, it cannot contain any other vertices of G − H, so the first edge of P is incident to u and H. If H is an isometric subgraph of G, then if any vertex u of G − H has two neighbours ′ ′ v, v in H we must have dH (v, v ) ≤ 2. Furthermore, if G meets the upper bound of Lemma 5.1 with optimal gp-set K, then if v and v′ also lie on a geodesic in H between two vertices of V (H) ∩ K, we must have v ∼ v′, for otherwise the v, v′-subpath of the geodesic can be replaced by the subpath v,u,v′, so that a geodesic of G would pass through three vertices of K, a contradiction. We will now examine two important cases of the bounds in Lemma 5.1. In the following we will label the vertices of a path of length d by the integers 0, 1,...,d with adjacencies defined in the natural way. For i, j ∈{0, 1,...,d} we will denote the subpath of P from i to j by Pij. Also if 0 ≤ i < j ≤ d we will write [i, j]= {k ∈ N : i ≤ k ≤ j}. Firstly we deal with the largest possible gp-number of a graph G with given order n and diameter d. Let P be a path of length d between two antipodal vertices of G. Lemma 5.1 shows that gp(G) ≤ n − d + 1. This bound first appeared in [5], in which the trees that meet the upper bound are classified using Theorem 1.1; a tree meets the bound if and only if it is a caterpillar (i.e. a tree formed by attaching leaves to the non-terminal vertices of a path). The following theorem classifies all graphs that meet this upper bound. Theorem 5.3. Let G be a graph with order n and diameter d. Let P be a geodesic of length d between antipodal vertices of G. Then G has gp-number n − d +1 if and only if there exist vertices a < b of P such that either b = a +1 and G is formed from P and a clique W by setting N(v) ∩ P = {a, a +1}, {a, a +1, a +2} or {a − 1, a, a +1} for each v ∈ W , or else b ≥ a +2 and every component W of G − P is a clique such that at most one clique has an edge to a, at most one clique has an edge to b and every clique W satisfies one of the following conditions: • there is an i ∈ [a +1, b − 1] such that N(v) ∩ V (P )= {i} for every v ∈ V (W ), • there is an i ∈ [a, b − 1] such that N(v) ∩ V (P )= {i, i +1} for every v ∈ V (W ), • each v ∈ W has neighbourhood N(v) ∩ V (P ) ⊆{a − 1, a, a +1}, each v has an edge to a +1 and if any v ∈ W has an edge to a, then every vertex of W has an edge to a, or

23 • for each v ∈ W we have N(v) ∩ V (P ) ⊆ {b − 1, b, b +1}, each v has an edge to b − 1 and if any v ∈ W has an edge to b, then every vertex of W has an edge to b. Proof. Let K be a gp-set of G of size n − d + 1. By Lemma 5.1, K consists of V (G − P ) and two vertices a, b of P , where 0 ≤ a < b ≤ d. Denote the components of G − P by W1, W2,...,Wr, where r ≥ 0. By Lemma 5.2 each Wi is a complete graph and each vertex of G − P has a neighbour on P . There can be at most one component W with an edge to a; otherwise two such edges from different components would together constitute a geodesic in G containing three points of K. Similarly at most one component of G − P has an edge to the vertex b. We assume first that b − a ≥ 2. Suppose that there is a vertex v in a component W of G − P that does not have a neighbour in [a +1, b − 1]; then without loss of generality we can suppose that v has a neighbour in [0, a]. If v has a neighbour in [b, d], then as P is an isometric subgraph we would have b = a + 2 and v ∼ a and v ∼ b, in which case a ∼ v ∼ b is a geodesic through three points of K, so N(v) ∩ V (P ) ⊆ [0, a]. Let P ′ be a v, b-geodesic in G. P ′ cannot pass through any points of V (G − P ) other than v and it follows that P ′ passes through a ∈ K, which is also impossible. Therefore every vertex of V (G − P ) has a neighbour in [a +1, b − 1]. Therefore for every vertex v of G − P the neighbourhood N(v) ∩ P takes one of the following forms: i) {i}, i ∈ [a +1, b − 1], ii) {i, i +1}, i ∈ [a, b − 1], iii) {i − 1, i +1}, i ∈{a, b}, or iv) {i − 1, i, i + 1}, i ∈ {a, b}. Suppose that v, v′ are vertices in the same clique W such that d(v′, b) < d(v, b); then a b, v′-geodesic in G followed by the edge vv′ would be a geodesic through three points of K. Similarly we cannot have d(v′, a) < d(v, a), so that d(v, a) = d(v′, a) and d(v, b) = d(v′, b). It follows that each clique W satisfies one of the conditions in the statement of the theorem. If at most once clique has edges to a and at most one clique has edges to b, then it is clear that the resulting graph has gp-number n − d + 1. One such graph is shown in Figure 13. In the case b = a + 1 the above reasoning shows that each vertex of G − P has neighbour- hood in P given by one of {a, a +1}, {a, a +1, a +2} or {a − 1, a, a +1}. Hence G − P must consist of a single clique. However the graph formed by adding a clique W to the path P and assigning every vertex of W one of the three neighbourhoods {a, a +1}, {a, a +1, a +2} or {a − 1, a, a +1} does have the required gp-number.

Finally we consider the gp-numbers of graphs with given girth. We have gp(C4) = 2 and gp(Cr)=3 for r ≥ 5. Therefore Lemma 5.1 shows that the gp-number of a graph with girth g ≥ 5 is at most n − g + 3 and the gp-number of a graph with girth four and order n is bounded above by n − 2. Before stating our theorem, we define two families of graphs. Identify the vertices of a 4-cycle C4 with the elements of Z4 in the natural manner. For r, s ≥ 0 let U(r, s) be the graph obtained from C4 by joining r new vertices to 0 and 2 and s new vertices to just 2 and likewise let V (r) be the graph formed from C4 by joining r new vertices to 0 and 2 and joining one vertex of a new copy of K2 to 0 and the other to 2. Two examples of these families are displayed in Figure 14. Theorem 5.4. Let G be a graph with girth g ≥ 4. If g =4 then gp(G)= n − 2 if and only if G is isomorphic to U(r, s) or V (r) for some values r, s ≥ 0. If g ≥ 5 then the largest possible gp-number of G is n − g +2 and this bound is attained for all girths in the range 5 ≤ g ≤ n.

24 3 2 3 2

0 1 0 1

Figure 14: U(3, 3) (left) and V (4) (right)

Proof. Graphs with order n and gp-number n − 2 were classified in [19], so we merely state the result for g = 4. Then G has gp(G)= n − 2 if and only if it is isomorphic to a U(r, s) or a V (r). Suppose that G is a graph with girth g ≥ 5 and let Cg be a girth cycle of G; we will show that gp(G) < n − g + 3. Suppose to the contrary that G has a gp-set K of G with size n − g + 3. Then by Lemma 5.2 every component W of G − Cg is complete, so as G is triangle-free no component of G−Cg can contain ≥ 3 vertices. Suppose that some component has two vertices, call them x and y. Again by Lemma 5.2 both x and y have edges to Cg. If g ≥ 7 then, however these edges are inserted, a cycle with length less than g is created, a contradiction. A simple argument also shows that there can be no component of G−Cg with order two if g = 5 or 6. Moreover consideration of cycle lengths shows that any component of order one of G − Cg has exactly one edge to Cg. Hence G is formed by adding leaves to vertices of Cg. However, three vertices of Cg lie in K, so it follows that for any vertex x of G − Cg there will be a geodesic from x to a vertex of V (Cg) ∩ K that passes through another vertex of V (Cg) ∩ K. Hence for g ≥ 5 the largest possible gp-number of G is n−g +2. This bound is achieved by graphs formed from a g-cycle Cg by attaching n − g leaves to one vertex of Cg. Acknowledgements The authors thank Dr. Erskine for his extensive help with the computational results used in this paper. The first author acknowledges funding by an LMS Early Career Fellowship (Project ECF-2021-27) and also thanks the Open University for an extension of funding during lockdown and Tatyana Jurjaviciene for finding a name for the chalice graphs. The second author thanks the for providing JRF.

References

[1] Amin, K., Faudree, J., Gould, R. J. and Sidorowicz, E., On the non-(p − 1)-partite Kp-free graphs. Discuss. Math. Graph Theory 33 (1) (2013), 9-23.

[2] Bondy, J.A., Murty, U.S.R., Graph Theory with Applications London: Macmillan, Vol. 290 (1976).

25 [3] Brandes, U., Network analysis. Methodological foundations. Lecture Notes in Computer Science, Springer, Berlin, vol 3418 (2005), 62–82.

[4] Brouwer, A.E., Some lotto numbers from an extension of Tur´an’s theorem, Math. Centr. report ZW152, Amsterdam (1981).

[5] Chandran, S.V.U. and Parthasarathy, G.J., The geodesic irredundant sets in graphs. Int. J. Math. Comb. 4 (2016).

[6] Chartrand, G., Harary, F., and Zhang, P., On the geodetic number of a graph. Networks 39 (2002), 1–6.

[7] Chartrand, G. and Zhang, P., Extreme geodesic graphs. Czech. Math. J. 52 (4) (2002), 771-780.

[8] Chv´atal, V., Some relations among invariants of graphs. Czech. Math. J. 21 (3) (1971): 366-368.

[9] Dourado, M.C., Protti, F., and Szwarcfiter, J.L., Algorithmic aspects of monophonic convexity. Electron. Notes Discrete Math. 30 (2008), 177-182.

[10] Dourado, M.C., Protti, F. and Szwarcfiter, J.L., Complexity results related to mono- phonic convexity. Discrete Appl. Math. 158 (12) (2010), 1268-1274.

[11] Dudeney, H.E., Amusements in mathematics. Vol. 473. Courier Corporation (1958).

[12] Erskine, G., Personal communication (2021).

[13] Harary, F., Loukakis, E. and Tsouros, C., The geodetic number of a graph. Math. Com- put. Model 17 (1993), 89–95.

[14] Mantel, W., Problem 28, Wiskundige Opgaven 10, no. 60-61 (1907), 320.

[15] Manuel, P. and Klavˇzar, S., Graph theory general position problem. arXiv preprint arXiv:1708.09130 (2017).

[16] Manuel, P. and Klavˇzar, S., The graph theory general position problem on some inter- connection networks. Fundam. Inform. 163 (4) (2018), 339-350.

[17] Ostrand, P.A., Graphs with specified radius and diameter. Discrete Math. 4 (1973), 71- 75.

[18] Pelayo, I.M., Geodesic convexity in graphs. New York: Springer (2013).

[19] Thomas, E. J. and Chandran S.V.U., Characterization of classes of graphs with large general position number. AKCE Int. J. Graphs Comb. 17 (3) (2020), 935-939.

[20] Thomas, E.J., Chandran, S.V.U. and Tuite, J., On monophonic position sets in graphs. preprint (2020).

26 [21] Tur´an, P., An extremal problem in graph theory, Mat. Fiz. Lapok 48 (1941); vedi anche: ‘On the theory of graphs’, Coll. Math 3 (1954).

[22] Wang, F., Wang, Y. and Chang, J., The lower and upper forcing geodetic numbers of blockcactus graphs. Eur. J. Oper. Res. 175 (2006), 238–245.

27