General position polynomials

A subset of vertices of a graph $G$ is a general position set if no triple of vertices from the set lie on a common shortest path in $G$. In this paper we introduce the general position polynomial as $\sum_{i \geq 0} a_i x^i$, where $a_i$ is the number of distinct general position sets of $G$ with cardinality $i$. The polynomial is considered for several well-known classes of graphs and graph operations. It is shown that the polynomial is not unimodal in general, not even on trees. On the other hand, several classes of graphs, including Kneser graphs $K(n,2)$, with unimodal general position polynomials are presented.


Introduction
Given a graph G = (V (G), E(G)), a set S ⊆ V (G) of vertices of G is a general position set if no triple of vertices from S lie on a common shortest path in G.The cardinality of a largest general position set of G is called the general position number of G and is denoted by gp(G).These sets were independently introduced in [7,20] and have already been studied from many perspectives, cf.[4,15,16,18,22,23,26].In this paper, we explore general position sets from the point of view of the counting polynomial defined in the following standard way.
Definition 1.1.The general position polynomial of a graph G is the polynomial where a i is the number of distinct general position sets of G with cardinality i.
A polynomial is said to be unimodal if its coefficients are non-decreasing and then non-increasing.Unimodality is one of the most important and most studied properties of counting polynomials in graph theory.In the next paragraph, we give a very brief justification for our claim.
Since the matching polynomial of a graph has only real zeros [11], it is unimodal.The unimodality of the chromatic polynomial has been established in [13].In [3] it has been conjectured that the domination polynomial of an arbitrary graph G is also unimodal.The conjecture has been approached from different perspectives, see [2,5,6,19], but it remains open.On the other hand, it is known that the independence polynomial is not unimodal in general, but it has been conjectured by Alavi, Malde, Schwenk, and Erdős that the independence polynomial of a tree is unimodal [1], a conjecture which is also still open.It was very recently demonstrated that the conjecture cannot be strengthened up to its log-concave version [14].On the other hand, the independence polynomial of a claw-free graph is unimodal [8].
The rest of the paper is organised as follows.In the next section we determine the general position polynomial of several families of graphs and give an inclusionexclusion-like formula for the polynomial.We also construct an infinite number of pairs of non-isomorphic trees with the same general position polynomial.In Section 3 we consider the general position polynomials of disjoint unions of graphs, joins of graphs, and Cartesian products of graphs.In particular, we express the general position polynomial of the join of two graphs with the clique polynomial and the independent union of cliques polynomial (to be defined in Section 3) of the factors, and determine ψ(P r P s ).Then, in Section 4, we consider unimodality of the polynomial.We first demonstrate that it is not unimodal in general and not even unimodal on the class of trees.On the other hand, we prove that it is unimodal on combs, Kneser graphs K(n, 2), and a family of graphs containing complete bipartite graphs minus a matching.The paper is concluded with some open problems and suggestions for future research.

Basic results and examples
Let G be a graph.Then, clearly, the degree of ψ(G) is gp(G).It was shown in [7,Theorem 2.10] that C 4 and P n , n ≥ 2, are the only connected graphs G with gp(G) = 2, hence among connected graphs the degree of a general position polynomial is equal to 2 precisely for C 4 and for P n , n ≥ 2. In addition, if G is of order n, then since every set of at most two vertices is a general position set, its general position polynomial starts as We now derive general position polynomials for some standard families of graphs.(1) and the previously mentioned fact that gp(P n ) = 2 for n ≥ 2.
(iii) Consider C 2d+1 , d ≥ 1.We count the number of triples of vertices that are on a common geodesic.For 2 ≤ r ≤ d there are exactly n pairs of vertices at distance r on the cycle and each such pair corresponds to exactly r − 1 sets from V (Cn) 3 that are on a common geodesic.Thus there are n d r=1 (r − 1) = n d 2 triples that are on a common geodesic and hence there are exactly n 3 − n d 2 triples that are in general position.
(iv) Consider C 2d , d ≥ 2. The reasoning for odd cycles applies to pairs of vertices at distance at most d − 1 from each other; however, each pair of vertices at distance d now corresponds to n − 2 sets from V (Cn) 3 on a common geodesic.Therefore there are triples of vertices that are on a common geodesic.
(v) The formula follows since gp(K m,n ) = max{m, n} = m and since a general position set S of K m,n of cardinality at least 3 is an independent set, so that S is a subset of one of the bipartition sets of K m,n .
The general position polynomial can also be expressed via the inclusion-exclusion principle as follows.For a positive integer n, let [n] = {1, . . ., n}.Proposition 2.2.Let G be a graph and let X 1 , . . ., X n be the maximal general position sets of G. Then Proof.Any subset of a general position set X is also a general position set and the number of subsets of size i is |X| i .It follows that for every general position set X we have ψ(X) = (1 + x) |X| .The formula then follows by the inclusion-exclusion principle.
As an example, consider the Petersen graph P = K(5, 2).In the standard drawing of it denote the consecutive vertices of the outer 5-cycle by u 0 , u 1 , u 2 , u 3 , u 4 , and their respective neighbors on the inner 5-cycle by u 0 , u 1 , u 2 , u 3 , u 4 .It is known from the seminal paper [20] that gp(P ) = 6.By inspection it can be checked that there are precisely five general position sets of cardinality 6: Moreover, the remaining maximal general position sets are the five independent sets of cardinality 4: Since every vertex of P lies in five different maximal general position sets, the intersection of six or more such sets is empty.In Table 1 it is shown how many different occurrences of the same number of sets in an intersection have the same size of intersection.
To conclude the section we point out that the general position polynomial does not determine a graph uniquely.For example, 1 + 4x + 6x 2 is a general position polynomial of both P 4 and C 4 .Furthermore, the general position polynomial does not even determine a tree uniquely.For example, let k ∈ N and take T (k) 1 to be the tree obtained from identifying one leaf of P 13k , P 5k and P 4k , and to be the tree obtained from identifying one leaf of P 10k , P 9k and P 3k .The case k = 1 is shown in Fig. 1.
where the coefficient at x 3 is obtained by taking one vertex from each pendent path.
The key property that achieves the equality of polynomials is that 12+4+3 = 9+8+2 and 12 Note that this is not the only pair of triples with this property.

The general position polynomial of some graph operations
In this section we consider the general position polynomials of disjoint unions of graphs, joins of graphs, and Cartesian products of graphs.
is a general position set of H. Using this fact, the following result readily follows.
Proposition 3.1 extends as follows.
Conversely, we need to prove that ψ(G) = ψ(G 1 )ψ(G 2 ) implies either that G is a clique or that G is the disjoint union of G 1 and G 2 .Examine the subsets of order three of V (G); in order to have equality in the x 3 term, we must have that every set of three vertices with two vertices in one of G 1 , G 2 and one vertex in the other must be in general position.Suppose that there is an edge between G 1 and G 2 in G; we show that G must be complete.Let e be an edge from G 1 to G 2 with endpoints u ∈ V (G 1 ) and v ∈ V (G 2 ).Let u ′ be any neighbour of u in G 1 ; as {u, u ′ , v} must be in general position, it follows that v ∼ u ′ .Inductively, we conclude that u is adjacent to every vertex of G 1 ; furthermore, it follows that if u 1 and u 2 are non-adjacent vertices in G 1 , then u 1 , v, u 2 would not be in general position, so G 1 is a clique.Similarly G 2 must be a clique and we must have every edge between G 1 and G 2 .
If G and H are disjoint graphs, then the join G∨H of G and H is the graph with the vertex set V (G∨H) = V (G)∪V (H), and the edge set where c i is the number of cliques of order i in G, cf.[12].Similarly, the independent union of cliques polynomial C i (G) has coefficients equal to the number of independent union of cliques in G. Since a set S ⊆ V (G 1 ∨ G 2 ) is in general position if and only if either it induces a clique in both G 1 and G 2 , or S is an induced union of cliques in G 1 or G 2 , the above discussion yields the following relation between the general position polynomial and the two clique polynomials.
We now turn our attention to the Cartesian product of graphs.Recall that the Cartesian product G H of graphs G and H has the vertex set For the general position number of the Cartesian product of two paths we have (cf.[21]): Moreover, in [17, Theorem 2.1] it was proved that the number of general position sets in P r P s of cardinality gp(P r P s ) is equal to From (3) we immediately obtain the general position polynomial of thin grids: For larger grids we have: Proof.Let r, s ≥ 3. It follows from (2) that ψ(P r P s ) is of degree 4. From (3) we get the leading coefficient, while coefficients of x 2 , x 1 and x 0 are obviously rs 2 , rs and 1, respectively.Consider the number of general position sets with three vertices.There are rs 3 3-subsets of V (P r P s ), but some of them are not in general position.In the following, we count the number of 3-subsets of V (P r P s ) that are not in general position.
1.There are r s 3 and s r 3 sets where all vertices are in the same horizontal or vertical layer.
2. Consider the case where exactly two are in the same horizontal layer (the case where they are in the same vertical layer is similar).Suppose that the second coordinate is k.The one with smaller first coordinate has r − 1 possibilities; suppose it is i, while the one with greater coordinate can be in {i + 1, . . ., r}, say j.Since the triplet is not in general position, the third vertex can have any other second coordinate (any of {1, . . ., k − 1, k + 1, . . ., s}), and for its first coordinate x either x ≤ i or x ≥ j.Using the same reasoning for the case where two coordinates are in the same vertical layer and subtract the cases where both of them are the same, we obtain that in this case the number of sets that are not in general position is equal to 3. The last case is vertices (x 1 , y 1 ), (x 2 , y 2 ) and (x 3 , y 3 ), where x 1 < x 2 < x 3 and either y 1 < y 2 < y 3 or y 1 > y 2 > y 3 .There are: such sets.
By subtracting from the number of all sets the number of sets that are not in general position, we get this simplified expression: representing the coefficient of the x 3 term in the general position polynomial.

Unimodality
In this section we consider the unimodality of the general position polynomial.First, it is not unimodal in general as shown by the following example, which follows from Proposition 2.1(v): Another complete bipartite graph for which the general position polynomial is not unimodal is K 9,7 .
In view of the above example and the situation with the independence polynomial, we can ask ourselves whether the general position polynomial is unimodal on trees.The answer is negative as we now demonstrate.A broom B s,r , s ≥ 0, r ≥ 0, is a graph with vertices u 0 , . . ., u s , v 1 , . . ., v r , and edges u i u i+1 for i ∈ {0, . . ., s − 1} and u 0 v j for j ∈ [r].See Fig. 2 for an example.
It is straightforward to check that The smallest broom whose general position polynomial is not unimodal is B 17,6 ; its general position polynomial is Moreover, one can calculate that if holds, and hence there are infinitely many brooms for which the general position polynomial is not unimodal.
On the positive side, we first prove that the general position polynomial of comb graphs are unimodal.Recall that the comb G n , n ≥ 1, is obtained from the path P n by respectively attaching a pendent vertex to each of its vertices.
Clearly, a 0 = 1, a 1 = 2n, and a 2 = 2n 2 .For k ≥ 3, we can determine a k by distinguishing between zero, one or two vertices from the general position set belonging to the path P n in G: In particular, a 3 = 2 3 (n − 2)(n − 1)n, and a 3 ≥ a 2 if and only if n ≥ 6.If n = 1, then G 1 = K 2 , while if n = 2, then G 2 = P 4 , and their polynomials are unimodal.For n ∈ {3, 4, 5}, we calculate the polynomials explicitly to check that they are also unimodal: For n ≥ 6, we already know that a 0 ≤ a 1 ≤ a 2 ≤ a 3 , thus it only remains to show that the sequence (a k ) k≥3 is unimodal.The difference between two terms in ψ(G) for 3 ≤ k ≤ n − 1 can be simplified as follows: Another family of graphs for which the general position polynomial is unimodal is the class of Kneser graphs K(n, 2).Recall that the vertex set of K(n, 2) contains all 2-subsets of an n-set, two vertices being adjacent if the corresponding sets are disjoint.At the end of Section 2 we have considered the special case P = K(5, 2).
Proof.We first determine the general position polynomial of K(n, 2).Recall from [20] that General position sets of size j ∈ {2, . . ., n − 1} can be cliques or independent sets, and for j ≥ 7 this is the only possibility.To form a clique on j vertices in K(n, 2), select 2j elements of the n-set (this can be done in n 2j ways) and put them into unordered pairs ( 2j 2,...,2 1 j! = (2j)! 2 j j! options).An independent set on j vertices can be of the form {ax 1 , . . ., ax j }, where a, x 1 , . . ., x j are distinct elements of the n-set.There are n n−1 j such sets.For j ≥ 4, all independent sets are of this form.However, for j = 3, independent sets can also take the form {ab, bc, ac}, where a, b, c are distinct elements of the n-set.For j ∈ {3, . . ., 6}, several additional types of general position sets are possible.On six vertices, 3K 2 forms a general position set, and there are n 4 such sets (they are of the form {ab, cd, ac, bd, ad, bc}).On five vertices, 2K 2 • ∪ K 1 is also a general position set, and it can be obtained by removing one vertex from the general position set on six vertices, thus there are 6 n 4 of them.Similarly, on four vertices, 2K 2 or K 2 • ∪ 2K 1 are also independent sets.They are obtained by removing two vertices from the general position set on six vertices, so there are 6   2 n 4 = 12 n 4 of them.On three vertices, we need to consider the additional type of independent sets as well, and there are n 3 of them.By removing three vertices from a general position set on six vertices we can also obtain a set of three vertices in general position that induces a copy of K 2 • ∪ K 1 , but these vertices must not belong to three copies of different K 2 .Thus there are 6  3 − 2 3 n 4 = 12 n 4 .Therefore: We can check by computer that ψ(K(n, 2)) is unimodal for 2 ≤ n ≤ 16.For n ≥ 17, the following inequalities hold: To show unimodality, we simplify the difference To determine for which k the difference a k −a k+1 ≥ 0 and for which k it is a k −a k+1 ≤ 0, we only need to consider the terms ≤ k ≤ n 2 − 1, we have A ≤ 0 and B ≥ 0. In the following we will prove that 2 , we have A < 0, n + 2 − (n − 2k) 2 ≤ 0 and for all j ∈ [k − 1], n − 2k + j ≥ 0, thus B ≤ 0. It follows that a k − a k+1 < 0.
It remains to prove that the above cases indeed cover all integers k, 7 ≤ k ≤ n − 1.
To see this we need to prove that no integer lies in the interval n 2 .Simplifying and squaring this chain of inequalities yields n + 1 < (n − 2m) 2 < n + 2. But since n + 1 and n + 2 are consecutive integers, we obtain a contradiction.Thus we have proved that (a k ) k≥7 is unimodal.
The following family of graphs T * (r, a) from [25] yields another family of graphs with unimodal general position polynomial.Take a complete a-partite graph, each part of which contains r vertices and label the vertices in part i by i 1 , . . ., i r .Then for each i ∈ [r], delete the edges of the clique induced by the vertices i 1 , . . ., i a .Now suppose that S is a general position set of T * (r, a).Any subset lying in a single partite set is in general position.Suppose that S contains three vertices (say with labels 1,2,3) in part A; then S can contain no vertices from other partite sets, for when we add a new vertex x from another part, the label of x will differ from that of at least two vertices of S. Suppose then that S contains two vertices a 1 , a 2 of a part A (say with labels 1,2); by the same reasoning S can only contain vertices with labels 1 and 2. If S intersects only two parts, it will be in general position, inducing either a K 2 • ∪ K 1 or a 2K 2 .However, S cannot contain vertices from more than two partite sets; if S contains a vertex b 1 with label 1 in a part B and a vertex c 1 with label 1 in a part C, then b 1 , a 2 , c 1 is a shortest path, whereas if S contains a vertex b 1 in B with label 1 and a vertex c 2 with label 2 in C, then b 1 , c 2 , a 1 would again be a shortest path.It follows that the general position polynomial of this graph is given by where n = ra.Observe that the sequence (2 r i ) i≥3 is unimodal.Thus if we can prove that the initial coefficients of ψ(T * (r, 2)) are increasing, the general position polynomial is also unimodal.This holds for r ≥ 10, as The unimodality of the remaining cases can be checked by hand, see Table 2.

Concluding remarks
Recall that the corona G • K 1 of a graph G is obtained from G by attaching a pendent vertex to each the vertices of G.We wonder whether the following extension of Theorem 4.1 holds: Problem 5.1.Assume that ψ(G) is unimodal.Then is ψ(G • K 1 ) also unimodal?
In Proposition 4.3 we have proved that if a ∈ {1, 2}, then T * (r, a) is unimodal.This leads to: Problem 5.2.For which pairs (r, a) is the graph T * (r, a) unimodal?
For example, T * (r, 3) is unimodal if r ≥ 19, but also for some smaller values of r.
Several variations of the general position number have been investigated in the literature.For example, a set S ⊆ V (G) is in monophonic position if no induced path of G contains three vertices of S (see [24]), whilst S is a mutual-visibility set if for any u, v ∈ S there exists a shortest u, v-path in G that does not pass through S \ {u, v} (see [9]).We suggest than an interesting direction for future research would be to explore the polynomials counting such sets and their relation to the general position polynomials.

Table 1 :
Number of different occurrences of the same number of maximal general position sets in an intersection having the same size of intersection.
Combining Proposition 2.2 with Table 1 yields: