Given a zero-indexed adjacency list and an array of group identifiers, this
returns a tibble which identifies the connected components. The three columns
are group
for the inputted group, group_number
which uniquely identifies each
group as a positive integer, and component
which identifies the connected
component number for each corresponding entry of adjacency and group. If everything
is connected within the group, then each element of component
will be 1
.
Otherwise, the largest component is given the value 1
, the next largest 2
,
and so on.
If nothing is provided to group, it will default to a vector of ones, checking
if the adjacency graph is connected.
cct()
is shorthand for creating a table of the component values. If everything
is connected within each group, it returns a value of 1. In general, it returns
a frequency table of components.
ccm()
is shorthand for getting the maximum component value. It returns the
maximum number of components that a group is broken into.
This returns 1 if each group is connected. #'