Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Produce random spatial graphs by sprinkling points into a flat (Euclidean) Riemannian manifold
| 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. | 
| "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 | 
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]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/35fee5165a7ece57.png)  | 
| Out[1]= |   | 
Show the spatial graph:
| In[2]:= | ![manifold["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/318ebb1dd56638eb.png)  | 
| Out[2]= |   | 
Show the pure spatial graph (with vertex coordinate information removed):
| In[3]:= | ![manifold["PureSpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/735976f7ba0acf62.png)  | 
| 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]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/61b7b947743ea1b6.png)  | 
| Out[4]= |   | 
Show the spatial graph:
| In[5]:= | ![manifold["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/28c686727a0c3f0a.png)  | 
| Out[5]= |   | 
Show the pure spatial graph (with vertex coordinate information removed):
| In[6]:= | ![manifold["PureSpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/6349cc9fbeb028dd.png)  | 
| Out[6]= |   | 
Plot the positions of the sprinkled points only (without spatial edges):
| In[7]:= | ![manifold["Points"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/6ea41113b36bac46.png)  | 
| Out[7]= |   | 
By default, the discreteness scale is assumed to be equal to 1:
| In[8]:= | ![manifold = ResourceFunction["FlatManifoldToGraph"][2, 10]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/0a425a55e4b1e85b.png)  | 
| Out[8]= |   | 
Show the spatial graph:
| In[9]:= | ![manifold["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/0d0a09be0cd22e74.png)  | 
| Out[9]= |   | 
Sprinklings can be performed in arbitrary (integer) numbers of dimensions:
| In[10]:= | ![manifold = ResourceFunction["FlatManifoldToGraph"][4, 0.4, 200]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/26106fe0aa278089.png)  | 
| Out[10]= |   | 
| In[11]:= | ![manifold["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/06b0e5ff8892eae6.png)  | 
| Out[11]= |   | 
In seven dimensions:
| In[12]:= | ![manifold2 = ResourceFunction["FlatManifoldToGraph"][7, 0.8, 200]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/7a934d628a458a90.png)  | 
| Out[12]= |   | 
| In[13]:= | ![manifold2["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/61962dcb435c27d0.png)  | 
| Out[13]= |   | 
Properties can be requested directly from FlatManifoldToGraph:
| In[14]:= | ![ResourceFunction["FlatManifoldToGraph"][3, 0.3, 200, "SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/537473129d9ea81d.png)  | 
| 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]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/132d0bddeb8c978e.png)  | 
| Out[15]= |   | 
Show the complete list of properties:
| In[16]:= | ![manifold["Properties"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/10a9259bfa92ea26.png)  | 
| Out[16]= |   | 
Show the spatial graph:
| In[17]:= | ![manifold["SpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/352b6cd5901dc1e5.png)  | 
| Out[17]= |   | 
Plot the positions of the sprinkled points only (without spatial edges):
| In[18]:= | ![manifold["Points"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/5b769bb8282be437.png)  | 
| Out[18]= |   | 
Show a complete list of manifold coordinates for the sprinkled points:
| In[19]:= | ![Take[manifold["PointsList"], 100]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/2452ff9e9904a56c.png)  | 
| Out[19]= |   | 
Show the discreteness scale:
| In[20]:= | ![manifold["DiscretenessScale"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/218d9e7b96935565.png)  | 
| Out[20]= |   | 
Show the number of dimensions in the background manifold:
| In[21]:= | ![manifold["Dimensions"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/5061eda6af69e006.png)  | 
| Out[21]= |   | 
Show the total number of spatial edges:
| In[22]:= | ![manifold["EdgeCount"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/629516234e09025a.png)  | 
| Out[22]= |   | 
Show the pure spatial graph (with vertex coordinate information removed):
| In[23]:= | ![manifold["PureSpatialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/6c8/6c874f93-78b0-4d7d-9a68-59d540f466c5/558c6f3879da475f.png)  | 
| Out[23]= |   | 
This work is licensed under a Creative Commons Attribution 4.0 International License