1. A method to obtain a pattern layout for a lithographic process, the method comprising: identifying an initial pattern layout including a plurality of features; performing (i) splitting certain one or more of the features into two or more discrete features, or (ii) joining two or more of the features into a single feature, or (iii) both (i) and (ii); reconfiguring the features with a set of changes to the features; and determining if a termination condition is satisfied with respect to the set of changes to the features, thereby obtaining an electronic data representation of a desired pattern layout for patterning a substrate using a lithographic process; wherein the determining comprises evaluating, by a hardware computer, a cost function that measures how a lithographic metric is affected by the set of changes to the features for a plurality of lithographic process conditions, and expanding the cost function into a series of terms at least some of which are functions of one or more characteristics of the features.