1. A method of constructing a mask for use in semiconductor device manufacturing, the method comprising: selecting, using a processor, a first shape related to mask construction from a set of shapes; selecting a second shape related to the mask construction from the set of shapes; representing the first shape using a first shape vector that includes coefficients that are indicative of the first shape; and the second shape using a second shape vector that includes coefficients that are indicative of the second shape; and forming a cluster that groups the first shape with the second shape when a distance metric between the coefficients of the first shape vector and the coefficients of the second shape vector is less than a selected criterion.