Connectedness
A sequence of points (i0, j0), ..., (ip , jp), pɬ, is called 4-path (8-path) if
(ik-1, jk-1) is a 4-neighbour (8-neighbour) of (ik, jk) for all k = 1, 2, ... , p.
A discrete set F is 4-connected (8-connected) if for any pair of cells of
a discrete set F there is a 4-path (8-path) connecting them.