Graph Reductions: Flood Fill
Explore how to solve the flood fill problem by reducing it to a graph reachability problem with whatever-first search. Understand how connected pixel regions can be modeled as graph components, and learn efficient ways to implement this using direct pixel map access without building separate graph structures.
We'll cover the following...
We'll cover the following...
Flood-fill problem using whatever-first search
One of the earliest modern examples of whatever-first search was proposed by Edward Moore in the mid-1950s. A pixel map is a two-dimensional array whose values represent colors; the individual entries in the array are called pixels, an abbreviation of picture elements. A connected region in a pixel map is a connected subset of pixels ...