A method for determining a mask pattern to be used on a photo-mask in a
photolithographic process is described. During the method, a target
pattern is partitioning into subsets, which are distributed to
processors. Then, a set of second mask patterns, each of which
corresponds to one of the subsets, is determined. Moreover, at least one
of the second set of mask patterns may be determined by: providing a
first mask pattern that includes distinct types of regions corresponding
to distinct types of regions of the photo-mask, calculating a gradient of
a function, and determining a second mask pattern based, at least in
part, on the gradient. Note that the function may depend on the first
mask pattern and an estimate of a wafer pattern that results from the
photolithographic process, and that the gradient may be calculated in
accordance with a formula obtained by taking a derivative of the
function.