Description
A collection of cells $\mathcal{P}$ is connected if for every pair of cells $A$ and $B$ of $\mathcal{P}$ there exists a path of cells $A=C_1,...,C_t=B$ of $\mathcal{P}$, such that $C_i\cap C_{i+1}$ is an edge, for all $i=1,..,t-1$. This function determines whether the collection of cells $\mathcal{P}$ is connected and the number of the connected components.
i1 : Q = cellCollection {{1,1},{2,1},{3,2}};
|
i2 : collectionIsConnected Q
o2 = (false, 2)
o2 : Sequence
|