Method for computer-aided optimization of an occupancy of magazine slots by tools within at least one tool magazine for a machine tool, wherein one or more workpieces of one or more workpiece types are manufactured using the tools provided by a magazine device at a supply point, having the following steps: a) detecting a set of workpieces to be manufactured, b) detecting a set of magazine slots in at least one tool magazine, c) detecting a set of tools, d) detecting the space requirement and possibly at least one further property for each tool, e) detecting permissible magazine slots per tool, wherein a permissible magazine slot is dependent on the space requirement and/or on the further property of the tool and/or a detected property of the magazine slot, f) detecting a permissible initial magazine occupancy, wherein an initial magazine slot is detected for each tool, g) detecting a sequence of work steps to be performed by the machine tool on a workpiece, wherein a tool envisaged for a work step of the sequence is used to manufacture the workpiece, h) detecting work step times that are each needed to perform an individual work step on the workpiece, i) detecting one or more supply times, on the basis of the sequence of the work steps to be performed and on the basis of a magazine occupancy, that are each needed by the magazine device at the supply point to provide a tool for the next work step, j) optimizing the occupancy of the magazine slots by tools, wherein each tool can occupy only one permissible magazine slot without collision, so that the overall waiting period is minimized, wherein the overall waiting period is made up of individual waiting periods that each result from the difference between the detected supply time and the detected work step time if the value of the difference is positive, otherwise the individual waiting period assumes the value zero, characterized k) in that the occupancy of the magazine slots by tools is optimized by means of mixed integer linear optimization such that these tools are placed in the same magazine slots as the initial magazine occupancy or in permissible magazine slots close to their previously occupied magazine slot without collision. a) detecting a set of workpieces to be manufactured, b) detecting a set of magazine slots in at least one tool magazine, c) detecting a set of tools, d) detecting the space requirement and possibly at least one further property for each tool, e) detecting permissible magazine slots per tool, wherein a permissible magazine slot is dependent on the space requirement and/or on the further property of the tool and/or a detected property of the magazine slot, f) detecting a permissible initial magazine occupancy, wherein an initial magazine slot is detected for each tool, g) detecting a sequence of work steps to be performed by the machine tool on a workpiece, wherein a tool envisaged for a work step of the sequence is used to manufacture the workpiece, h) detecting work step times that are each needed to perform an individual work step on the workpiece, i) detecting one or more supply times, on the basis of the sequence of the work steps to be performed and on the basis of a magazine occupancy, that are each needed by the magazine device at the supply point to provide a tool for the next work step, j) optimizing the occupancy of the magazine slots by tools, wherein each tool can occupy only one permissible magazine slot without collision, so that the overall waiting period is minimized, wherein the overall waiting period is made up of individual waiting periods that each result from the difference between the detected supply time and the detected work step time if the value of the difference is positive, otherwise the individual waiting period assumes the value zero, characterized k) in that the occupancy of the magazine slots by tools is optimized by means of mixed integer linear optimization such that these tools are placed in the same magazine slots as the initial magazine occupancy or in permissible magazine slots close to their previously occupied magazine slot without collision.