clique.census | R Documentation |
clique.census
computes clique census statistics on one or more input graphs. In addition to aggregate counts of maximal cliques, results may be disaggregated by vertex and co-membership information may be computed.
clique.census(dat, mode = "digraph", tabulate.by.vertex = TRUE,
clique.comembership = c("none", "sum", "bysize"), enumerate = TRUE,
na.omit = TRUE)
dat |
one or more input graphs. |
mode |
|
tabulate.by.vertex |
logical; should maximal clique counts be tabulated by vertex? |
clique.comembership |
the type of clique co-membership information to be tabulated, if any. |
enumerate |
logical; should an enumeration of all maximal cliques be returned? |
na.omit |
logical; should missing edges be omitted? |
A (maximal) clique is a maximal set of mutually adjacenct vertices. Cliques are important for their role as cohesive subgroups, but show up in many other contexts as well.
A subgraph census statistic is a function which, for any given graph and subgraph, gives the number of copies of the latter contained in the former. A collection of subgraph census statistics is referred to as a subgraph census; widely used examples include the dyad and triad censuses, implemented in sna
by the dyad.census
and triad.census
functions (respectively). Likewise, kpath.census
and kcycle.census
compute a range of census statistics related to k
-paths and k
-cycles. clique.census
provides similar functionality for the census of maximal cliques, including:
Aggregate counts of maximal cliques by size.
Counts of cliques to which each vertex belongs (when tabulate.byvertex==TRUE
).
Counts of clique co-memberships, potentially disaggregated by size (when the appropriate co-membership argument is set to bylength
).
These calculations are intrinsically expensive (clique enumeration is NP hard in the general case), and users should be aware that computing the census can be impractical on large graphs (unless they are very sparse). On the other hand, the algorithm employed here (a variant of Makino and Uno (2004)) is generally fast enough to suport enumeration for even dense graphs of several hundred vertices on a typical desktop computer.
Calling this function with mode=="digraph"
, forces and initial symmetrization step, which can be avoided with mode=="graph"
. While incorrectly employing the default is harmless (except for the relatively small cost of verifying symmetry), setting mode=="graph"
incorrectly may result in problematic behavior. When in doubt, stick with the default.
A list with the following elements:
clique.count |
If |
clique.comemb |
If |
cliques |
If |
The computational cost of calculating cliques grows very sharply in size and network density. It is possible that the expected completion time for your calculation may exceed your life expectancy (and those of subsequent generations).
Carter T. Butts buttsc@uci.edu
Wasserman, S. and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
Makino, K. and Uno, T. (2004.) “New Algorithms for Enumerating All Maximal Cliques.” In T. Hagerup and J. Katajainen (eds.), SWAT 2004, LNCS 3111, 260-272. Berlin: Springer-Verlag.
dyad.census
, triad.census
, kcycle.census
, kpath.census
#Generate a fairly dense random graph
g<-rgraph(25)
#Obtain cliques by vertex, with co-membership by size
cc<-clique.census(g,clique.comembership="bysize")
cc$clique.count #Examine clique counts
cc$clique.comemb[1,,] #Isolate co-membership is trivial
cc$clique.comemb[2,,] #Co-membership for 2-cliques
cc$clique.comemb[3,,] #Co-membership for 3-cliques
cc$cliques #Enumerate the cliques
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.