A Subset Coloring Algorithm and Its Applications to Computer Graphics

D. Rubinstein, J. Shallit, M. Szegedy

Research output: Contribution to journalArticlepeer-review

1 Scopus citations


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.

Original languageEnglish (US)
Pages (from-to)1228-1232
Number of pages5
JournalCommunications of the ACM
Issue number10
StatePublished - Oct 1 1988
Externally publishedYes

All Science Journal Classification (ASJC) codes

  • Computer Science(all)


  • Bitmap graphics


Dive into the research topics of 'A Subset Coloring Algorithm and Its Applications to Computer Graphics'. Together they form a unique fingerprint.

Cite this