There are three types of connectivity:

1. 4-connectivity: Pixels p and q with values from V are 4-connected if q is in the set of N4(p).

2. 8-connectivity: Pixels p and q with values from v are 8-connected if q is in the set of N8(p).

3. m-connectivity(mixed): Pixels p and q with values from v are m-connected if q is in the set of N4(p) or q is in the set ND(p) and the set N4(p) ^N4(q) is empty.