Function Repository Resource:

FlatManifoldToGraph

Source Notebook

Produce random spatial graphs by sprinkling points into a flat (Euclidean) Riemannian manifold

Contributed by: Jonathan Gorard

ResourceFunction["FlatManifoldToGraph"][dim,n]

produces a random sprinkling of n points into a flat (Euclidean) Riemannian manifold of dimension dim, assuming a discreteness scale of 1.

ResourceFunction["FlatManifoldToGraph"][dim,disc,n]

produces a random sprinkling of n points with discreteness scale disc into a flat (Euclidean) Riemannian manifold of dimension dim.

ResourceFunction["FlatManifoldToGraph"][,"prop"]

gives the property "prop" for the specified flat (Euclidean) Riemannian manifold sprinkling.

Details and Options

When no "prop" argument is given, ResourceFunction["FlatManifoldToGraph"] returns a ManifoldGraph object.
By default, the discreteness scale is assumed to be equal to 1.
Sprinklings are performed using a Poisson point process, with the expected number of sprinkled points being proportional to the Riemannian volume measure.
Spatial edges are added in accordance with both the Riemannian metric and the specified discreteness scale, so as to guarantee approximate isometry between the spatial graph and the underlying manifold.
In ResourceFunction["FlatManifoldToGraph"][,"prop"], the following properties can be requested. These are the same as the properties supported by ManifoldGraph[]["prop"]:
"SpatialGraph"spatial graph with vertex coordinates given by the underlying manifold coordinates
"Points"plot of the sprinkled points only (without spatial edges)
"PointsList"list of the manifold coordinates of all sprinkled points
"DiscretenessScale"discreteness scale of the sprinkling
"PointsCount"number of sprinkled points
"Dimensions"number of dimensions in the continuum manifold approximation
"EdgeCount"total number of spatial edges
"PureSpatialGraph"spatial graph with vertex coordinate information removed
"Properties"list of properties
The discreteness scale determines at what distance (with respect to the Riemannian metric) a pair of points should be regarded as adjacent.
In 3 dimensions and below, the spatial graph layout uses vertex coordinate information by default. In higher dimensions, the spring electrical embedding method is used by default.

Examples

Basic Examples (3) 

Produce a random sprinkling of 100 points into a 2-dimensional flat (Euclidean) manifold, with discreteness scale 0.3:

In[1]:=
manifold = ResourceFunction["FlatManifoldToGraph"][2, 0.3, 100]
Out[1]=

Show the spatial graph:

In[2]:=
manifold["SpatialGraph"]
Out[2]=

Show the pure spatial graph (with vertex coordinate information removed):

In[3]:=
manifold["PureSpatialGraph"]
Out[3]=

Produce a random sprinkling of 200 points into a 3-dimensional flat (Euclidean) manifold, with discreteness scale 0.3:

In[4]:=
manifold = ResourceFunction["FlatManifoldToGraph"][3, 0.3, 200]
Out[4]=

Show the spatial graph:

In[5]:=
manifold["SpatialGraph"]
Out[5]=

Show the pure spatial graph (with vertex coordinate information removed):

In[6]:=
manifold["PureSpatialGraph"]
Out[6]=

Plot the positions of the sprinkled points only (without spatial edges):

In[7]:=
manifold["Points"]
Out[7]=

By default, the discreteness scale is assumed to be equal to 1:

In[8]:=
manifold = ResourceFunction["FlatManifoldToGraph"][2, 10]
Out[8]=

Show the spatial graph:

In[9]:=
manifold["SpatialGraph"]
Out[9]=

Scope (3) 

Sprinklings can be performed in arbitrary (integer) numbers of dimensions:

In[10]:=
manifold = ResourceFunction["FlatManifoldToGraph"][4, 0.4, 200]
Out[10]=
In[11]:=
manifold["SpatialGraph"]
Out[11]=

In seven dimensions:

In[12]:=
manifold2 = ResourceFunction["FlatManifoldToGraph"][7, 0.8, 200]
Out[12]=
In[13]:=
manifold2["SpatialGraph"]
Out[13]=

Properties can be requested directly from FlatManifoldToGraph:

In[14]:=
ResourceFunction["FlatManifoldToGraph"][3, 0.3, 200, "SpatialGraph"]
Out[14]=

Produce a random sprinkling of 200 points into a 2-dimensional flat (Euclidean) manifold, with discreteness scale 0.2:

In[15]:=
manifold = ResourceFunction["FlatManifoldToGraph"][2, 0.2, 200]
Out[15]=

Show the complete list of properties:

In[16]:=
manifold["Properties"]
Out[16]=

Show the spatial graph:

In[17]:=
manifold["SpatialGraph"]
Out[17]=

Plot the positions of the sprinkled points only (without spatial edges):

In[18]:=
manifold["Points"]
Out[18]=

Show a complete list of manifold coordinates for the sprinkled points:

In[19]:=
Take[manifold["PointsList"], 100]
Out[19]=

Show the discreteness scale:

In[20]:=
manifold["DiscretenessScale"]
Out[20]=

Show the number of dimensions in the background manifold:

In[21]:=
manifold["Dimensions"]
Out[21]=

Show the total number of spatial edges:

In[22]:=
manifold["EdgeCount"]
Out[22]=

Show the pure spatial graph (with vertex coordinate information removed):

In[23]:=
manifold["PureSpatialGraph"]
Out[23]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 11 December 2020

Source Metadata

Related Resources

License Information