Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Wolfram–Ricci scalar curvature of a graph and its associated properties
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,v] computes the Wolfram–Ricci scalar curvature around vertex v in a graph graph of dimension dim, with an automatically-computed maximum ball radius. | |
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,v,rad] uses maximum ball radius rad. | |
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,v,{radmin,radmax}] uses minimum ball radius radmin and maximum ball radius radmax. | |
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,All] gives an association showing the Wolfram–Ricci scalar curvatures around each vertex in a graph graph of dimension dim, with an automatically-computed maximum ball radius. | |
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,All,rad] gives an association using maximum ball radius rad. | |
ResourceFunction["WolframRicciCurvatureScalar"][graph,dim,All,{radmin,radmax}] gives an association using minimum ball radius radmin and maximum ball radius radmax. | |
ResourceFunction["WolframRicciCurvatureScalar"][…,"prop"] gives the property "prop" for the specified Wolfram–Ricci scalar curvature computation. |
| "Volume" | the volumes of geodesic balls of various radii around a given vertex |
| "AllVolumes" | an association showing the volumes of geodesic balls of various radii around each vertex |
| "Curvature" | the Wolfram–Ricci scalar curvature at a given vertex |
| "AllCurvatures" | an association showing the Wolfram–Ricci scalar curvatures at each vertex |
| "HighlightedGraph" | a highlighted graph depicting how the Wolfram–Ricci scalar curvature is computed |
| "TransitivelyReduce" | False | whether to use the transitive reduction of the input graph |
| "UndirectedGraph" | False | whether to use the undirected form of the input graph |
| "AverageVolumes" | True | whether to take an average over geodesic balls of different volumes |
| "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) |
Compute the Wolfram–Ricci scalar curvature at vertex 150 in a 20-by-20 2-dimensional grid graph:
| In[1]:= |
|
| Out[1]= |
|
Compute the maximum and minimum curvatures over geodesic balls with radii up to 8:
| In[2]:= |
|
| Out[2]= |
|
| In[3]:= |
|
| Out[3]= |
|
Return a list of all curvatures over geodesic balls with radii up to 8:
| In[4]:= |
|
| Out[4]= |
|
Show the geodesic balls with radii up to 8 as a highlighted graph:
| In[5]:= |
|
| Out[5]= |
|
Return an Association showing the Wolfram–Ricci scalar curvatures at each vertex:
| In[6]:= |
|
| Out[6]= |
|
Compute the maximum and minimum curvatures across all vertices:
| In[7]:= |
|
| Out[7]= |
|
| In[8]:= |
|
| Out[8]= |
|
Compute the average curvature across all vertices:
| In[9]:= |
|
| Out[9]= |
|
Compute the average volume of geodesic balls around vertex 250 in a 10-by-10-by-10 3-dimensional grid graph:
| In[10]:= |
|
| Out[10]= |
|
| In[11]:= |
|
| Out[11]= |
|
Compute the maximum and minimum volumes of geodesic balls with radii between 3 and 9:
| In[12]:= |
|
| Out[12]= |
|
| In[13]:= |
|
| Out[13]= |
|
Return a list of all volumes of geodesic balls with radii between 3 and 9:
| In[14]:= |
|
| Out[14]= |
|
Show the geodesic balls with radii between 3 and 9 as a highlighted graph:
| In[15]:= |
|
| Out[15]= |
|
Return an Association showing the geodesic ball volumes around each vertex:
| In[16]:= |
|
| Out[16]= |
|
Compute the maximum and minimum ball volumes across all vertices:
| In[17]:= |
|
| Out[17]= |
|
| In[18]:= |
|
| Out[18]= |
|
Compute the average ball volume across all vertices:
| In[19]:= |
|
| Out[19]= |
|
Compute the Wolfram–Ricci scalar curvature at an arbitrary vertex in an approximately spherical graph (produced using ExtrinsicCurvedManifoldToGraph), and show that the curvature is positive:
| In[20]:= |
|
| In[21]:= |
|
| Out[21]= |
|
Show the geodesic balls with radii up to 6 as a highlighted graph:
| In[22]:= |
|
| Out[22]= |
|
Compute the Wolfram–Ricci scalar curvature at an arbitrary vertex in an approximately hyperbolic paraboloidal graph (produced using ExtrinsicCurvedManifoldToGraph), and show that the curvature is negative:
| In[23]:= |
|
| In[24]:= |
|
| Out[24]= |
|
Show the geodesic balls with radii up to 3 as a highlighted graph:
| In[25]:= |
|
| Out[25]= |
|
If given a graph and a number of dimensions, WolframRicciCurvatureScalar returns an Association showing the Wolfram–Ricci scalar curvatures at each vertex, using the graph radius as the maximum geodesic ball radius:
| In[26]:= |
|
| Out[26]= |
|
| In[27]:= |
|
| Out[27]= |
|
Use geodesic ball radii between 3 and 5 instead:
| In[28]:= |
|
| Out[28]= |
|
If given a graph, a number of dimensions, a vertex and a maximum radius, WolframRicciCurvatureScalar returns the Wolfram–Ricci scalar curvature at that vertex:
| In[29]:= |
|
| Out[29]= |
|
WolframRicciCurvatureScalar also supports directed graphs:
| In[30]:= |
|
| In[31]:= |
|
| Out[31]= |
|
In the directed case, the Wolfram–Ricci scalar curvature is computed using volumes of geodesic cones, as opposed to geodesic balls:
| In[32]:= |
|
| Out[32]= |
|
However, WolframRicciCurvatureScalar can be made to treat directed graphs as though they were undirected (and hence revert to using geodesic balls) with the option "UndirectedGraph":
| In[33]:= |
|
| Out[33]= |
|
| In[34]:= |
|
| Out[34]= |
|
WolframRicciCurvatureScalar also supports curvature computations in graphs with non-integer dimensionality, such as this Sierpinski sieve graph:
| In[35]:= |
|
| Out[35]= |
|
| In[36]:= |
|
| Out[36]= |
|
| In[37]:= |
|
| Out[37]= |
|
Compute the average Wolfram–Ricci scalar curvature over geodesic balls around vertex 150 with radii between 3 and 9 in a 20-by-20 2-dimensional grid graph with the option value "CurvatureMethod"→Mean (default):
| In[38]:= |
|
| Out[38]= |
|
| In[39]:= |
|
| Out[39]= |
|
Return a list of all curvatures over geodesic balls with radii between 3 and 9 instead:
| In[40]:= |
|
| Out[40]= |
|
Compute the maximum and minimum curvatures over geodesic balls with radii between 3 and 9 with the options "CurvatureMethod"→Max and "CurvatureMethod"→Min, respectively:
| In[41]:= |
|
| Out[41]= |
|
| In[42]:= |
|
| Out[42]= |
|
By default, directed graphs are not transitively-reduced:
| In[43]:= |
|
Compute (and visualize) the Wolfram–Ricci curvature scalar, assuming that the graph is not transitively reduced:
| In[44]:= |
|
| Out[44]= |
|
| In[45]:= |
|
| Out[45]= |
|
WolframRicciCurvatureScalar can be made to treat unreduced directed graphs as though they were transitively-reduced with the option "TransitivelyReduce":
| In[46]:= |
|
| Out[46]= |
|
| In[47]:= |
|
| Out[47]= |
|
By default, directed graphs are treated as directed (and so curvature computations use the volumes of geodesic cones, as opposed to geodesic balls):
| In[48]:= |
|
Compute (and visualize) the Wolfram–Ricci curvature scalar, assuming that the graph is directed:
| In[49]:= |
|
| Out[49]= |
|
| In[50]:= |
|
| Out[50]= |
|
WolframRicciCurvatureScalar can be made to treat directed graphs as though they were undirected with the option "UndirectedGraph":
| In[51]:= |
|
| Out[51]= |
|
| In[52]:= |
|
| Out[52]= |
|
Return an Association showing the geodesic ball volumes around each vertex in a 20-by-20 2-dimensional grid graph (default):
| In[53]:= |
|
| Out[53]= |
|
| In[54]:= |
|
| Out[54]= |
|
Compute the average ball volume across all vertices with the option "VertexMethod"→Mean:
| In[55]:= |
|
| Out[55]= |
|
Compute the maximum and minimum ball volumes across all vertices with the options "VertexMethod"→Max and "VertexMethod"→Min, respectively:
| In[56]:= |
|
| Out[56]= |
|
| In[57]:= |
|
| Out[57]= |
|
Return an association showing the Wolfram–Ricci scalar curvature at each vertex in a 20-by-20 2-dimensional grid graph (default):
| In[58]:= |
|
| Out[58]= |
|
| In[59]:= |
|
| Out[59]= |
|
Compute the average curvature across all vertices with the option "AverageVertices":
| In[60]:= |
|
| Out[60]= |
|
Compute the maximum and minimum curvatures across all vertices with the options "MaxVertices" and "MinVertices", respectively:
| In[61]:= |
|
| Out[61]= |
|
| In[62]:= |
|
| Out[62]= |
|
Compute the average volume of geodesic balls around vertex 150 with radii between 3 and 9 in a 20-by-20 2-dimensional grid graph with the option value "VolumeMethod"→Mean (default):
| In[63]:= |
|
| Out[63]= |
|
| In[64]:= |
|
| Out[64]= |
|
Return a list of all volumes of geodesic balls with radii between 3 and 9 instead:
| In[65]:= |
|
| Out[65]= |
|
Compute the maximum and minimum volumes of geodesic balls with radii between 3 and 9 with the option values "VolumeMethod"→Max and "VolumeMethod"→Min, respectively:
| In[66]:= |
|
| Out[66]= |
|
| In[67]:= |
|
| Out[67]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License