Learn R Programming

HyperG (version 1.0.0)

induced_hypergraph: Induced hypergraph.

Description

Computes the hypergraph induced by a subset of the vertices.

Usage

induced_hypergraph(h, v, simplify = TRUE)

Arguments

h

a hypergraph.

v

a vector of vertices.

simplify

logical.

Value

a hypergraph.

Details

First the hypergraph is reduced to only those vertices in v. This results in it retaining only those hyper-edges containing any elements of v, as well as removing from the resultant hyper-edges any vertices not in v. If simplify is true, loops are then removed. This function always removes empty hyper-edges, so any hyper-edge which does not contain any elements of v is removed.

Examples

Run this code
# NOT RUN {
   h <- hypergraph_from_edgelist(list(1:4,3:7,c(1,3,5)))
	k <- induced_hypergraph(h,c(1,3,5))
# }

Run the code above in your browser using DataLab