toponetx.HyperEdge#

class toponetx.HyperEdge(elements: Collection, rank=None, **kwargs)[source]#

Bases: Atom[frozenset[Hashable]]

Class for a hyperedge (or a set-type cell).

This class represents a set-type cell in a combinatorial complex, which is a set of nodes with optional attributes and a rank. The nodes in a hyperedge must be hashable and unique, and the hyperedge itself is immutable.

Parameters:
elementsiterable of hashables

The nodes in the hyperedge.

rankint, optional

The rank of the hyperedge. Default is None.

**kwargsadditional attributes

Additional attributes of the hyperedge, as keyword arguments.

Attributes:
rank

Rank of the HyperEdge.

Methods

update(attributes)

Update the attributes of the atom.

Examples

>>> ac1 = tnx.HyperEdge((1, 2, 3))
>>> ac2 = tnx.HyperEdge((1, 2, 4, 5))
>>> ac3 = tnx.HyperEdge(("a", "b", "c"))
>>> ac3 = tnx.HyperEdge(("a", "b", "c"), rank=10)
__init__(elements: Collection, rank=None, **kwargs) None[source]#

Methods

__init__(elements[, rank])

update(attributes)

Update the attributes of the atom.

Attributes

rank

Rank of the HyperEdge.

elements

name

property rank#

Rank of the HyperEdge.

Returns:
int or None

The rank of the HyperEdge if it is not None, None otherwise.

update(attributes: dict) None#

Update the attributes of the atom.

Parameters:
attributesdict

The attributes to be updated.