get_subnets: All subnetworks of limited size

View source: R/subnets.R

get_subnetsR Documentation

All subnetworks of limited size

Description

Enumerate all subnetworks of size <= max.size from given network.

Usage

get_subnets(net.matrix, max.size = 2)

Arguments

net.matrix

The adjacent matrix of network

max.size

The maximal size of subnetworks

Value

A list of generated subnetworks, with element $i$ corresponds the subnetworks of size $i$. Each element is a matrix, in which each row represents a subnetwork.

Examples


library(Corbi)
net <- matrix(FALSE, nrow=10, ncol=10)
net[sample.int(100, 20)] <- TRUE
net <- net | t(net)
subnets <- get_subnets(net, 3)


Corbi documentation built on May 30, 2022, 5:06 p.m.