Skip to content

Latest commit

 

History

History
98 lines (67 loc) · 2.33 KB

File metadata and controls

98 lines (67 loc) · 2.33 KB

Hypergraph

HypergraphQ | HypergraphSymmetry

Hypergraph[...] represents a hypergraph object:

In[] := Hypergraph[{{1, 1, 2}}]

Hypergraph follows the footsteps of Graph, in that the Hypergraph symbol acts both as a constructor and as an object.

The second argument of Hypergraph specifies the global symmetry of its hyperedges.

In[] := Hypergraph[{{1, 1, 2}}, "Cyclic"]

If left unspecified, the default symmetry is "Ordered":

In[] := Hypergraph[{{1, 1, 2}}] === Hypergraph[{{1, 1, 2}}, "Ordered"]
Out[] = True

Hypergraph objects are atomic raw objects:

In[] := AtomQ[Hypergraph[{{1, 1, 1}}]]
Out[] = True

Given their atomic nature, parts of a Hypergraph object cannot be extracted:

In[] := Hypergraph[{{1, 1, 1}}][[1]]

For this reason, the following accesor functions are supported:

In[] := hg = Hypergraph[{{1, 1, 2}, {2, 5, 4, 3}, {3, 6}}, "Unordered"];
  • EdgeList - the list of (hyper)edges in the hypergraph:

    In[] := EdgeList[hg]
    Out[] = {{1, 1, 2}, {2, 5, 4, 3}, {3, 6}}
  • VertexList- the list of vertices and in the hypergraph:

    In[] := VertexList[hg]
    Out[] = {1, 2, 5, 4, 3, 6}
  • HypergraphSymmetry - the hypergraph symmetry:

    In[]:= HypergraphSymmetry[hg]
    Out[]= "Unordered"

HypergraphQ

HypergraphQ[hg] returns True if hg is a valid Hypergraph object and False otherwise:

In[] := HypergraphQ[Hypergraph[{{1, 1, 2}}]]
Out[] = True
In[] := Quiet @ HypergraphQ[Hypergraph[1]]
Out[] = False

HypergraphSymmetry

A (global) hypergraph symmetry specifies the type of permutation under which each hyperedge of the hypergraph is considered invariant.

  • Ordered:
  • Unordered:
  • Cyclic: