# 4.15 Geodesics

Given any two points in a graph or hypergraph one can find a (not necessarily unique) shortest path (or “geodesic”) between them, as measured by the number of edges or hyperedges traversed to go from one point to the other. Here are a few examples of such geodesics:

(*https://www.wolframcloud.com/obj/wolframphysics/TechPaper-Programs/\ Section-04/Geodesics-01.wl*) CloudGet["https://wolfr.am/L1PH6Rne"];(*Geodesics*) gtest = UndirectedGraph[ Rule @@@ ResourceFunction[ "WolframModel"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{1, 2}, {1, 3}}, 10, "FinalState"], Sequence[ VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "EdgeLineStyle"]] ]; Geodesics[gtest, #] & /@ {{{79, 207}}, {{143, 258}}}

A geodesic in effect defines the analog of a straight line in a graph or hypergraph, and by analogy with the way geodesics work in continuous spaces, we can use them to probe emergent geometry.

For example, in the case of positive curvature, we can expect that nearby geodesics diverge, while in the case of negative curvature they converge:

(*https://www.wolframcloud.com/obj/wolframphysics/TechPaper-Programs/\ Section-04/Geodesics-01.wl*) CloudGet["https://wolfr.am/L1PH6Rne"]; hyperboloidGeodesics = Table[ Part[ NDSolve[{Sinh[ 2 u[t]] ((2 Derivative[1][u][t]^2 - Derivative[1][v][t]^2)/( 2 Cosh[2 u[t]])) + Derivative[2][u][t] == 0, ((2 Tanh[ u[t]]) Derivative[1][u][t]) Derivative[1][v][t] + Derivative[2][v][ t] == 0, u[0] == -0.9, v[0] == v0, u[1] == 0.9, v[1] == v0}, { u[t], v[t]}, {t, 0, 1}, MaxSteps -> Infinity], 1], {v0, Range[-0.1, 0.1, 0.025]}]; {SphereGeodesics[Range[-.1, .1, .025]], PlaneGeodesics[Range[-.1, .1, .025]], Show[ParametricPlot3D[{Sinh[u], Cosh[u] Sin[v], Cos[v] Cosh[u]}, {u, -1, 1}, {v, -π/3, π/3}, Mesh -> False, Boxed -> False, Axes -> False, PlotStyle -> color], ParametricPlot3D[{Sinh[u[t]], Cosh[u[t]] Sin[v[t]], Cos[v[t]] Cosh[u[t]]} /. #, {t, 0, 1}, PlotStyle -> Red] & /@ hyperboloidGeodesics, ViewAngle -> 0.3391233203265557`, ViewCenter -> {{0.5`, 0.5`, 0.5`}, {0.5265689095305934`, 0.5477310383268459`}}, ViewPoint -> {1.7628482856617167`, 0.21653966523483362`, 2.8801868854502355`}, ViewVertical -> {-0.1654573174671554`, 0.1564093539158781`, 0.9737350718261054`}]}

One can see the same effect in sufficiently large graphs (although it can be obscured by regularities in graphs which lead to large numbers of “degenerate” geodesics, all of the same length):

CloudGet["https://wolfr.am/LaGB0SXY"]

We saw before that the growth rate of the volume Vr(X) of a ball centered at some point X in a graph could be identified as giving a measure of the Ricci scalar curvature R at X. But we can now consider tubes formed from balls centered at each point on a geodesic. And from the growth rates of volumes of these tubes we will be able to measure what can be identified as different components of curvature associated with the Ricci tensor (cf. [1:p1048][27][42]).

In a continuous space (or, more precisely, on a Riemannian manifold) the infinitesimal volume element at a point X is given in terms of the metric tensor g by . If we look at a nearby point X + δx we can expand in a power series in δx (e.g. [43])

where Rij is the Ricci tensor and the δi (contravariant vectors) are orthogonal components of δx (say along axes defined by some coordinate system).

If we integrate over a ball of radius r in d dimensions, we recover our previous formula for the volume of a ball

where R = Rii is the Ricci scalar curvature.

But now let us consider integrating over a tube of radius r that goes a distance δ along a geodesic starting at X. Then we get a formula for the volume of the tube (cf. [44])

where the are components of unit vectors along the geodesic.

There is now a direct analog in our hypergraphs: just as we measured the growth rates of geodesic balls to find Ricci scalar curvature, we can now measure growth rates of geodesic tubes to probe full Ricci curvature.

To construct an example, consider a graph formed from a mesh on the surface of an ellipsoid. (It is important that this mesh is intrinsic to the surface, with each mesh element corresponding to about the same surface areaand that the mesh does not just come from, say, a standard θ, ϕ coordinate grid.)

As a first step, consider balls of progressively larger radii at different points on the ellipsoid mesh graph:

In the region of higher curvature near the tip, the area of the ball for a given radius is smaller, reflecting higher values of the Ricci scalar curvature R there:

But now consider tubes around geodesics on the ellipsoid mesh graph. Instead of measuring the scalar curvature R, these instead in effect measure components of the Ricci tensor along these geodesics.

To measure all the components of the Ricci tensor, we could consider not just a tube but a bundle of geodesics, and we could look at the sectional curvature associated with deformations of the shape of this bundle. Or, as an alternative, we could consider tubes along not just one, but two geodesics through a given point. But in both cases, the analogy with the continuous case is easiest if we can identify something that we can consider an orthogonal direction.

One way to do this on a graph is to start from a particular geodesic through a given point, then to look at all other geodesics through that point, and work out which ones are the largest graph distance away. These show sequences of progressively more distant geodesics (as measured by the graph distance to the original geodesic of their endpoints):

(*https://www.wolframcloud.com/obj/wolframphysics/TechPaper-Programs/\ Section-04/Geodesics-01.wl*) CloudGet["https://wolfr.am/L1PH6Rne"] Graph[#, ImageSize -> 60, Sequence[ VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "EdgeLineStyle"]] ] & /@ geodesicsSequence[GridGraph[{10, 10}], 4, {60, 56, 52}]
CloudGet["https://wolfr.am/L1PH6Rne"]; \ Take[Graph3D[#, ImageSize -> 75, BaseStyle -> {Graphics3DBoxOptions -> {Method -> {"ShrinkWrap" -> True}}}, VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph3D", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph3D", "EdgeLineStyle"]] & /@ geodesicsSequence[ ResourceFunction["BuckyballGraph"][7, VertexCoordinates -> "Embedded"], 4, {221, 357, 519}], {9, 15}]
CloudGet["https://wolfr.am/L1PH6Rne"]; Graph3D[#, ImageSize -> 62, BaseStyle -> {Graphics3DBoxOptions -> {Method -> {"ShrinkWrap" -> True}}}, VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph3D", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph3D", "EdgeLineStyle"]] & /@ geodesicsSequence[GridGraph[{10, 10, 10}], 4, {45, 445, 845}]

In general there may be many choices of these geodesicsand in a sense these correspond to different local choices of coordinates. But given particular choices of geodesics we can imagine using them to form a grid.

Looking at growth rates of volumes on this grid then gives us results not just about the Ricci tensor, but also about the Riemann tensor, about parallel transport and about covariant derivatives (cf. [27]).

The examples we have shown so far all involve graphs that have a straightforward correspondence with familiar geometry. But exactly the same methods can be used on the kinds of graphs and hypergraphs that arise from our models. This shows tubes of successively larger radii along two different geodesics:

finalState = ResourceFunction[ "WolframModel"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{1, 2}, {1, 3}}, 13, "FinalState"]; toHighlight = Function[r, Catenate@ Through[{Join[List @@@ #, List @@@ Reverse /@ #] &@*EdgeList, VertexList}[ With[{graph = UndirectedGraph[Rule @@@ finalState]}, GraphUnion @@ (NeighborhoodGraph[graph, #, r] & /@ FindShortestPath[graph, 100, 1000])]]]] /@ {1, 3, 5}; ResourceFunction["WolframModelPlot"][finalState, EdgeStyle -> <|Alternatives @@ # -> Directive[Thick, Red]|>, VertexStyle -> <| Alternatives @@ # -> Directive[Thick, Red]|>] & /@ toHighlight
finalState = ResourceFunction[ "WolframModel"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{1, 2}, {1, 3}}, 13, "FinalState"]; toHighlight = Function[r, Catenate@ Through[{Join[List @@@ #, List @@@ Reverse /@ #] &@*EdgeList, VertexList}[ With[{graph = UndirectedGraph[Rule @@@ finalState]}, GraphUnion @@ (NeighborhoodGraph[graph, #, r] & /@ FindShortestPath[graph, 200, 900])]]]] /@ {1, 3, 5}; ResourceFunction["WolframModelPlot"][finalState, EdgeStyle -> <|Alternatives @@ # -> Directive[Thick, Red]|>, VertexStyle -> <| Alternatives @@ # -> Directive[Thick, Red]|>] & /@ toHighlight

In the limit of a large number of steps, we can measure the volumes of tubes like these to compute approximations to projections of the Ricci tensorand for example determine the level of isotropy of the emergent geometry of our models.