A production plan generating device configured to generate a production plan for a surface mounting line including a plurality of mounters for mounting surface mounting components on printing boards to produce products, comprising: a first optimizing unit configured to formulate, as an integer plan problem for each of variations for which optimization indices and constraints vary, component allocation indicating, for each of types of the products, any of the mounters, surface mounting components, and the number of surface mounting components to be mounted on a printing board from the mounter, and optimize the component allocation using an integer plan problem solver; a grouping unit configured to use results of the process by the first optimizing unit to execute, for each of the variations, a process of grouping the types of products to be produced without switching surface mounting component supply carriages set for the plurality of mounters; a second optimizing unit configured to formulate, as an integer plan problem, the order of the production of groups of the products after the grouping, solve the integer plan problem using an integer plan problem solver, and execute, for each of the variations, a process of optimizing the production order so that a time period for producing all the products is minimized; a determining unit configured to determine, as the production plan for the surface mounting line, a production plan that is among results, obtained by the second optimizing unit, of the process of optimizing the production order and causes the shortest production time period; and a third optimizing unit configured to execute, for each of the variations, a process of reoptimizing the component allocation so that a time period for mounting the surface mounting components on the types of printing boards included in the groups after the grouping by the grouping unit is minimized, wherein the second optimizing unit is configured to execute a process of optimizing the production order of the groups of the products after the grouping based on results of the process by the third optimizing unit and execute a process of optimizing the production order of the groups of the products after the grouping based on results of the process by the grouping unit. a first optimizing unit configured to formulate, as an integer plan problem for each of variations for which optimization indices and constraints vary, component allocation indicating, for each of types of the products, any of the mounters, surface mounting components, and the number of surface mounting components to be mounted on a printing board from the mounter, and optimize the component allocation using an integer plan problem solver; a grouping unit configured to use results of the process by the first optimizing unit to execute, for each of the variations, a process of grouping the types of products to be produced without switching surface mounting component supply carriages set for the plurality of mounters; a second optimizing unit configured to formulate, as an integer plan problem, the order of the production of groups of the products after the grouping, solve the integer plan problem using an integer plan problem solver, and execute, for each of the variations, a process of optimizing the production order so that a time period for producing all the products is minimized; a determining unit configured to determine, as the production plan for the surface mounting line, a production plan that is among results, obtained by the second optimizing unit, of the process of optimizing the production order and causes the shortest production time period; and a third optimizing unit configured to execute, for each of the variations, a process of reoptimizing the component allocation so that a time period for mounting the surface mounting components on the types of printing boards included in the groups after the grouping by the grouping unit is minimized, wherein the second optimizing unit is configured to execute a process of optimizing the production order of the groups of the products after the grouping based on results of the process by the third optimizing unit and execute a process of optimizing the production order of the groups of the products after the grouping based on results of the process by the grouping unit.