Learn R Programming

ScreenClean (version 1.0.1)

FindAllCG: Find all the connected subgraphs whose size

Description

FindAllCG uses FindCG iteratively, and lists all the connected subgraphs with no more than lc nodes

Usage

FindAllCG(adjacency.matrix, lc)

Arguments

adjacency.matrix
p by p adjacency matrix of an undirected graph; it must be symmetric.
lc
the maximal size of the connected subgraphs to be listed

Value

cg.all
A list, whose kth component is a matrix with k columns that lists all the connected subgraphs with k nodes.

See Also

FindCG

Examples

Run this code
require(MASS)
require(Matrix)
p <- 10
Omega <- sparseMatrix(c(1:(p-1),2:p),c(2:p,1:(p-1)),x=1)
cg.all <- FindAllCG(Omega,3)

Run the code above in your browser using DataLab