best_subnets | R Documentation |
Search best subnetworks that maximize given objective functions.
best_subnets( func, net.matrix, max.size = 10, exhaust.size = 5, max.top = 10000 )
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 |
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.
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 |
get_subnets, extend_subnets
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.