Graph Reductions: Flood Fill

Learn about the flood fill algorithm and its applications in graph algorithms.

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 that all have the same color, where two pixels are considered adjacent if they are immediate horizontal or vertical neighbors. The flood fill operation, commonly represented by a paint can in raster-graphics editing software, changes every pixel in a connected region to a new color; the input to the operation consists of the indices ii and jj of one pixel in the target region and the new color.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy