best_subnets: The best subnetworks

View source: R/subnets.R

best_subnetsR Documentation

The best subnetworks

Description

Search best subnetworks that maximize given objective functions.

Usage

best_subnets(
  func,
  net.matrix,
  max.size = 10,
  exhaust.size = 5,
  max.top = 10000
)

Arguments

func

The objective function to maximize

net.matrix

The adjacent matrix of network

max.size

The maximal size of subnetworks

exhaust.size

The maximal size of subnetworks that use exhaustive searching strategy

max.top

The maiximal number of top candidates kept for evaluation of next size, used in heuristic searching strategy

Details

Enumerate and search the best subnetworks that maximize given objective function. If the size of subnetworks <= exhaust.size, exact exhaustive searching is applied, otherwise, heuristic searching algorithm is used.

Value

A list with the following two components:

subnets

The list of top subnetworks in different sizes

obj.values

The list of objective values of corresponding subnetworks

See Also

get_subnets, extend_subnets

Examples


library(Corbi)
net <- matrix(FALSE, nrow=10, ncol=10)
net[sample.int(100, 20)] <- TRUE
net <- net | t(net)
func <- function(subnet) max(subnet) - min(subnet)
result <- best_subnets(func, net, 5)


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