For phase-shifting micro lithography, a method of assigning phase to a set
of shifter polygons in a mask layer separated by a set of target features
includes assigning a first phase to a first shifter polygon, identifying
a set of target features that touch the first shifter polygon, and
assigning a second phase to all shifter polygons in the set that touch
the set of target features in contact with the first shifter polygon. The
set of shifter polygons and the set of target features are separated into
aggregates that are spatially isolated from each other such that the
phase assignment in one aggregate does not affect the phase assignments
in other aggregates. In one embodiment, the first shifter polygon in each
aggregate is selected by merging the set of shifter polygons and set of
target features into a large polygon, marking a vertex of the large
polygon, checking the vertex to make sure it only touches one shifter
polygon, and selecting the single shifter polygon touching the vertex as
the first shifter polygon.