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

connectedComponents -- returns the connected components of a hypergraph

Synopsis

Description

The connected components of a hypergraph are sets of vertices in which each vertex is connected to each other by a path. Each connected component is disjoint and vertices that are not contained in any edge do not appear in any connected component.
i1 : R = QQ[a..l];
i2 : H = hyperGraph {a*b*c, c*d, d*e*f, h*i, i*j, l}

o2 = HyperGraph{edges => {{a, b, c}, {c, d}, {d, e, f}, {h, i}, {i, j}, {l}}}
                ring => R
                vertices => {a, b, c, d, e, f, g, h, i, j, k, l}

o2 : HyperGraph
i3 : L = connectedComponents H

o3 = {{a, b, c, d, e, f}, {h, i, j}, {l}}

o3 : List
i4 : apply(L, C -> inducedHyperGraph(H,C))

o4 = {HyperGraph{edges => {{a, b, c}, {c, d}, {d, e, f}}},
                 ring => QQ[a, b, c, d, e, f]             
                 vertices => {a, b, c, d, e, f}           
     ------------------------------------------------------------------------
     HyperGraph{edges => {{h, i}, {i, j}}}, HyperGraph{edges => {{l}} }}
                ring => QQ[h, i, j]                    ring => QQ[l]
                vertices => {h, i, j}                  vertices => {l}

o4 : List

See also

Ways to use connectedComponents :