1. A method comprising: simulating a lithography process of a first set of layout features and a second set of layout features using a lithography model, wherein the lithography model is expressed as a plurality of functions that indicate light intensity on an image plane, wherein the simulating produces a first plurality of values representing respective contributions of the plurality of functions to imaging the first set of layout features and produces a second plurality of values representing respective contributions of the plurality of functions to imaging the second set of layout features; determining optical similarity values between the first set of layout features and the second set of layout features based on the first plurality of values and the second plurality of values wherein each of the optical similarity values indicate a degree of similarity between one or more layout features in the first set of layout features and one or more layout features in the second set of layout features; and changing the first set of layout features based on the optical similarity values.