Learning optimization constraints through knowledge based data generation
In some examples, a system for generating optimization constraints includes a memory device to store human-generated constraint and/or objective definitions that have been programmed in a general-purpose programming language by a human user, and a processor configured to generate labeled data for a plurality of solutions to an optimization problem using the stored constraint and/or objective definitions. The processor is also configured to generate a formal constraint and/or objective model from the labeled constraint and/or objective data, wherein the formal constraint and/or objective model comprises automatically generated constraint and/or objective definitions that are syntactically different from the human-generated constraint and/or objective definitions and syntactically correct for a specific optimization engine.
1 . A system for learning all or part of a mathematical optimization model, comprising:
a memory device to store human-specified constraint and/or objective definitions that have been programmed in a general-purpose programming language by a human user, wherein the human-specified constraint is human-generated, the human-specified constraint and/or objective definitions are not designed for use with a specific optimization engine; and
a processor to:
select the specific optimization engine to generate a solution to an optimization problem;
generate labeled data for a plurality of solutions to the optimization problem using the human-generated constraint and/or objective definitions, wherein the processor in generating the labeled data is further configured to:
select values for each one of a plurality of decision variables;
input the values to an objective function to compute a value of the objective function; and
input the values to the human-generated constraint definitions to determine, for each solution, whether the values satisfy a corresponding constraints;
generate a formal constraint and/or objective model from the labeled data, wherein the formal constraint and/or objective model comprises automatically generated constraint and/or objective definitions that are syntactically different from the human-generated constraint and/or objective definitions and syntactically correct for the specific optimization engine; and
generate a formal objective model from the labeled data, wherein the formal objective model comprises an automatically generated objective function that is syntactically different from a human-generated objective function and syntactically correct for the specific optimization engine.
2 . The system of claim 1 , wherein the processor is further configured to generate a solution to the optimization problem using the automatically generated constraint and/or objective definitions, and execute a computer-readable instruction based on the solution.
3 . The system of claim 1 , wherein to select values of each one of the plurality of decision variables comprises to select the values, via an active learning algorithm, based on the labeled data generated for a previously processed solution or previous learning iterations.
4 . The system of claim 1 , wherein the labeled data comprises, for each solution:
real values of each decision variable input to an objective function of the optimization problem; and
a Boolean value for each solution indicating whether the values of the plurality of decision variables satisfy corresponding human-generated constraint definitions.
5 . The system of claim 4 , wherein the labeled data further comprises a value of the objective function(s) computed based on the input values of each solution.
6 . The system of claim 1 , wherein the automatically generated constraint/objective definitions are generated by a machine learning algorithm.
7 . A method of learning all or part of a mathematical optimization model, comprising:
receiving human-generated constraint and/or objective definitions that have been programmed in a general-purpose programming language by a human user, wherein the human-specified constraint and/or objective definitions are not designed for use with a specific optimization engine;
selecting the specific optimization engine to generate a solution to an optimization problem;
generating labeled data for a plurality of solutions to the optimization problem using the human generated constraint and/or objective definitions, wherein the generating the labeled data further comprises:
selecting values for each one of a plurality of decision variables;
inputting the values to an objective function to compute a value of the objective function; and
inputting the values to the human-generated constraint definitions to determine, for each solution, whether the values satisfy a corresponding constraints;
generating a formal constraint and/or objective model from the labeled data, wherein the formal constraint and/or objective model comprises automatically generated constraint and/or objective definitions that are syntactically different from the human-generated constraint and/or objective definitions and syntactically correct for the specific optimization engine; and
generating a formal objective model from the labeled data, wherein the formal objective model comprises an automatically generated objective function that is syntactically different from a human-generated objective function and syntactically correct for a specific optimization engine.
8 . The method of claim 7 , comprising generating a solution to the optimization problem using the automatically generated constraint and/or objective definitions, and executing a computer-readable instruction based on the solution.
9 . The method of claim 7 , wherein to select values of each one of the plurality of decision variables comprises to select the values, via an active learning algorithm, based on the labeled data generated for a previously processed solution or previous learning iterations.
10 . The method of claim 7 , wherein the labeled data comprises, for each solution:
real values of each solution variable input to an objective function of the optimization problem; and
a Boolean value for each solution indicating whether the values of the plurality of decision variables satisfy corresponding human-generated constraint definitions.
11 . The method of claim 10 , wherein the labeled data further comprises a value of the objective function(s) computed based on the input values of each solution variable.
12 . The method of claim 7 , wherein the automatically generated constraint/objective definitions are generated by a machine learning algorithm.
13 . A computer program product comprising a computer readable storage medium having program instructions embodied therewith, wherein the computer readable storage medium is not a transitory signal per se, and wherein the program instructions are executable by a processor to cause the processor to:
receive human-generated constraint and/or objective definitions that have been programmed in a general-purpose programming language by a human userthe human-specified constraint and/or objective definitions are not designed for use with a specific optimization engine;
select the specific optimization engine to generate a solution to an optimization problem;
generate labeled data for a plurality of solutions to the optimization problem using the human generated constraint and/or objective definitions, wherein the generating the labeled data is further configured to cause the processor to:
select values for each one of a plurality of decision variables;
input the values to an objective function to compute a value of the objective function; and
input the values to the human-generated constraint definitions to determine, for each solution, whether the values satisfy a corresponding constraints;
generate a formal constraint and/or objective model from the labeled data, wherein the formal constraint and/or objective model comprises automatically generated constraint and/or objective definitions that are syntactically different from the human-generated constraint and/or objective definitions and syntactically correct for the specific optimization engine; and
generate a formal objective model from the labeled data, wherein the formal objective model comprises an automatically generated objective function that is syntactically different from a human-generated objective function and syntactically correct for a specific optimization engine.
14 . The computer program product of claim 13 , wherein the labeled data comprises, for each solution:
real values of each decision variable input to an objective function of the optimization problem; and
a Boolean value for each solution indicating whether the values of the plurality of decision variables satisfy corresponding human-generated constraint definitions.