Home

fouradjacent

Fouradjacent, also written as four-adjacent or four-connectivity, refers to a relationship between cells in a two-dimensional square lattice in which a cell is considered adjacent to its four orthogonally neighboring cells: up, down, left, and right. This concept is central in grid graphs, digital topology, and image processing, where connectivity and neighborhood definitions govern how regions are explored and labeled.

Formally, for a grid coordinate (x, y), the four-adjacent neighbors are (x−1, y), (x+1, y), (x, y−1),

In graph terms, a grid with four-adjacency is a graph where each node corresponds to a grid

Applications of four-adjacency include image segmentation, connected-component labeling under 4-connectivity, and simulations on lattice models. Understanding

---

and
(x,
y+1).
In
a
finite
grid,
boundary
cells
have
fewer
than
four
neighbors.
Four-adjacency
contrasts
with
eight-adjacency
(or
8-connectivity),
which
also
includes
diagonal
neighbors
(x±1,
y±1).
The
degree
of
a
typical
interior
cell
under
four-adjacency
is
four,
while
boundary
and
corner
cells
have
fewer.
cell
and
edges
connect
four-adjacent
pairs.
Algorithms
operating
on
such
grids—such
as
breadth-first
search,
Dijkstra,
A*
pathfinding,
or
flood
fill—often
restrict
movements
to
the
four
cardinal
directions.
the
distinction
between
four-
and
eight-adjacency
is
important,
as
it
can
affect
connectivity
results,
region
labeling,
and
the
behavior
of
diffusion
or
pathfinding
processes.