hatvis.core.DirectedHypergraph#

class hatvis.core.DirectedHypergraph(arcs, *, nodes=None, weights=None, edge_labels=None, name=None, edge_data=None)[source]#

Bases: object

Directed hypergraph: every hyperarc \(e=(T(e),\,H(e))\) has a tail and a head set.

Directed hypergraphs (Gallo et al. 1993) model AND-type dependencies: reactions, Horn clauses, assembly steps or association rules \(X\Rightarrow Y\).

Parameters:
arcsiterable of (tail, head) pairs or mapping label -> (tail, head)
nodes, weights, edge_labels, namesee Hypergraph.
>>> D = DirectedHypergraph([([“a”, “b”], [“c”]), ([“c”], [“d”, “e”])])
>>> D.tails(), D.heads()
({‘e0’: (‘a’, ‘b’), ‘e1’: (‘c’,)}, {‘e0’: (‘c’,), ‘e1’: (‘d’, ‘e’)})
heads()[source]#

Mapping arc -> head vertices.

tails()[source]#

Mapping arc -> tail vertices.

to_undirected()[source]#

Forget directions: every hyperarc becomes the hyperedge \(T(e)\cup H(e)\).