Function Repository Resource:

GraphReconstructedSurface

Source Notebook

Embed a hypergraph into a surface

Contributed by: Stephen Wolfram and Jan Mangaldan

ResourceFunction["GraphReconstructedSurface"][hg]

embeds the hypergraph hg into a surface.

ResourceFunction["GraphReconstructedSurface"][hg,delta]

embeds the hypergraph hg into a surface while removing triangles on the surface with area greater than delta.

Details and Options

ResourceFunction["GraphReconstructedSurface"] takes the same options as GraphPlot3D.
ResourceFunction["GraphReconstructedSurface"] depends on the resource function HypergraphToGraph to convert a hypergraph into a graph, and the resource function NonConvexHullMesh to construct the embedding surface.

Examples

Basic Examples (1) 

Surface embedding of a Wolfram model:

In[1]:=
ResourceFunction["GraphReconstructedSurface"][
 ResourceFunction[
  "WolframModel"][{{1, 2, 3}, {4, 5, 6}, {1, 4}} -> {{2, 7, 8}, {3, 9,
      10}, {5, 11, 12}, {6, 13, 14}, {13, 8}, {7, 10}, {9, 12}, {11, 14}}, {{0, 0}, {0, 0}, {0, 0}, {0, 0, 0}, {0, 0, 0}}, 10, "FinalState"], 8]
Out[1]=

Scope (4) 

A function to generate a hypergraph:

In[2]:=
hgraph[max_] := Graph[UndirectedEdge @@@ Flatten[Table[
     Sort /@ Partition[Range[0, 2^n - 1]/(2^(n - 1)), 2, 1, 1], {n, max + 1}], 1]]

Generate the list of hyperedges:

In[3]:=
edgl = List @@@ EdgeList[hgraph[10]];

Show the graph and the embedding surface together:

In[4]:=
ResourceFunction["GraphReconstructedSurface"][edgl]
Out[4]=

Change the style:

In[5]:=
ResourceFunction["GraphReconstructedSurface"][edgl, EdgeStyle -> Thick, VertexStyle -> LightBlue]
Out[5]=

Version History

  • 3.0.0 – 15 April 2020
  • 2.0.0 – 16 March 2020
  • 1.0.0 – 10 March 2020

Related Resources

License Information