Hypergraph-class: Class Hypergraph

Description Objects from the Class Slots Methods Author(s) See Also Examples

Description

A hypergraph consists of a set of nodes and a set of hyperedges. Each hyperedge is a subset of the node set. This class provides a representation of a hypergraph that is (hopefully) useful for computing.

Objects from the Class

Objects can be created by calls of the form new("Hypergraph", nodes, hyperedges). You can also use the convenience function Hypergraph. The nodes argument should be a character vector of distinct labels representing the nodes of the hypergraph. The hyperedges argument must be a list of Hyperedge-class objects.

Slots

nodes:

A "character" vector specifying the nodes

hyperedges:

A "list" of Hyperedge-class objects

Methods

hyperedges

signature(.Object = "Hypergraph"): Return the list of Hyperedge objects

hyperedgeLabels

signature(.Object = "Hypergraph"): Return a character vector of labels for the Hyperedge objects in the hypergraph.

inciMat

signature(.Object = "Hypergraph"): Return the incidence matrix representation of this hypergraph

inciMat2HG

signature(.Object = "matrix"): Return the hypergraph representation of this incidence matrix

initialize

signature(.Object = "Hypergraph"): Create an instance

nodes

signature(object = "Hypergraph"): Return the vector of nodes (character vector)

numNodes

signature(object = "Hypergraph"): Return the number of nodes in the hypergraph

toGraphNEL

signature(.Object = "Hypergraph"): Return the graphNEL representation of the hypergraph (a bipartite graph)

Author(s)

Seth Falcon

See Also

Hyperedge-class DirectedHyperedge-class graphNEL-class

Examples

1
2
3
nodes <- LETTERS[1:4]
hEdges <- lapply(list("A", LETTERS[1:2], LETTERS[3:4]), "Hyperedge")
hg <- new("Hypergraph", nodes=nodes, hyperedges=hEdges)

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

hypergraph documentation built on Nov. 8, 2020, 5:53 p.m.