Theory and Applications of Graphs Theory and Applications of Graphs Recursive Formulas for Beans Functions of Graphs Recursive Formulas for Beans Functions of Graphs

In this paper, we regard each edge of a connected graph G as a line segment having a unit length, and focus on not only the “vertices” but also any “point” lying along such a line segment. So we can deﬁne the distance between two points on G as the length of a shortest curve joining them along G . The beans function B G ( x ) of a connected graph G is deﬁned as the maximum number of points on G such that any pair of points have distance at least x > 0. We shall show a recursive formula for B G ( x ) which enables us to determine the value of B G ( x ) for all x ≤ 1 by evaluating it only for 1 / 2 < x ≤ 1. As applications of this recursive formula, we shall propose an algorithm for computing B G ( x ) for a given value of x ≤ 1, and determine the beans functions of the complete graphs K n .


Introduction
A graph G = (V (G), E(G)) is usually defined as a composite structure of a non-empty and finite set V (G) and a family E(G) of 2-element subsets in V (G), possibly empty. Each element in V (G) is called a vertex while each element in E(G) is called an edge. To visualize this structure, we often draw a figure consisting of points and line segments, which correspond to vertices and edges, respectively. In this paper, we regard a graph G as such a 1-dimensional figure and consider that the line segments are mutually disjoint except at their endpoints. Then, there are infinitely many points on each edge, and an endpoint of an edge lies at a vertex. Note that we treat a "vertex" and a "point" as different objects. Furthermore, each edge is assumed to have a unit length.
Under this setting, we can define the distance d G (p, q) between two points p and q as the length of a shortest curve joining them along a connected graph G and make G be a metric space having the distance d G (·, ·). Of course, p and q may be not only intermediate points on line segments but also points at vertices. Now a graph G should be regarded as the set of points lying over its vertices and edges rather than a combinatorial structure.
In this situation, Negami [10] defined "beans functions" as follows. Let x > 0 be a positive real number. A set S of points on a connected graph G is called an x-set if for any points p, q ∈ S one has d(p, q) ≥ x. In particular, if S has the maximum cardinality among the x-sets in G, then S is said to be maximum. We denote the cardinality of a maximum x-set of G by B G (x). That is, B G (x) = |S| for a maximum x-set S. Then, we can regard B G (x) as a non-increasing function B G : R + → N, where R + = {x ∈ R : x > 0}, and call it the beans function of G.
For example, it is easy to see that B Cn (x) = max{⌊n/x⌋, 1} for the cycle C n of length n; it suffices to put points at equal intervals of length x. Similarly, we have B P n+1 (x) = ⌊n/x⌋ + 1 for the path of order n + 1. Such points arranged at equal intervals can be compared to a row of beans. That is why the function is called the "beans function".
The beans function is related to the following two interesting invariants of graphs. Let k be a non-negative integer. A subset I ⊆ V (G) is k-independent if any two vertices in I have distance at least k + 1. The k-independence number of G, denoted by α k (G), is the number of vertices in a maximum k-independent set of G. A subset X ⊆ E(G) is distance-k matching if any two edges in X have distance at least k. (The distance between two edges x = u 1 u 2 and y = v 1 v 2 is defined as the length of a shortest u i -v j path for i, j ∈ {1, 2}.) The distance-k matching number of G, denoted by µ k (G), is the number of edges in a maximum distance-k matching of G. Note that the values α 0 (G), µ 0 (G), α 1 (G) and µ 1 (G) are equal to |V (G)|, |E(G)|, the independence number of G and the matching number of G, respectively. Moreover, a distance-2 matching is usually called an induced matching. These invariants have been studied in various papers and are closely related to many other concepts (see [1,2,6,7,8,9,11,12] for examples). The magnitude relation between the beans function B G (x) for a given value of x ≥ 1 and each of the two invariants will be explained in detail in Section 2.
On the other hand, for x ≤ 1, Negami's and Enami's works [10,4] suggest that there might be a repeating pattern among the values of B G (x), as follows.
In addition, he has shown that B G (1/n) = n|E(G)| + t, that is, B G (x) attains the above lower bound when x = 1/n. Furthermore, Enami [4] has shown that B G (x) also attains the upper bound over every interval A n . Roughly speaking, B G (x) seems to increase by |E(G)| when n increments. In this paper, we shall conclude that this actually does also for any intermediate value x, showing the following recursive formula: Theorem 1.2. Let G be a connected graph and let x ≤ 1 be a positive real number. Then, It should be noticed that the function f (x) = x/(1 + x) is monotonically increasing and induces a one-to-one correspondence between A n and A n+1 . Thus, the above formula shows that the difference between B G (x)'s for corresponding values in A n and A n+1 is equal to |E(G)|. Using this, we can show the relation between the corresponding values in A n and A n+k as the following corollary. If x belongs to A n , then x/(1 + kx) belongs to A n+k and we This implies that the values of B G (x) over A 1 determines all values of B G (x). The formula in the following corollary makes it clearer. Notice that if x belongs to A n , then we have 1 = nx + ε with 0 ≤ ε < x and x/(1 − (n − 1)x) belongs to A 1 .
In Section 3, we shall prove Theorem 1.2 and its corollaries. As applications of our recursive formulas, we shall propose an algorithm for computing B G (x) for a given value of x ≤ 1 in Section 4, and we shall determine the beans functions of the complete graphs K n in Section 5. Our terminology for graph theory is quite standard and can be found in [3].

Relation to other invariants of graphs
Let G be a connected graph. When x ≥ 1, B G (x) is closely related to the combinatorial invariants of G mentioned in introduction, the k-independence number and the distance-k matching number.

Proof. A set of points located at each vertex in a maximum
let v i be a nearest vertex to p i . Since p i and v i lie on a common edge, which has length 1, we have d G (p i , v i ) ≤ 1/2. Then, for any two distinct points p i and p j , we have

Lemma 2.2. Let G be a connected graph and k be a non-negative integer. Then
Proof. A set of midpoints of edges in a maximum distance-k matching of G is a (k + 1)-set.
For each point p i for 1 ≤ i ≤ k, let e i be an edge containing p i . Since the length of e i is 1, p i is located at most 1 away from an endvertex of e i . Then, for any two distinct points p i and p j , we have e i ̸ = e j and By these lemmas, it is easy to show the following bounds of B G (x).

Recursive formulas
In this section, we prove the main theorem and its corollaries.
The set S e consists of the points in S lying along an edge e = uv. However, if a point p in S is located at a vertex v, then we choose only one of the edges incident to v, say e, and consider that p belongs to S e and to no others.
Suppose that S e is not empty for an edge e = uv and let p 1 , . . . , p k be the points in S e lying along e from u in this order. Thus, p k is the nearest point from v in S e . Replace each point p i with a new point p ′ i satisfying the following condition: After that, we add another point We can evaluate the distance between each consecutive pair of points p ′ 1 , . . . , p ′ k , p ′ k+1 as follows: Now let e 1 and e 2 be two edges having a common end w and let q ′ i be the nearest point from w in S ′ e i for i = 1, 2. Then each of q i 's can be obtained as either In the exceptional case, that is, when S e 1 or S e 2 are empty, we have Secondly, we shall show that Let S be a maximum y-set and let S e = {p 1 , . . . , p k+1 } be the set of points in S lying along an edge e = uv from u in this order. If S e is empty, then S with the midpoint of e added is still an y-set since y ≤ 1/2. This is contrary to the maximality of S. Thus, S e contains at least one point p 1 while the point p k+1 is the nearest point from v in S e . We may assume that d G (p i+1 , p i ) = y for i = 1, . . . , k after moving the points p i 's slightly toward p 1 .
Remove p k+1 from S e and replace each point Let S ′ e be the set of points so obtained from S e and put S ′ = ∪ e∈E(G) S ′ e . Now let e 1 and e 2 be two edges having a common end v and let q i be the nearest point from v in S e i . Combining the above equality, we can conclude that d G (q 1 , q 2 ) ≥ (1 + x)y = x in all cases. Thus, S ′ becomes an x-set and |S|−|E(G)| = |S ′ |. This implies that B G (y)−|E(G)| ≤ B G (x) and the desired inequality follows.
Then it is easy to see that the kth iteration of f can be given as: Applying the recursive formula given in Theorem 1.2, we can carry out the following calculation: Then it is easy to see that: x = X 1 + (n − 1)X Substituting this and k = n − 1 to the formula given in Corollary 1.3, we obtain the formula in the corollary.

Algorithm for computing the value of B G (x)
Our recursive formulas enable us to suggest an algorithm for computing the value of B G (x) for any connected graph G and for any given value of 0 < x ≤ 1, say x = a The computational complexity of this algorithm does not depend on the imput value of x = a and depends only on the graph G. Unfortunately, exponentially many configurations will be generated with no restriction. However, they should be restricted since any edge assigned 0 must be adjacent to another edge with 1 or 2 for example. In addition, by Theorem 1.1, we have known that |E(G)| ≤ B G (c) ≤ |E(G)| + |V (G)| − 1 for the corresponding value c, and hence we need to investigate possible configurations of at least |E(G)| and at most |E(G)| + |V (G)| − 1 points lying on G and their distances. More clever ideas might reduce the complexity of this algorithm.
Furthermore, we would like to find an algorithm for determining the formula for B G (x) over the interval A 1 , which is divided into several subintervals, like the formulas for B Km (x) of the complete graph of order m, which can be given in the next section. The authors have already discussed such dividing points of A 1 at which B G (x) is discontinuous in [5].
As one of applications of our recursive formulas for B G (x), we shall determine the beans functions of the complete graphs K m . It is easy to see that B K 1 (x) = 1, B K 2 (x) = ⌊1/x⌋ + 1 and B K 3 (x) = max{⌊3/x⌋, 1} for all x > 0. Thus, we shall assume that m ≥ 3 hereafter. If we know the values of B G (x) only for x ∈ A 1 , that is, 1/2 < x ≤ 1, then we can determine all values of B G (x). So we shall investigate the values of B Km (x), decomposing the interval A 1 = (1/2, 1] into four parts as follows.
Proof. It is clear that the set of the midpoints of all edges forms an x-set for any positive Let C be the family of cycles of length 3 in K m and let ∆ be any cycle in C. Let S be a maximum x-set with x ≤ 1. We denote the set of points of S contained in ∆ by S ∆ ; that is, Consider the partition S = ∪ e∈E(Km) S e of a maximum x-set in G as in the previous section and let E i be the set of edges e of G such that |S e | = i. Notice that |S e | may not coincide with the number of points in S lying along e since a point in G placed at a vertex v belongs to exactly one of S e 's for edges e incident to v. Here we assume that x > 1/2. Then each edge contains at most two points of S and hence E(

This implies that
in general. We shall use these notations throughout the proofs below.
A set of edges of a graph G is called a matching if no two edges in the set have a common end. A maximum matching in G is a matching of the maximum cardinality among all matchings in G and its cardinality is denoted by µ(G). (As remarked in Section 2, µ(G) = µ 1 (G).) It is clear that µ(G) = ⌊m/2⌋ for the complete graph K m . The set S consists of these |E(K m )| + 1 points and it is easy to see that it forms an x-set if If there are two edges in E 2 which have a common end, then they form a path of length 2 and the four points in S divide the path into at least three segments. One of these segments must have length at most 2/3. This implies that x ≤ 2/3, which is contrary to our assumption in the lemma. Thus, E 2 forms a matching in K m .
Assume that E 2 contains at least two edges, say u 1 v 1 and u 2 v 2 . Since E 2 is a matching, they have no common end and hence form two cycles u 1 v 1 u 2 v 2 and u 1 v 1 v 2 u 2 in K m . All edges in these cycles rather than u 1 v 1 and u 2 v 2 belong to E 0 ∪ E 1 . For each cycle, if none of the edges belongs to E 0 , then this cycle of length 4 contains six points in S and hence there is a pair of points p and q among the six with d Km (p, q) ≤ 4/6 = 2/3. This is contrary to our assumption in the lemma, again. Thus, any two edges in E 2 are joined by at least two edge in E 0 . This implies that |E 0 | ≥ 2 ≥ |E 2 |, which is contrary to |E 2 | > |E 0 |. Thus, E 2 contains only one edges and hence |E 2 | = 1 > |E 0 | = 0. Therefore, B Km (x) = |E(K m )| + 1 if 2/3 < x ≤ 3/4.

Lemma 5.3. If 3/5 < x ≤ 2/3, then we have
Proof. First, we shall show an example of an x-set in G for x ≤ 2/3. Let M be any maximum matching in K m , which has ⌊m/2⌋ edges. Place two points p and q on each edge uv in M so that d Km (p, u) = d Km (q, v) = 1/6. Add the midpoint of each of the other edges not belonging to M . It is easy to see that these |E(K m )| + ⌊m/2⌋ points form an x-set if x ≤ 2/3. Thus, , E 2 contains a pair of edges which have a common end. If there exist three edges in E 2 which form a path of length 3, then the path contains six points in S and is divided into at least five segments by these points. This implies that there are a pair of points p and q in S with d Km (p, q) ≤ 3/5, which is contrary to our assumption in the lemma. Thus, the subgraph ⟨E 2 ⟩ induced by E 2 in K m contains no path of length 3 and hence each of its components is isomorphic to the star K 1,s for some s ≥ 1.
If the edge between two vertices of degree 1 in such a component belonged to E 1 , then there would be a cycle of length 3 which contains five points and it would contain a pair of pints p and q in S with d Km (p, q) ≤ 3/5, contrary to our assumption, again. Therefore, any pair of the s vertices of degree 1 in the component isomorphic to K 1,s with s ≥ 2 are joined by an edge in E 0 and hence there are s edges in E 2 and s(s − 1)/2 such edges in E 0 around it. Thus, each component of ⟨E 2 ⟩ contributes to |E 2 | − |E 0 | by a non-positive number if s ≥ 3 and by 1 if s = 1, 2. We can choose one edge from each component of ⟨E 2 ⟩ to form a matching in K m and hence the number of components of ⟨E 2 ⟩ does not exceed µ(K m ).
In this situation, if there were a component with s ≥ 2, |E 2 | − |E 0 | would be less than µ(K m ). Thus, each component of ⟨E 2 ⟩ consists of a single edge with s = 1. This implies that E 2 must be a matching, but it is contrary to |E 2 | > µ(K m ). Therefore we have |S| = |E(K m )| + µ(K m ) and the lemma follows. In this case, the subgraph induced by E 2 in K m contains a cycle C and the cycle C contains 2|C| points in S. These points divides C into 2|C| segments and hence there is a pair of points p and q in S with d Km (p, q) ≤ |C|/2|C| = 1/2. This implies that x ≤ 1/2, contrary to our assumption in the lemma. Therefore, we have B Km (x) ≤ |E(K m )| + m − 1 if 1/2 < x ≤ 3/5 and the lemma follows.
Theorem 5.5. Let K m be the complete graph of order m ≥ 3 and let n ≥ 1 be any natural number. Then: Proof. We have evaluated the value of B Km (x) for 1/2 < x ≤ 1 in Lemmas 5.1, 5.2, 5.3 and 5.4. Our recursive formulas given by Theorem 1.2 and its corollaries enable us to determine the value of B Km (x) for a positive real number x ∈ A n = (1/(n + 1), 1/n], as follows.
Any formula in the lemmas can be expressed by the form B Km (x) = |E(K m )| + α(m) for x ∈ A 1 = (1/2, 1], where α(m) stands for a function depending only on m. Since X = x/(1 − (n − 1)x) belongs to A 1 , we have B Km (x) = B Km (X) + (n − 1)|E(K m )| = n|E(K m )| + α(m) by Corollary 1.4. The function f n−1 (x) = x/(1 + (n − 1)x) maps A 1 to A n bijectively and translates 1/2, 3/5, 2/3, 3/4 and 1 into 1/(n + 1), 3/(3n + 2), 2/(2n + 1), 3/(3n + 1) and 1/n, respectively. Thus, the first four cases in the formula correspond to the four cases given in Lemmas 8, 7 6 and 5 in order. Now, we shall determine the value of B Km (x) for x > 1. It is obvious that a pair of the farthest points lie at the midpoints of two non-adjacent edges in K m and that they have distance 2. Thus, we have B Km (x) = 1 for x > 2. Notice that each edge contains at most one of points in any x-set for x > 1.
Let M a maximum matching in K m and take the midpoint of each edge in M . Then, these ⌊m/2⌋ points form an x-set if x ≤ 2. Let S be an x-set for x ≤ 2 in K m . If B Km (x) > ⌊m/2⌋ = µ(K m ), then the edges containing points in S does not form a matching. Thus, there are two edges among them which have a common end and form a cycle of length 3 with another edge. Since such a cycle contains at least two points in S, then we have x ≤ 3/2. Therefore, B Km (x) = ⌊m/2⌋ if 3/2 < x ≤ 2.
Choose a vertex v of G and take the m − 1 points p lying on edges incident to v so that d Km (p, v) = 3/2. It is clear that these points form an x-set if x ≤ 3/2 and hence B Km (x) ≥ m − 1. Let S be a maximum x-set in K m . If B Km (x) > m − 1, then there is a cycle C consisting of some edges each of which contains one point in S. That is, C contains exactly |C| points in S and we conclude that x ≤ 1. Therefore, we have B Km (x) = m − 1 if 1 < x ≤ 3/2.
Notice that the theorem holds for K 3 of course. However, the second and third cases in the formula give the same value 3n + 1 and hence they should be unified to one case.