FindCG:
Find the connected subgraphs with a certain number of nodes
Description
FindCG is used to find all the connected subgraphs with a certain number of nodes.
Usage
FindCG(adjacency.matrix, cg.initial)
Arguments
adjacency.matrix
p by p adjacency matrix of an undirected graph. It must be symmetric.
cg.initial
It could be 1:p or a matrix, whose elements are positive integers from 1 to p. If it is a length p vector, FindCG converts it into a matrix with one column. For a matrix with k columns, FindCG reads its rows as th indices of a collection of connected subgraphs with k nodes.
Value
cg.new
If the input is a matrix with k columns and stores the indices of all the size k connected subgraphs, the output is a matrix with k+1 columns storing the indices of all the connected subgraphs with k+1 nodes.