1. A computer-implemented method for assigning phases to a plurality P 1 of light shifter polygons of a photolithographic mask through which light is to be transmitted to photolithographically pattern an area on a substrate, wherein the mask has a plurality of locations corresponding to a plurality P 2 of target features which are located between the shifter polygons, the method comprising: converting connectivity relationships between said plurality P 1 and said plurality P 2 into a graph, wherein each node represents a polygon in said plurality P 1 and each connection between two of said nodes represents a target feature in said plurality P 2 ; and coloring nodes of said graph, using said phases as colors.