A subset coloring algorithm and its applications to computer graphics

  • Authors:
  • D. Rubinstein;J. Shallit;M. Szegedy

  • Affiliations:
  • -;-;-

  • Venue:
  • Communications of the ACM
  • Year:
  • 1988

Quantified Score

Hi-index 48.22

Visualization

Abstract

We consider the following problem: we are given a diagram made up of intersecting circles, where each region is colored either black or white. We wish to display this diagram on a bitmap device, where we are allowed to (i) paint a given circle white and (ii) invert the colors within a given circle, changing white to black and vice versa. (These operations are frequently provided in graphics hardware or software.) We ask: using only these paint and invert operations, is it possible to draw the diagram? A generalization of this problem leads to an analogous coloring problem on a subset of the power set of n elements. We give a polynomial-time algorithm that answers the question above, and produces a "short" sequence of instructions to draw the diagram, if one exists. A simple modification of the algorithm permits us to handle the case where there are more colors than just black and white, and the colors are represented by bit strings. This corresponds to the conventions frequently used with color raster devices.