next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 web site

hyperGraphToSimplicialComplex -- turns a (hyper)graph into a simplicial complex

Synopsis

Description

This function changes the type of a (hyper)graph to a simplicial complex where the facets of the simplicial complex are given by the edge set of the (hyper)graph. This function is the reverse of simplicialComplexToHyperGraph. This function enables the users to make use of the functions in the package SimplicialComplexes
i1 : R = QQ[x_1..x_6];
i2 : G = graph({x_1*x_2,x_2*x_3,x_3*x_4,x_4*x_5,x_1*x_5,x_1*x_6,x_5*x_6}) --5-cycle and a triangle

o2 = Graph{edges => {{x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }}}
                       1   2     2   3     3   4     1   5     4   5     1   6     5   6
           ring => R
           vertices => {x , x , x , x , x , x }
                         1   2   3   4   5   6

o2 : Graph
i3 : DeltaG = hyperGraphToSimplicialComplex G

o3 = | x_5x_6 x_1x_6 x_4x_5 x_1x_5 x_3x_4 x_2x_3 x_1x_2 |

o3 : SimplicialComplex
i4 : hyperGraphDeltaG = simplicialComplexToHyperGraph DeltaG

o4 = HyperGraph{edges => {{x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }}}
                            1   2     2   3     3   4     1   5     4   5     1   6     5   6
                ring => R
                vertices => {x , x , x , x , x , x }
                              1   2   3   4   5   6

o4 : HyperGraph
i5 : GPrime = graph(hyperGraphDeltaG)

o5 = Graph{edges => {{x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }, {x , x }}}
                       1   2     2   3     3   4     1   5     4   5     1   6     5   6
           ring => R
           vertices => {x , x , x , x , x , x }
                         1   2   3   4   5   6

o5 : Graph
i6 : G === GPrime

o6 = true

See also

Ways to use hyperGraphToSimplicialComplex :