1. A method for generating a pattern of a mask used for exposing a substrate, the method comprising the following steps performed by a processor, obtaining data of a plurality of polygons representing a plurality of pattern elements, grouping polygons which overlap or contact with each other among the plural polygons in one group, not setting an evaluation position for evaluating an image of a pattern of the one group on a line segment of sides which overlap or contact with each other among sides of the polygon of the one group, and setting an evaluation position at a portion except for the line segment, repeating calculating the image of the pattern of the one group, evaluating the calculated image at the set evaluation position, and correcting the pattern based on a result of the evaluating, and generating the pattern of the mask based on a result of the repeating.