A program generation device generates a program for controlling machining of a groove which is performed by machining a plurality of holes on a workpiece. The program generation device receives specified values including a tool radius, a groove shape (a length of the groove), and a cusp height and calculates positions of the plurality of holes based on the specified values which are received. Then, the program generation device calculates a machining order of the plurality of holes based on the specified values and respective values calculated by a hole machining set value calculation unit so that a bias is not generated in a removal stock for a tool in machining.