Function Repository Resource:

# WolframRicciCurvatureTensor

Compute projections of the Wolfram–Ricci curvature tensor of a graph and many associated properties

Contributed by: Jonathan Gorard

## Details and Options

Projections of the Wolfram–Ricci curvature tensor are computed by comparing the volume of a finite geodesic tube in the graph to that of a finite geodesic tube of the same length and radius in a flat manifold (i.e. the discrete analog of the standard Ricci curvature tensor in Riemannian geometry).
Wolfram–Ricci curvature represents one possible definition of discrete Ricci curvature for an arbitrary graph, based upon a discretization of the power series expansion of a continuous Riemannian volume element. This stands in contrast to other such definitions, such as the Ollivier-Ricci curvature, which is based upon measure theory (defined in terms of the Wasserstein distance between geodesic balls after parallel transport), and the Forman-Ricci curvature, which is based upon topology (defined by treating the graph as an abstract CW-complex).
In ResourceFunction["WolframRicciCurvatureTensor"][graph,], graph can be either directed or undirected, in which case the Wolfram–Ricci curavture tensor approximates either the Lorentzian or Riemannian Ricci curvature tensor, respectively.
ResourceFunction["WolframRicciCurvatureTensor"] can compute projections of the Wolfram–Ricci curvature tensor between a pair of vertices by either taking an average over geodesic cones of all different radii, taking a minimum/maximum over all radii, or otherwise returning every possible result.
When no maximum or minimum radius is specified, ResourceFunction["WolframRicciCurvatureTensor"] automatically uses the minimum of the graph radius and the tube length as the maximum radius.
For directed graphs, ResourceFunction["WolframRicciCurvatureTensor"] computes volumes of finite geodesic diamonds, as opposed to geodesic tubes.
In ResourceFunction["WolframRicciCurvatureTensor"][graph,dim,], dim can be any arbitrary real number (i.e. fractional-dimensional spaces are supported).
In ResourceFunction["WolframRicciCurvatureTensor"][,"prop"], the following properties can be requested:
 "BallVolume" the volumes of geodesic balls of various radi around a given vertex "AllBallVolumes" an association showing the volumes of geodesic balls of various radii around each vertex "ScalarCurvature" the Wolfram–Ricci scalar curvatures at a given vertex "AllScalarCurvatures" an association showing the Wolfram–Ricci scalar curvatures at each vertex "ScalarHighlightedGraph" a highlighted graph showing how the Wolfram–Ricci scalar curvature is computed "TubeVolume" the volumes of geodesic tubes of various radii between two given vertices "AllTubeProjectionVolumes" an association showing the volumes of geodesic tubes of various volumes between a given vertex and all other vertices "Curvature" the projection of the Wolfram–Ricci curvature tensor between two given vertices "AllCurvatureProjections" an association showing the projections of the Wolfram–Ricci curvature tensor between a given vertex and all other vertices "HighlightedGraph" a highlighted graph showing how the projection of the Wolfram–Ricci curvature tensor is computed
The default property for ResourceFunction["WolframRicciCurvatureTensor"] is either "Curvature" (if a final vertex vout is specified) or "AllCurvatureProjections" (if a final vertex vout is not specified).
Options for ResourceFunction["WolframRicciCurvatureTensor"] include:
 "TransitivelyReduce" False whether to use the transitive reduction of the input graph "UndirectedGraph" False whether to use the undirected form of the input graph "VolumeMethod" Mean whether to take a maximum, minimum or mean over geodesic balls of different volumes (or simply return all values) "CurvatureMethod" Mean whether to take a maximum, minimum or mean over geodesic balls yielding different curvatures (or simply return all values) "VertexMethod" Identity whether to take a maximum, minimum or mean over all vertices in the input graph (or simply return all values)
The possible values for the options "VolumeMethod", "CuravtureMethod" and "VertexMethod" are Max, Min, Mean and Identity. For each of the options, Identity will return a list of all possible values, while Max, Min and Mean will return a maximum, minimum or mean of the elements of the resulting list, respectively.
For the properties "BallVolume", "ScalarCurvature" and "ScalarHighlightedGraph", the value of vout does not matter - for the sake of consistency, we will choose vout=vin in all documentation examples.

## Examples

### Basic Examples (6)

Compute the projection of the Wolfram–Ricci curvature tensor between vertices 145 and 355 in a 20-by-20 2-dimensional grid graph:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

Compute the maximum and minimum projections of the curvature tensor over geodesic tubes with radii up to 4:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

Return a list of all projections of the curvature tensor over geodesic tubes with radii up to 4:

 In[5]:=
 Out[5]=

Show the geodesic tubes with radii up to 4 as a highlighted graph:

 In[6]:=
 Out[6]=

Return an Association showing the projections of the Wolfram–Ricci curvature tensor between vertex 145 and each vertex in the graph, over geodesic tubes with radii up to 4:

 In[7]:=
 Out[7]=

Compute the maximum and minimum projections of the curvature tensor across all vertices:

 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=

Compute the average projection of the curvature tensor across all vertices:

 In[10]:=
 Out[10]=

Compute the average volume of geodesic tubes between vertices 145 and 855 in a 10-by-10-by-10 3-dimensional grid graph:

 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=

Compute the maximum and minimum volumes of geodesic tubes with radii between 2 and 4:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=

Return a list of all volumes of geodesic tubes with radii between 2 and 4:

 In[15]:=
 Out[15]=

Show the geodesic tubes with radii between 2 and 4 as a highlighted graph:

 In[16]:=
 Out[16]=

Return an Association showing the geodesic tube volumes between vertex 145 and each vertex in the graph, with radii up to 3:

 In[17]:=
 Out[17]=

Compute the maximum and minimum tube volumes between vertex 145 and each vertex in the graph, with radii up to 3:

 In[18]:=
 Out[18]=
 In[19]:=
 Out[19]=

Compute the projection of the Wolfram–Ricci curvature tensor between two arbitrary vertices in an approximately spherical graph (produced using the resource function ExtrinsicCurvedManifoldToGraph) and show that the projection is positive:

 In[20]:=
 In[21]:=
 Out[21]=

Show the geodesic tubes with radii up to 2 as a highlighted graph:

 In[22]:=
 Out[22]=

Compute the projection of the Wolfram–Ricci curvature tensor between two arbitrary vertices in an approximately hyperbolic paraboloidal graph (produced using the resource function ExtrinsicCurvedManifoldToGraph) and show that the projection is negative:

 In[23]:=
 In[24]:=
 Out[24]=

Show the geodesic tubes with radii up to 3 as a highlighted graph:

 In[25]:=
 Out[25]=

Compute the Wolfram–Ricci scalar curvature at vertex 150 in a 20-by-20 2-dimensional grid graph:

 In[26]:=
 Out[26]=
 In[27]:=
 Out[27]=

Compute the maximum and minimum scalar curvatures over geodesic balls with radii up to 8:

 In[28]:=
 Out[28]=
 In[29]:=
 Out[29]=

Return a list of all scalar curvatures over geodesic balls with radii up to 8:

 In[30]:=
 Out[30]=

Show the geodesic balls with radii up to 8 as a highlighted graph:

 In[31]:=
 Out[31]=

Return an association showing the Wolfram–Ricci scalar curvatures at each vertex:

 In[32]:=
 Out[32]=

Compute the maximum and minimum scalar curvatures across all vertices:

 In[33]:=
 Out[33]=
 In[34]:=
 Out[34]=

Compute the average scalar curvature across all vertices:

 In[35]:=
 Out[35]=

Compute the average volume of geodesic balls around vertex 250 in a 10-by-10-by-10 3-dimensional grid graph:

 In[36]:=
 Out[36]=
 In[37]:=
 Out[37]=

Compute the maximum and minimum volumes of geodesic balls with radii between 3 and 9:

 In[38]:=
 Out[38]=
 In[39]:=
 Out[39]=

Return a list of all volumes of geodesic balls with radii between 3 and 9:

 In[40]:=
 Out[40]=

Show the geodesic balls with radii between 3 and 9 as a highlighted graph:

 In[41]:=
 Out[41]=

Return an association showing the geodesic ball volumes around each vertex:

 In[42]:=
 Out[42]=

Compute the maximum and minimum ball volumes across all vertices:

 In[43]:=
 Out[43]=
 In[44]:=
 Out[44]=

Compute the average ball volume across all vertices:

 In[45]:=
 Out[45]=

### Scope (4)

If given a graph, a number of dimensions and a vertex, WolframRicciCurvatureTensor returns an association showing the projections of the Wolfram–Ricci curvature tensor to each vertex in the graph, using the graph radius as the maximum geodesic tube radius:

 In[46]:=
 Out[46]=
 In[47]:=
 Out[47]=

 In[48]:=
 Out[48]=

If given a graph, a number of dimensions, a pair of vertices and a maximum radius, WolframRicciCurvatureTensor returns the projection of the Wolfram–Ricci curvature tensor between those vertices:

 In[49]:=
 Out[49]=

#### Directed versus undirected graphs (3)

WolframRicciCurvatureTensor also supports directed graphs:

 In[50]:=
 In[51]:=
 Out[51]=

In the directed case, projections of the Wolfram–Ricci curvature tensor are computed using volumes of geodesic diamonds, as opposed to geodesic tubes:

 In[52]:=
 Out[52]=

However, WolframRicciCurvatureTensor can be made to treat directed graphs as though they were undirected (and hence revert to using geodesic tubes) with the option "UndirectedGraph":

 In[53]:=
 Out[53]=
 In[54]:=
 Out[54]=

#### Fractional dimensional graphs (1)

WolframRicciCurvatureTensor also supports curvature computations in graphs with non-integer dimensionality, such as this Sierpinski sieve graph:

 In[55]:=
 Out[55]=
 In[56]:=
 Out[56]=
 In[57]:=
 Out[57]=

### Options (13)

#### CurvatureMethod (3)

Compute the average projection of the Wolfram–Ricci curvature tensor over geodesic tubes between vertices 145 and 355 with radii between 2 and 6 in a 20-by-20 2-dimensional grid graph with the option value "CurvatureMethod"Mean (default):

 In[58]:=
 Out[58]=
 In[59]:=
 Out[59]=

Return a list of curvatures over geodesic tubes with radii between 2 and 6 instead:

 In[60]:=
 Out[60]=

Compute the maximum and minimum curvatures over geodesic tubes with radii between 2 and 6 with the option values "CurvatureMethod"Max and "CurvatureMethod"Min, respectively:

 In[61]:=
 Out[61]=
 In[62]:=
 Out[62]=

#### TransitivelyReduce (3)

By default, directed graphs are not transitively-reduced:

 In[63]:=

Compute (and visualize) the Wolfram–Ricci curvature tensor, assuming that the graph is not transitively-reduced:

 In[64]:=
 Out[64]=
 In[65]:=
 Out[65]=

WolframRicciCurvatureTensor can be made to treat unreduced directed graphs as though they were transitively-reduced with the option "TransitivelyReduce":

 In[66]:=
 Out[66]=
 In[67]:=
 Out[67]=

#### UndirectedGraph (2)

By default, directed graphs are treated as directed (and so curvature computations use the volumes of geodesic diamonds, as opposed to geodesic tubes):

 In[68]:=
 In[69]:=
 Out[69]=
 In[70]:=
 Out[70]=

WolframRicciCurvatureTensor can be made to treat directed graphs as though they were undirected with the option "UndirectedGraph":

 In[71]:=
 Out[71]=
 In[72]:=
 Out[72]=

#### VertexMethod (2)

Return an association showing the geodesic tube volumes between vertex 145 and each vertex, with radii up to 3, in a 20-by-20 2-dimensional grid graph (default):

 In[73]:=
 Out[73]=
 In[74]:=
 Out[74]=

Compute the average tube volume between vertex 145 and all vertices with the option value "VertexMethod"Mean:

 In[75]:=
 Out[75]=

Compute the maximum and minimum tube volumes between vertex 145 and all vertices with the option values "VertexMethod"Max and "VertexMethod"Min, respectively:

 In[76]:=
 Out[76]=
 In[77]:=
 Out[77]=

Return an association showing the projections of the Wolfram–Ricci curvature tensor between vertex 145 and each vertex, with tube radii up to 3, in a 20-by-20 2-dimensional grid graph:

 In[78]:=
 Out[78]=
 In[79]:=
 Out[79]=

Compute the average projection of the Wolfram–Ricci curvature tensor between vertex 145 and all vertices with the option value "VertexMethod"Mean:

 In[80]:=
 Out[80]=

Compute the maximum and minimum projections of the Wolfram–Ricci curvature tensor between vertex 145 and all vertices with the option values "VertexMethod"Max and "VertexMethod"Min, respectively:

 In[81]:=
 Out[81]=
 In[82]:=
 Out[82]=

#### VolumeMethod (3)

Compute the average volume of geodesic tubes between vertices 145 and 355 with radii between 2 and 6 in a 20-by-20 2-dimensional grid graph with the option value "VolumeMethods"Mean (default):

 In[83]:=
 Out[83]=
 In[84]:=
 Out[84]=

Return a list of all volumes of geodesic tubes with radii between 2 and 6 instead:

 In[85]:=
 Out[85]=

Compute the maximum and minimum volumes of geodesic balls with radii between 2 and 6 with the option values "VolumeMethod"Max and "VolumeMethod"Min, respectively:

 In[86]:=
 Out[86]=
 In[87]:=
 Out[87]=

Jonathan Gorard

## Version History

• 1.0.0 – 16 March 2021