hypergraph: Hypergraphs

View source: R/utilities.R

hypergraphR Documentation

Hypergraphs

Description

Hypergraph consist of a set of objects and a collection of subsets of objects, in which each object belongs to at least one subset, and no subset is empy (Berge, 1989)

Usage

hypergraph(A, dual = TRUE, both = TRUE)

Arguments

A

An incidence matrix.

dual

Whether to return the dual hypergraph (which rever the role of the pointes and the edges)

both

Whether to return the hypergraph and the dual hypergraph

Value

This function returns an adjacent list of the subsets of entities in the hypergraph.

Author(s)

Alejandro Espinosa-Rada

References

Berge, C. (1973). Graphs and hypergraphs.Amsterdam: North-Holland.

Berge, C. (1989). Hypergraphs: Combinatorics of finite sets. Amsterdam: North-Holland.

Wasserman, S. and Faust, K. (1994). Social network analysis: Methods and applications. Cambridge University Press.

Examples

A <- matrix(c(
  1, 0, 1,
  0, 1, 0,
  0, 1, 1,
  0, 0, 1,
  1, 1, 1,
  1, 1, 0
), byrow = TRUE, ncol = 3)
colnames(A) <- letters[1:ncol(A)]
rownames(A) <- letters[(ncol(A) + 1):(nrow(A) + ncol(A))]
hypergraph(A, both = TRUE)

anespinosa/netmem documentation built on April 5, 2025, 5:02 p.m.