Mean distance on metric graphs

We introduce a natural notion of mean (or average) distance in the context of compact metric graphs, and study its relation to geometric properties of the graph. We show that it exhibits a striking number of parallels to the reciprocal of the spectral gap of the graph Laplacian with standard vertex conditions: it is maximised among all graphs of fixed length by the path graph (interval), or by the loop in the restricted class of doubly connected graphs, and it is minimised among all graphs of fixed length and number of edges by the equilateral flower graph. We also establish bounds for the correctly scaled product of the spectral gap and the square of the mean distance which depend only on combinatorial, and not metric, features of the graph. This raises the open question whether this product admits absolute upper and lower bounds valid on all compact metric graphs.


Introduction
Our aim is to study the notion of mean, or average, distance on metric graphs.Metric graphs have been studied in mathematics for over 40 years, at least since [22].They consist of collections of intervals whose endpoints are suitably identified to create a connected network structure, and display many features which mirror those of combinatorial, i.e. discrete, graphs; but at times they exhibit more complex behaviour reminiscent of (higher dimensional) Euclidean domains or manifolds, thanks to their continuous metric structure.In particular, it is possible to define differential operators such as Laplacians on metric graphs, see [4,20,28]; in the last decade or so, the interplay between the geometry of the graph and the Laplacian spectrum has received considerable attention, see, e.g., [3,20] and the references therein.
At the same time, mean distance does not previously seem to have been considered on metric graphs.On combinatorial graphs a corresponding notion was already actively investigated in the late 20th Century; in fact, it seems difficult to determine a precise birthdate of the theory, as there the mean distance is, up to a normalising factor, simply the ℓ 1 -norm of the distance matrix.According to [12], this and related quantities were first studied by Harary [17] and Ore [31] as graph-based sociometric quantities; while in [16] the authors trace the origin of this notion back to an even earlier study in quantum chemistry [35].Subsequently, mean distance has grown to be an important quantity in combinatorial geometry ever since [9,12,32], and it has also played an important role in inverse combinatorial problems [7].The interplay of the ℓ 1 -norm of the distance matrix with the geometry and potential theory of graphs was investigated more recently, in [34]; in particular, a new notion of curvature is suggested that, in particular, agrees with the mean distance function whenever the latter is vertex-wise constant.As a further development that is closer to our main interest in this article, let us mention that one topic of interest since at least the 1970s has been to study the relationship between the combinatorial mean distance and the eigenvalues of the discrete graph Laplacian, see, e.g., [16,25], and see below.
Our goals here are essentially twofold.First, we will develop fundamental geometric bounds for the mean distance of a (compact) metric graph: on the one hand, it seems that the mean distance is another, and arguably quite fine, quantity that measures how well connected the graph is, just like the Cheeger constant and the vertex connectivity do (as our estimates will show).On the other, in practice it is somewhat difficult to compute, thus providing a need for such estimates.What we will show (see Theorem 3.2) is that the mean distance is maximised among all graphs of given total length when the graph is a path, i.e. interval (or a loop among doubly connected graphs); and maximised among all graphs of given total length and number of edges when the graph is a so-called equilateral flower graph.
These results have strong parallels with both the behaviour of mean distance on combinatorial graphs, and the spectral gap µ 2 of the standard Laplacian on metric graphs.On combinatorial graphs it has been known for decades that mean distance is minimised on complete graphs [12,Theorem 2.3] and maximised on path graphs [9,Corollary 1.3], or on cycles among doubly-connected graphs [32,Theorem 6].This in turn mirrors inversely what is known regarding the spectral gap of the combinatorial Laplacian, that is, the algebraic connectivity: it is famously minimised by path graphs and maximised by complete graphs, see [13].This strong inverse relationship in the discrete world has been studied: for example, in [25], quite sophisticated estimates on the lowest positive eigenvalue of the discrete Laplacian are derived in terms of the mean distance in combination with the size of the graph and its maximal degree (see also [26]); as a more recent contribution to this field we mention [33].
Regarding the spectral gap µ 2 of the standard Laplacian on metric graphs, it is known that µ 2 is minimised on the path graph [30,Théorème 3.1], or the cycle among doublyconnected graphs [1, Theorem 2.1], and maximised, under a constraint on the number of edges, among others by the equilateral flower graph [18,Theorem 4.2].Thus, in particular, the strong correspondence in the discrete setting also seems to hold in the metric one.
Our second goal is thus to investigate precisely the relationship between the mean distance ρ and the spectral gap µ 2 .We will provide several upper and lower bounds on the product µ 2 ρ 2 (scaled in such a way as to be independent of the total length of the graph), see Theorem 3.5 and Corollaries 3.3 and 3.6, which depend only on the number of edges of the graph and/or its (first) Betti number (number of independent cycles); in the case of trees one can find an absolute constant as an upper bound, π 2 .These bounds in general do not appear to be optimal, and the natural question arises as to whether the product µ 2 ρ 2 admits absolute upper and lower bounds valid for any compact graph, which we leave as an open problem (Open Problem 3.4).
This paper is structured as follows.In Section 2 we will introduce our general framework and provide a definition of mean distance ρ on a metric graph.All our main resultsgeometric estimates for ρ as well as bounds linking ρ and the spectral gap of the standard Laplacian -are collected in Section 3. In addition to Theorem 3.2, we also include a statement on the relationship between ρ and the diameter of the graph, Theorem 3.1.
The proofs, which rely on various techniques, are spread throughout the remaining sections: first, we give several explicit examples in Section 4, namely star graphs (including intervals, see Example 4.1), a special type of "firework graph" which shows that mean distance can be arbitrarily close to diameter (Example 4.2), and flower graphs (including loops, Example 4.3), whose analysis is essential for one of the main geometric bounds in Theorem 3.2.
Then, in Section 5, we study surgery principles for mean distance, which will be used to prove Theorem 3.2.These principles are inspired by analogous ones developed in recent years for spectral and torsional quantities on metric graphs (see in particular [3]), but, curiously, such surgical methods also play a role in some of the early combinatorial works; we refer to [16,Sections 5.3 and 5.4] for an overview of results in this direction.However, while there are parallels to surgery for spectral quantities, in concrete terms and in the details our results and proofs are quite different as there is currently no known variational characterisation of mean distance (cf.Remark 7.2); instead, one needs to analyse more directly the effect of altering a graph on its distance function.There are also notable differences in some results; attaching a so-called pendant edge to a graph has an indeterminate effect on ρ, despite always lowering µ 2 (see Proposition 5.3).
In Section 6 we will provide the proof that among doubly connected graphs of given length the mean distance is maximised on the loop, the last remaining part of Theorem 3.2.Here, somewhat surprisingly, it is natural to use a symmetrisation argument based on the coarea formula and inspired by the approach of Friedlander for minimising standard Laplacian eigenvalues [14]; however, here again, the actual technical nature of the proof is very different as mean distance is not characterised as a minimising quantity.
Finally, in Section 7, we give a proof of the lower bound in Theorem 3.5 on the product of ρ and the spectral gap using variational methods for the latter.
Before continuing, we mention the very recent paper [15], which we became aware of shortly before submitting the present paper: seemingly unaware of the theory of metric graphs, the authors of [15] introduce a notion of mean distance that agrees with ours and discuss the complexity of its computing.
We note that the notion of mean distance is in fact a natural one in any metric measure space of finite diameter and volume.In the spirit of [8], it would be natural to introduce the mean distance of further, possibly more general metric measure spaces: an interesting estimate on the lowest positive eigenvalue of the Laplace-Beltrami operator of a compact Riemannian manifold was already announced, but not proved, in [24].More modestly, one could try and extend the scope of our results to metric graphs of finite total length but an infinite number of edges.Since many of our methods are most natural in the compact case of finitely many edges, and tailored to graphs, to reduce technical complications and keep the work self-contained we will restrict to this case and not consider such possible generalisations here.

Notation and assumptions
Throughout, we consider metric graphs G := (V, E, ℓ) consisting of a finite number V := #V of vertices and E := #E of edges; we denote by β = E − V + 1 the (first) Betti number of G, the number of independent cycles it contains.
Unlike in the case of combinatorial graphs, we create a metric structure by associating each edge e with a real interval (0, ℓ e ) of length ℓ e > 0, which we may regard as a parametrisation of the edge.While this parametrisation implies an orientation of each edge, all quantities considered will be independent of these orientations.In particular, the total length |G| of G is, by definition A distance on G is introduced by first considering the Euclidean distance on each metric edge and then extending it to a (pseudo-)metric dist on G by the usual shortest-path construction (we will also sometimes write dist G in those cases where it becomes necessary to specify the graph).
To avoid trivialities, we will always assume without further comment that the metric graph is connected.A metric graph then canonically becomes a metric measure space (G, dist, dx) upon endowing each metric edge with the 1-dimensional Lebesgue measure dx.This metric measure structure immediately induces the spaces C(G) and L 2 (G) of continuous and square integrable functions over G, respectively.We will also need the Sobolev space As is well known, all these spaces are, up to a canonical identification, independent of the choice of parametrisation of the edges, and in particular of the corresponding orientation.
Our assumptions, namely that there are only finitely many edges each of finite length, imply that as a metric space G is compact and in particular has finite diameter.In this case, as is standard, we will refer to G as a compact metric graph.(We refer to [4,27] for a more detailed introduction to the notion of metric graphs.) Our compactness assumption on G implies that the following natural notion of mean distance is well defined.
we will call ρ G (x) the mean distance from x on G.The mean distance on G is then defined as the mean value of ρ G , (As mentioned in the introduction, this concept has been studied for decades in graph theory, where it is commonly referred to as either "mean distance" or "average distance" in the literature; we will always use the former.) It would be possible to extend this definition to graphs of finite total length but an infinite number of edges; however, as many of our techniques are naturally adapted to the compact case, and to keep the exposition more simple, we will not do so.
Beyond estimates on the mean distance of a graph G in terms of quantities such as the total length, the number of edges and the Betti number of the graph, we will be particularly interested in the interplay between the mean distance and the spectrum of the corresponding Laplacian −∆ G with standard vertex conditions, in particular as regards its spectral gap (see, e.g., [3,4]).For our purposes the following characterisation will suffice.
This quantity is known to be strictly positive since G is compact and connected.

Main results
We start with a simple observation on the relationship between ρ(G) and the diameter diam(G); completely analogous results have been known to hold for discrete graphs since the 1970s (see [9]).While the (strict) inequality is rather obvious, the key point is that the inequality is sharp nonetheless.
Moreover, there exists a sequence of graphs G n for which ρ(Gn) diam(Gn) → 1 as n → ∞.Proof.For (3.1), by definition of ρ and Cauchy-Schwarz, the strict inequality being due to the linear independence of dist and 1.For a sequence of graphs G n for which ρ(Gn) diam(Gn) → 1 we will consider "firework" graphs similar to the (discrete) ones used in [9] to prove a corresponding assertion for the discrete mean distance; these will be given in Example 4.2 below.
We now turn to our first main result, which consists of fundamental upper and lower bounds on ρ in terms only of the length, and the length and number of edges, of the graph G, respectively.As discussed in the introduction, these closely mirror those for the (inverse of the) first nontrivial standard Laplacian eigenvalue µ 2 (G): this eigenvalue admits a lower bound depending only on length [30, Théorème 3.1], with equality for path graphs (i.e.intervals); there is an improved lower bound for doubly connected graphs depending only on length and with equality for loops [1, Theorem 2.1].There is a corresponding upper bound based only on length and number of edges, with equality for equilateral flower graphs, among others [18,Theorem 4.2].Our result is: Theorem 3.2.Let G be a compact metric graph with total length |G| = L > 0 and E edges.Then with equality in the lower bound if and only if G is an equilateral flower graph, and equality in the upper bound if and only if G is a path graph (i.e.interval).If G is doubly connected, then the upper bound may be improved to with equality if and only if G is a loop.
For (3.3) we will use surgery methods, which are the subject of Section 5; the proof of (3.3) is given at the end of that section.To prove (3.4) we will use a symmetrisation-type argument based on the coarea formula (which, curiously, does not seem to work in the base case), see Section 6.
Since ρ and µ 2 satisfy compatible bounds, we can also find two-sided bounds for the scale invariant quantity µ 2 (G)ρ(G) 2 : Corollary 3.3.Let G be a compact metric graph with E edges and first Betti number The fact that the respective minimisers and maximisers are in perfect correspondence, and more generally that the two quantities behave so analogously, suggests that there may actually be absolute upper and lower bounds, i.e., absolute constants independent of every graph which control µ 2 (G)ρ(G) 2 from above and below.At least for trees, (3.5) gives an absolute upper bound on this quantity (namely min{ π 2 E 2 9 , π 2 }), which is sharp for path graphs I, where µ 2 (I)ρ(I) 2 = π 2 9 .However, a direct computation using the values obtained in Section 4 shows that both for equilateral flowers and stars the product µ 2 ρ 2 is monotonically increasing and approaches π 2 4 as E → ∞.We note that there is a certain parallel between the mean distance of a metric graph and (upon imposing a Dirichlet condition on at least one vertex) its torsional rigidity, as the latter is known, too, to be maximised precisely by path graphs and minimised precisely by equilateral flowers, see [29,Section 4]: this behaviour is precisely opposite to that of the lowest positive Laplacian eigenvalue, so it seems natural to pose the following, once appropriate scaling is accounted for.
Open Problem 3.4.Do there exist absolute constants C, c > 0 such that for all compact graphs G?
Indeed, the conjectured lower bound recalls the celebrated Kohler-Jobin inequality, which asserts that, in R d , the normalised quantity λ 1 (Ω)τ (Ω) 2 d+2 (with λ 1 the first Dirichlet Laplacian eigenvalue and τ the torsional rigidity of Ω) is minimised when Ω is a ball (see [19] or, e.g., [5,6] for more recent results in the area, as well as [29,Theorem 5.8] for the metric graph case).This, as well as our examples in Section 4, provide some weak evidence suggesting that the path graph might actually minimise µ 2 ρ 2 , which, if true, would result in an optimal value of c = π We can give an alternative lower bound on ρ involving the total length and µ 2 , which in combination with the lower bound in Theorem 3.2 leads to an alternative to the lower bound in Corollary 3.3: While still unlikely to be optimal, this is generally better than the lower bound in Corollary 3.3; as E → ∞ it behaves like 1 2E rather than π 2 4E 2 .In fact, the lower bound in Corollary 3.6 is seen to be larger whenever The proof of Theorem 3.5 is based on a suitable eigenvalue comparison argument, which involves linking the first eigenvalue of an auxiliary problem with a Dirichlet condition at a well-chosen vertex on the one hand, and a related distance function on the other, and is given in Section 7.

Examples
Here we will collect some examples where one can determine ρ explicitly: equilateral star graphs (including path graphs, i.e. intervals, as a special case), the "firework graphs" that will be used to complete the proof of Theorem 3.1, and equilateral flowers (including on one edge, i.e. loops).For purposes of legibility, we will generally use m and n to denote the number of edges and vertices, respectively, of our example graphs.
Example 4.1 (Star graph).For a given m ≥ 1 and L > 0, consider S m an equilateral star graph, that is, a graph with m edges of equal length ℓ := L m (and thus total length L) and m + 1 vertices, one of degree m (the "central vertex") and all others of degree 1.To calculate ρ, we identify each of the m identical edges with an interval of the form [0, L m ], where 0 corresponds to the central vertex.Then, for any x ∈ S m , note that this includes the special case of an interval I (m = 1, with the interval parametrised as [0, L]), where Integrating ρ Sm over all x ∈ [0, L m ] (and using the symmetry of the graph) yields Let us consider the behaviour of the formula as a function of m.If m = 1 or m = 2, then ρ(S m ) = L 3 , which is exactly the value of ρ on an interval (note that stars on one and two edges are both path graphs).Now fix L, then since the function x → L x 2 (x − 2 3 ), x > 0, attains its maximum at x = 4 3 (and the same value at x = 1 and x = 2), and is monotonically decreasing for x > 4  3 , the maximum in m is attained at m = 1, 2, and ρ(S m ) is a decreasing function of m ≥ 1.We observe that ρ(S m ) → 0 as m → ∞.
If instead we fix the length of each edge ℓ = L m (and vary m), then We next consider a class of graphs built around stars, which include the sequence G n referred to in Theorem 3.1, for which ρ(Gn) diam(Gn) → 1.
Example 4.2 (Firework graph).Here we will construct a four-parameter family of graphs, which for simplicity we will simply call G, as follows.We start with an equilateral star on m ≥ 1 edges, each of length J > 0, and then attach, at each of the m degree one vertices, a copy of another star * with n edges of equal length j; see Figure 4.1.In particular, |G| = mJ + mnj, and diam(G) = 2J + 2j.We will show that, for the correct choice of m, n, J, j, ρ(G) can be made arbitrarily close to diam(G) in the sense of Theorem 3.1; for this we merely need to estimate ρ(G) from below.First, it is obvious that, for any x ∈ G in any copy of * , Indeed, we may estimate dist(x, y) from below by 2J for each y in each of the other m − 1 copies of * ; this can then be integrated over all such copies, each of which has total length nj.This then leads to Fixing m and J, we consider any sequence of such graphs for which j → 0 but simultaneously nj → ∞, then n 2 j 2 (J+nj) 2 → 1 and diam(G) → 2J.We can thus, given any ε > 0, find such a firework graph G m,ε for which From this we can extract a sequence of graphs satisfying the conclusion of Theorem 3.1.
For our third example we consider the flower graphs which will play a role in the lower bound in Theorem 3.2.We will calculate mean distance only in the case of equilateral flowers, but Lemma 4.4 below gives a comparison with the non-equilateral case.
Example 4.3 (Flower graph).Given m ≥ 1 and L > 0, take F m to be the flower graph consisting of m edges of length ℓ = L m each, all glued at both ends at a common central vertex; that is, F m has exactly one vertex, of degree 2m.
We start by noting the following formula for the integral of the distance function dist(x, y) over a circle C (of length L m ), i.e., when both x and y are taken from the same petal, which can be obtained by a direct calculation: parametrising the loop by [− L 2m , L 2m ], with x ≃ 0 and the points L 2m and − L 2m , identified in C, representing the antipodal point to x, we have This is, in particular, independent of x and y; and thus, for all x ∈ C We now return to the flower.For convenience, for the rest of the example we will parametrise the edges as follows: we consider each loop (or petal) of the flower at having a dummy vertex at the far point from the central vertex, and identify the loop with [− L 2m , L 2m ], where 0 corresponds to the central vertex, and the points − L 2m and L 2m are identified at the dummy vertex.
We can now calculate ρ Fm (x) for a given x ∈ F m .With the above parametrisation of the edges, Integrating over x ∈ [− L 2m , L 2m ] and using the symmetry of the graph finally yields Let us consider how ρ behaves as a function of m ≥ 1.If the total length L is fixed, then, since x → L 4x ( 2x−1 x ) attains a global maximum for x > 0 between 0 and 1, then decreasing to 0 as x → ∞, it follows that ρ(F m ) attains its maximum at m = 1, is strictly monotonically decreasing in m ≥ 1, and ρ(F m ) → 0 as m → ∞.
If instead we fix the length of each edge ℓ = L m , we have We finish this section with an optimisation result for flower graphs, which will be needed in the proof of the lower bound in (3.3) in Section 5.While elementary, its proof is necessarily somewhat technical.Lemma 4.4.For any flower graph F of total length L, on m edges, we have with equality if and only if F is an equilateral flower on m edges of length L/m each.
Proof.Fix a flower graph F with edge lengths ℓ 1 , . . ., ℓ m , so that m i=1 ℓ i = L, and denote by 0 the central vertex.We start by recalling from (4.2) that, if C is a loop of length ℓ > 0, then ρ C (x) = ℓ 4 for all x ∈ C, and so as well.Now a similar calculation to the one for the equilateral flower graph yields that, for any given x ∈ F , supposing that x ∈ e i and where dist(x, 0) represents the distance between x and the central vertex 0. Integrating over the corresponding edge e i gives We will now examine what happens if we perturb the lengths of two petals of F , without loss of generality e 1 and e 2 , in such a way that the overall length remains constant: we will, in effect, consider ∂ρ ∂ℓ 1 under the assumption that ℓ 3 , . . ., ℓ m are constant, and To this end we first multiply out the constant term 4L 2 and isolate the parts of (4.3) that depend on ℓ 1 and ℓ 2 : , where since the latter sum does not depend on ℓ 1 or ℓ 2 , we may treat it as a constant d and subtract it from the total; we will thus work with the quantity D := 4L 2 ρ(F ) − d, which we will attempt to minimise in function of ℓ 1 .To simplify the calculation, we will set B := m i=3 ℓ i and C := ℓ 1 + ℓ 2 , which we recall we are treating as constant; we also recall that L = m i=1 ℓ i , and in particular L = B + C. We may then calculate Writing ℓ 2 = L − B − ℓ 1 , we may simplify this to since L − B does not depend on ℓ 1 , under our assumptions we may rewrite D as In particular, ∂D ∂ℓ 1 (itself equal to 4L 2 ∂ρ ∂ℓ 1 ) is zero if and only if moreover, this represents the unique global minimum of D (and thus of ρ) for Summarising, among all flowers on m petals of given total length L and fixed edge lengths ℓ 3 , . . ., ℓ m , ρ is minimised exactly when ℓ 1 = ℓ 2 ; moreover, holding all other lengths fixed, any flower graph for which ℓ 1 = ℓ 2 will have strictly greater ρ than the one for which there is equality.
Hence, starting from any given non-equilateral flower F on m edges and iteratively applying this argument to pairs of its petals, we obtain a sequence of flower graphs with strictly decreasing ρ, whose edge lengths will converge in the limit to those of the equilateral flower.Since for fixed L > 0 and m ≥ 1, ρ is obviously continuous with respect to the m edge lengths (being a polynomial, see 4.3), which are drawn from a compact subset of [0, L] m , it is immediate that ρ must attain its unique global minimum among all flowers of length L > 0 on m edges, at the equilateral flower.

Surgery principles
In this section we list and prove two basic surgery principles for ρ, which we then use to prove our main bounds (3.3) (including the characterisation of equality).These principles, which give sufficient conditions under which making a "local" change to a graph G to create a new graph G (e.g.cutting through a vertex, lengthening an edge, attaching or removing a pendant graph) will raise or lower ρ; they are generally inspired by, and similar to, such surgery principles for eigenvalues of the Laplacian with standard vertex conditions (see [3]).There will certainly be many more such principles beyond these two, but these are the two needed to prove (3.3).
The first, cutting through vertices, has a long history in the context of Laplacian eigenvalues (going back at least to [21, Theorem 1] but implicit in the proof of [30,Théorème 3.1]).However, since we will not be working with a variational characterisation of ρ, the proof is completely different, and relies on comparing the respective mean distance functions ρ G and ρ G in a suitable way (but cf.Remark 7.2).The second, the key to the upper bound in (3.3), is a somewhat generalised version of the principle of "unfolding pendant edges", see [3,Theorem 3.18(4)], but with rather different hypotheses on the pendant graph being "unfolded" (see also Figure 5.1).Theorem 5.1 (Surgery principles for mean distance).Let G be a compact metric graph.
(1) Suppose G is formed from G by cutting through a vertex (see [3, Section 3.1]).Then ρ( G) > ρ(G) unless G = G (i.e., the cut is the trivial cut, where the cut vertex is unchanged).
Example 5.2.Suppose H = H = e 1 ∪ e 2 , but the point of attachment to G \ H = G \ H is changed, as depicted in Figure 5.1: Then both subgraphs may be identified with some interval [0, ℓ], ℓ > 0, with ρ H (x) = ρ H = x 2 ℓ − x + ℓ 2 (see (4.1)).In particular, since ℓ 2 > x 2 ℓ − x + ℓ 2 for any x ∈ (0, ℓ), and since in H we are taking the point of attachment as v ≃ 0 (whereas in H the point of attachment will be somewhere in (0, ℓ)), it follows that More difficult is the issue of lengthening an edge, that is, if G is formed from G by increasing the length of a given edge e (and thus, equally, the total length of the graph), holding the graph topology and all other edge lengths constant, do we have ρ( G) ≥ ρ(G)?A corresponding statement holds for the standard Laplacian eigenvalues (see [3, Corollary 3.12(1)]).In the related case of attaching a pendant graph at a vertex (see [3, Definition 3.9]), if one attaches a sufficiently short pendant edge at a vertex v, then ρ will actually decrease as long as ρ G (v) < ρ(G).This also provides an example whereby lengthening a (very short) edge will lower ρ (our thanks go to Noah Kravitz for pointing out this principle to us).Proposition 5.3.Suppose the family of graphs G ℓ is formed from G by attaching a pendant edge of length ℓ to G at a vertex v. Then the function Note that this result immediately applies, mutatis mutandis, if we lengthen any already existing pendant edge of G: we obtain a "Hadamard-type" formula for the derivative at ℓ = ℓ 0 given by d dℓ ρ(G ℓ ) where v 0 is the degree-one vertex at the end of the edge.This can be obtained as an immediate consequence of Proposition 5.3 by attaching a short edge to v 0 (turning the latter into a dummy vertex), or else by making a trivial adaptation of the proof of the proposition.
Proof of Theorem 5.1.In this proof it will be important to distinguish the distance functions on different graphs; thus we will write dist G for the distance function on G, and so on.
(1) Fix any two x, y ∈ G which are not in the image of the cut vertex in G, and recall that by definition dist G (x, y) is the infimum of the lengths of all paths between x and y in G. Canonically identifying x and y with points in G, we see that the set of paths between x and y in G can only be larger than its counterpart in G; thus the infimum is lower, Since this holds for all x, y outside a finite set, the desired inequality for ρ follows from the definition.
For the strict inequality, suppose v ∈ G is the vertex being cut, and v 1 , v 2 ∈ G are two distinct vertices obtained from the cut.Take ε > 0 to be less than a third of the minimum edge length in G (and thus in G as well).There will necessarily exist edges e 1 ∼ v 1 and e 2 ∼ v 2 in G, which are adjacent at v in G, but not at v 1 = v 2 in G.Then, in G, for all x ∈ e 1 ∩ B ε (v) and y ∈ e 2 ∩ B ε (v), dist G (x, y) ≤ 2ε.Now consider the shortest path from x to y in G.There are two possibilities: either it runs through an entire edge of G, in which case it must have length at least 3ε, or it is entirely contained in the union of e 1 and e 2 .Since e 1 and e 2 are not adjacent at v 1 = v 2 , is a C 1 -function of ℓ ≥ 0, with derivative at ℓ = 0 given by 2|G|ρ G (v); the other assertions of the proposition then follow directly upon applying the quotient rule to the function dist G ℓ (x, y) dx dy.
Using the fact that e is a pendant (and, as a subgraph, identifiable with an interval), we obtain since the mean distance from an arbitrarily chosen x ∈ e to v will be ℓ 2 , the mean distance from v to an arbitrary y ∈ G is, by definition, ρ G (v), and this mean over G needs to be integrated over the edge e of length ℓ to obtain the total integral value.Putting these together, it follows that for any ℓ ≥ 0 the derivative of the function (5.1) exists and at zero is given by as claimed.The statement of the proposition now follows.

Symmetrisation and doubly connected graphs
In this section we will prove the sharpened upper bound (3.4) for doubly connected graphs, including the characterisation of equality.We recall that a graph G is said to be doubly (path) connected if, for any x, y ∈ G, there exist two edgewise disjoint paths P 1 and P 2 in G connecting x and y (although we allow the paths to intersect at a finite number of vertices); equivalently, no edge of G is a bridge whose removal would disconnect G.
Unlike for (3.3), in this case there is a natural proof via symmetrisation using the same basic tool, the coarea formula, as Friedlander's symmetrisation-based proof of Nicaise' inequality [14] (see also [1,2], and Remark 6.3).We recall that the coarea formula states that valid for an integrable nonnegative function ϕ on some domain Ω (which can be a metric graph) and an absolutely continuous, integrable nonnegative function ψ (for metric graphs, see, e.g., [23] or [11,Lemma 4.6]).large classes of examples and some intuition suggest that loops should be the only graphs G with the property that ρ G (x) is constant independent of x, although we will not attempt to prove that here.Curiously, precisely this independence will play a central role in the symmetrisation argument.
Lemma 6.2.Let G be a compact, doubly connected graph of length L > 0. For each x ∈ G, The inequality is strict for at least one x 0 ∈ G (and thus all x in a small neighbourhood of x 0 ) if G is not a loop.
Proof.Fix x, y ∈ G. Since G is doubly connected, there exist at least two paths P 1 , P 2 in G from x to y, which can intersect at at most a finite set of points.It follows that |P 1 | + |P 2 | ≤ L and hence at least one path has length at most L 2 .If M (x) = L 2 for all x ∈ G, then for any x ∈ G there exists y ∈ G such that there are exactly two edgewise disjoint paths P 1 and P 2 from x to y, each of length exactly L 2 , whose union exhausts G.The only possibility is that G is a loop.
Proof of (3.4).We will show that, for any x ∈ G, we have that is, the pointwise value of ρ G is always below the constant value of ρ C on C. The inequality will follow immediately from (6.2).Fix x ∈ G and write ξ(t) := ξ x (t) := #{y : dist(x, y) = t} for the size of the level set of the corresponding distance function, for any 0 ≤ t ≤ M := M (x) ≤ L 2 .We extend ξ(t) by zero to a function on [0, L 2 ]; then, by the coarea formula (6.1), To see this, note that, obviously, Rearranging yields (6.3) and thus the pointwise comparison between ρ G and ρ C .The inequality statement in the theorem now follows immediately from Lemma 6.1, since which establishes (6.2) for arbitrary x ∈ G.
Finally, if G is not a loop, then there exists some x 0 ∈ G for which M (x 0 ) < L 2 .By a continuity argument, we can find δ, ε > 0 such that M (x) ≤ L 2 − ε for all x in a δ-neighbourhood of x 0 .For such x, we have we can thus sharpen (6.3) to and thus obtain for all x in a δ-neighbourhood of some x 0 ∈ G; in particular, the total measure of all such x ∈ G is at least 2δ.It follows that the inequality ρ(G) ≤ L 4 must be strict.
Remark 6.3.Curiously, it is not clear how this symmetrisation idea could be adapted to simply connected graphs and the interval: on the loop the mean distance function is constant, so we obtain a pointwise comparison between ρ G (x) and the constant value ρ C (x) = L 4 .To use such an argument compare an arbitrary graph with an interval (path graph) I, where ρ I (x) is not constant (see (4.1)), we would first need to find a way of associating, for each x ∈ G, some unique y x ∈ I such that then ρ G (x) ≤ ρ I (y x ).It is not at all clear how this should work.

A variational comparison method
This short section is devoted to the proof of Theorem 3.5.We first fix any point, without loss of generality a vertex, v ∈ G such that whose existence follows directly from the continuity of the function ρ G and the definition of ρ(G) as mean value of ρ G .We define to be the first eigenvalue of the Laplacian on G with a Dirichlet condition at v and standard conditions elsewhere (we allow that G \ {v} be disconnected; in this case the corresponding eigenfunctions may be supported on a proper subset of G).Fix any f ∈ H 1 (G) such that f (v) = 0.For x ∈ G we denote by P (v, x) any shortest path in G from v to x, then from Remark 7.2.We finish with some open-ended comments related to the observation that there is no obvious variational characterisation of ρ; it would be very interesting if one could be obtained as this would open up the use of more variational techniques to studying it, and would potentially offer insights into the parallels with the variational quantity µ 2 .
We note that, as is easy to see, for any given x ∈ G (with G a compact metric graph), the mean distance from x can be characterised as This principle can be used to rephrase slightly some of the arguments presented above, at least those which involve comparing two graphs G and G for which there is some kind of natural pointwise correspondence between them.For example, to prove Theorem 5.

Definition 2 . 1 .
The mean distance function on G is the function ρ

2 Figure 5 . 1 .
Figure 5.1."Unfolding pendant edges": replacing the configuration of e 1 ∪ e 2 in H by the one in H increases ρ.
y) dx dy (and noting that ℓ → |G ℓ | is a smooth function, with d dℓ |G ℓ | = 1 for all ℓ ≥ 0).Now, for fixed ℓ > 0, denoting by e = e(ℓ) the pendant edge of length ℓ attached to v, we have

2 M 2 −
ξ(t) dt; note that the first integral is necessarily nonnegative since the nonnegative functions ξ and 2 have the same L 1 -norm on [0, L 2 ], while ξ is supported only on [0, M ] ⊂ [0,L  2 ].(The first integral is seen to be zero if and only if

1 ( 1 )
one can use that there is a canonical identification G → G such that, under this identification, C(G) ⊂ C( G), with preservation of all function norms, and for almost every x, due to the weakened continuity requirement in G,{f ∈ H 1 (G), f (x) = 0, |f ′ | = 1 a.e.} ⊂ {f ∈ H 1 ( G), f (x) = 0, |f ′ | = 1 a.e.},whence ρ G (x) ≤ ρ G (x) for a.e.x.Integrating over x and using that |G| = | G| yields the result.This argument mirrors more closely the corresponding argument for µ 2 .