Method for optimizing industrial scene by using model embedded mixed integer linear programming
By transforming the MILP problem into a bipartite graph and using reinforcement learning methods to identify and remove redundant constraints, the problem of numerous redundant constraints in existing technologies is solved, and efficient solution and optimization of mixed-integer linear programming is achieved.
Patent Information
- Application Number
- CN202511418985.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies for converting machine learning models into mixed integer linear programming (MILP) constraints suffer from numerous redundant constraints and low solution efficiency, which affects the practical application effect of industrial scenario optimization.
By constructing a reinforcement learning environment, the MILP problem is transformed into a bipartite graph. Graph convolutional neural networks are used to extract structured features, and a customized reward function is combined to score the importance of constraints. Redundant constraints with little impact on the optimal value are intelligently identified and removed, thus forming a MILP problem with redundant constraints removed.
It significantly improves the solution efficiency and reliability of MILP problems, avoids the large fluctuations in the optimal value caused by traditional random removal strategies, and balances the solution efficiency and solution quality.
Smart Images

Figure CN121121418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of optimizing industrial scenarios by embedding machine learning models into mixed-integer linear programming, and more particularly to a method for optimizing industrial scenarios by embedding models into mixed-integer linear programming. Background Technology
[0002] Embedding machine learning models into mixed-integer linear programming (MILP) problems is an effective approach for solving complex optimization problems. However, existing techniques have some limitations in this process. Currently, machine learning models (such as neural networks and decision trees) are mainly converted into MILP constraints through manual derivation or the use of limited automated tools. Manual derivation is inefficient and error-prone, potentially leading to optimization results that deviate from actual requirements. Automated tools, on the other hand, typically only support simple models and specific frameworks, making it difficult to adapt to complex machine learning models.
[0003] More importantly, the inherent complexity of machine learning models leads to the generation of numerous redundant constraints during the transformation process. For example, deep neural networks contain a large number of neurons and connection weights, and decision trees contain complex branching structures. When these are transformed into MILP constraints, they introduce inherent intermediate variables and redundant constraints. These redundant constraints significantly increase the complexity of the solution and reduce its efficiency. While existing methods attempt to reduce solution time by randomly removing some embedded constraints, random removal strategies cannot guarantee that the removed constraints have a minimal impact on the optimal value, often resulting in significant changes to the optimal value and affecting the reliability of the solution results.
[0004] In summary, existing technologies for converting machine learning models into MILP constraints suffer from problems such as redundant constraints and low solution efficiency. These issues limit the practical application of data-driven optimization of industrial scenarios by embedding machine learning models into mixed-integer linear programming, which is a problem that urgently needs to be solved.
[0005] In view of this, the present invention is hereby proposed. Summary of the Invention
[0006] The purpose of this invention is to provide a method for optimizing industrial scenarios by embedding a model into mixed-integer linear programming, which can improve the speed and quality of optimizing industrial scenarios by embedding machine learning models into mixed-integer linear programming, thereby solving the above-mentioned technical problems existing in the prior art.
[0007] The objective of this invention is achieved through the following technical solution: A method for optimizing industrial scenarios using model embedding mixed-integer linear programming includes: Step 1, Industrial Data Acquisition and Preprocessing: We collect and utilize raw industrial data related to mixed-integer linear programming optimization from multiple industrial scenarios, preprocess the raw industrial data to obtain multi-source data, and use the multi-source data to construct a training dataset that is directly input into the machine learning model. Step 2, Training the Constrained Machine Learning Model: Using the training dataset constructed in step 1, select multiple machine learning models for training, evaluate the performance of the trained machine learning models with predetermined indicators, and dynamically select the optimal machine learning model as the constrained machine learning model based on the evaluation results and the corresponding optimization requirements of the industrial scenario. Step 3, Embedding Constraint Machine Learning Model Steps:
[0008] The constrained machine learning model selected in step 2 is converted into mixed-integer linear programming constraints, and the standard set of mixed-integer linear programming constraints and the corresponding set of variables are output.
[0009] Step 4, Redundant constraint removal based on reinforcement learning: A reinforcement learning environment is constructed to convert mixed-integer linear programming instances, which are constructed using a set of mixed-integer linear programming constraints and corresponding variable sets, into a bipartite graph. A graph convolutional neural network is used to extract the structured features of the mixed-integer linear programming instances from the bipartite graph. Based on these structured features and a customized reward function, the importance of all constraints in the mixed-integer linear programming constraint set is scored. Based on the importance scores, a constraint removal strategy is used to remove redundant constraints that prevent changes in the optimal value from exceeding a predetermined value, resulting in a mixed-integer linear programming problem embedded in a machine learning model with redundant constraints removed. Step 5, optimize the solution process: Solve the mixed-integer linear programming problem embedded in the machine learning model obtained in step 4 after removing redundancy, and the optimal solution obtained is the optimization result for the corresponding industrial scenario.
[0010] Compared with existing technologies, the method for optimizing industrial scenarios using model embedding mixed-integer linear programming provided by this invention has the following advantages: By establishing a comprehensive conversion mechanism from model to MILP problem, this method incorporates precise embedding of machine learning architectures of varying scales, integrates dynamic constraint reduction techniques, and trains customized constraint reduction strategies tailored to the mathematical characteristics of various models. Through intelligent identification and progressive screening of redundant constraints, it ensures the rigor of the model-to-optimization problem conversion while effectively reducing the problem-solving complexity. It constructs an adaptive closed loop of embedding-reduction-solving, significantly improving solution efficiency while maintaining solution reliability through intelligent screening techniques. Reinforcement learning methods are employed to precisely screen and remove redundant constraints in the embedded machine learning model. The MILP problem obtained from machine learning embedding is converted into a bipartite graph, and a graph network (GCN) is used for feature extraction and information transfer. By comparing the solution time and optimal value before and after constraint removal, a reinforcement learning network is trained to identify and remove constraints with minimal impact on the optimal value. This method avoids the problem of large fluctuations in the optimal value that may result from traditional random removal strategies, effectively balancing solution efficiency and solution quality. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 The flowchart illustrates a method for optimizing industrial scenarios using model embedding mixed-integer linear programming, as provided in an embodiment of the present invention.
[0013] Figure 2 The overall flowchart of the method for optimizing industrial scenarios using model embedding mixed integer linear programming provided in the embodiments of the present invention is shown.
[0014] Figure 3 The flowchart below shows the specific processing steps of step 4 of the method for optimizing industrial scenarios using model embedding mixed integer linear programming, as provided in the embodiments of the present invention. Detailed Implementation
[0015] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the specific content of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments, which do not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0016] First, the following explanations are provided for the terms that may be used in this article: The term "and / or" means that either or both can be achieved simultaneously. For example, X and / or Y means that it includes both "X" or "Y" as well as the three cases of "X and Y".
[0017] The terms "comprising," "including," "containing," "having," or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, including a technical feature element (such as raw material, component, ingredient, carrier, dosage form, material, size, part, component, mechanism, device, step, process, method, reaction conditions, processing conditions, parameter, algorithm, signal, data, product or article of manufacture, etc.) should be interpreted as including not only the expressly listed technical feature element, but also other technical feature elements that are not expressly listed and are well-known in the art.
[0018] The term "composed of" excludes any technical features not expressly listed. When used in a claim, it closes the claim to exclude all technical features other than those expressly listed, except for associated conventional impurities. If the term appears only in a clause of a claim, it limits the claim to the elements expressly listed in that clause; elements recited in other clauses are not excluded from the overall claim.
[0019] Unless otherwise explicitly specified or limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this document according to the specific circumstances.
[0020] When concentration, temperature, pressure, size, or other parameters are expressed as numerical ranges, such ranges should be understood to specifically disclose all ranges formed by any pairing of upper limits, lower limits, or preferred values within that range, regardless of whether the range is explicitly stated; for example, if the numerical range "2 to 8" is stated, then that range should be interpreted to include ranges such as "2 to 7", "2 to 6", "5 to 7", "3 to 4 and 6 to 7", "3 to 5 and 7", "2 and 5 to 7", etc. Unless otherwise stated, the numerical ranges described herein include both their endpoints and all integers and fractions within that range.
[0021] The terms “center,” “longitudinal,” “lateral,” “length,” “width,” “thickness,” “upper,” “lower,” “front,” “back,” “left,” “right,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” “outer,” “clockwise,” and “counterclockwise” indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience and simplification of description and do not imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this document.
[0022] like Figure 1 , Figure 2 As shown, this invention provides a method for optimizing industrial scenarios using model embedding mixed-integer linear programming, comprising: Step 1, Industrial Data Acquisition and Preprocessing: We collect and utilize raw industrial data related to mixed-integer linear programming optimization from multiple industrial scenarios, preprocess the raw industrial data to obtain multi-source data, and use the multi-source data to construct a training dataset that is directly input into the machine learning model. Step 2, Training the Constrained Machine Learning Model: Using the training dataset constructed in step 1, select multiple machine learning models for training, evaluate the performance of the trained machine learning models with predetermined indicators, and dynamically select the optimal machine learning model as the constrained machine learning model based on the evaluation results and the corresponding optimization requirements of the industrial scenario. Step 3, Embedding Constraint Machine Learning Model Steps: The constrained machine learning model selected in step 2 is converted into mixed-integer linear programming constraints, and the standard set of mixed-integer linear programming constraints and the corresponding set of variables are output. Step 4, Redundant constraint removal based on reinforcement learning: A reinforcement learning environment is constructed to convert mixed-integer linear programming instances, which are constructed using a set of mixed-integer linear programming constraints and corresponding variable sets, into a bipartite graph. A graph convolutional neural network is used to extract the structured features of the mixed-integer linear programming instances from the bipartite graph. Based on these structured features and a customized reward function, the importance of all constraints in the mixed-integer linear programming constraint set is scored. Based on the importance scores, a constraint removal strategy is used to remove redundant constraints that prevent changes in the optimal value from exceeding a predetermined value, resulting in a mixed-integer linear programming problem embedded in a machine learning model with redundant constraints removed. Step 5, optimize the solution process: Solve the mixed-integer linear programming problem embedded in the machine learning model obtained in step 4 after removing redundancy, and the optimal solution obtained is the optimization result for the corresponding industrial scenario.
[0023] Preferably, in step 1 of the above method, the multiple industrial scenarios are any one of the following: production scheduling optimization scenario in a smart factory and energy management optimization scenario in an industrial park; If the industrial scenario is a smart factory production scheduling optimization scenario, then the raw industrial data related to mixed-integer linear programming optimization collected and utilized from multiple industrial scenarios includes: Collect historical data on equipment uptime, maintenance records, material requirements, and production task priorities from the production line; If the industrial scenario is an energy management optimization scenario in an industrial park, then the raw industrial data related to mixed-integer linear programming optimization collected and utilized from multiple industrial scenarios includes: The data collected from the industrial park includes historical energy consumption data, energy prices, weather conditions, and equipment operating parameters.
[0024] Preferably, in step 1 of the above method, multi-source data is obtained by preprocessing the raw industrial data through data cleaning. The training dataset obtained from the multi-source data is constructed as follows, which can be directly input into the machine learning model: The feature matrix and label vector are constructed from multi-source data, and the training dataset composed of the feature matrix and label vector can be directly input into the machine learning model.
[0025] Preferably, in step 2 of the above method, the selected machine learning models include: Decision trees, random forests, gradient boosting trees, and MLP neural networks; During training, each model uses data from the training dataset to fit the model, with the goal of learning from the input features. To output label The mapping relationship, that is ; Predetermined metrics for evaluating the performance of a trained machine learning model include at least one of mean squared error, classification accuracy, and recall.
[0026] Preferably, in step 3 of the above method, the constrained machine learning model selected in step 3 is converted into mixed-integer linear programming constraints in the following manner, outputting a standard set of mixed-integer linear programming constraints and a corresponding set of variables, including: The structure of the constrained machine learning model is automatically identified and parsed by the constrained machine learning model parsing layer, and the parsed structure is unified into an intermediate representation that includes layer type, weight, threshold, and leaf node rules. In the linearization generation layer, each primitive operation in the intermediate representation is mapped to a linear form or piecewise linear form acceptable to the mixed-integer linear programming as a linearization constraint. The above linearization constraints are packaged and output as a standard mixed-integer linear programming constraint set and corresponding variable set.
[0027] Preferably, in step 3 of the above method, a robust modeling method based on SOS1 constraints is used, which introduces SOS1 constraints to map each primitive operation in the intermediate representation to a piecewise linearized form acceptable to mixed integer linear programming.
[0028] Preferably, in step 3 of the above method, the structure of the resulting constrained machine learning model includes: network hierarchy, tree structure, activation function, and splitting condition.
[0029] See Figure 3 Preferably, in step 4 of the above method, a reinforcement learning environment is constructed as follows: the mixed-integer linear programming instance constructed using the mixed-integer linear programming constraint set and the corresponding variable set is converted into a bipartite graph; structural features of the mixed-integer linear programming instance are extracted from the bipartite graph using a graph convolutional neural network; importance scores are given to all constraints in the mixed-integer linear programming constraint set based on the structural features and a customized reward function; and redundant constraints that prevent the change in the optimal value from exceeding a predetermined value are removed using a constraint removal strategy based on the importance scores, resulting in a mixed-integer linear programming problem embedded in a machine learning model with redundant constraints removed, including: Step 41, Environment Modeling: The current mixed-integer linear programming instance is converted into a constraint-variable bipartite graph, in which constraint nodes and variable nodes are associated with linear coefficients through edges; The constraint node feature matrix, variable node feature matrix, and adjacency information of the constraint-variable bipartite graph are used to form the state input s. The action space is defined as selecting 1% to 5% of constraints to delete. After each step of deleting constraints, the mixed integer linear programming problem is solved again, and the solution time and optimal value are calculated. Step 42, determine the constraint removal strategy network: A multi-layer graph convolutional neural network is used to perform message passing on the constraint-variable bipartite graph in step 41, generating an embedding vector for each constraint node. The embedding vectors are then mapped to preference scores, and the deletion probability is obtained through the Softmax function. : ; in, Represents the preference score of constraint node i; This represents the index number used to enumerate all constraint nodes; This represents the exponential sum of the preference scores over all constraint nodes, used for normalization; Sampling actions during training phase And record the logarithmic probability: ; Step 43, determine the reward function: The reward function used to evaluate the impact of constraint removal policies on solution performance in a constraint removal policy network. for: ; in, These are weights used to dynamically control the solution speed during training; To accelerate the payoff function; and solution quality These are weights used to dynamically control the quality of solutions during training. Let be the objective penalty function. If the model fails to converge to the optimal solution after removing constraints, then ; Step 44: Use the multi-layer graph convolutional neural network trained by reinforcement learning to remove redundant constraints in the bipartite graph: The MIP solver is used, with default parameters retained during invocation, and a predetermined time limit is set for solving each mixed-integer linear programming instance. Using the PyTorch framework and Adamw optimizer, a multi-layer graph convolutional neural network (MLN) was trained as a reinforcement learning model with a set batch size, training period, and initial learning rate, and a decay strategy was used. The trained MNN was then used to predict mixed-integer linear programming problems to obtain a bipartite graph after removing redundant constraints. Step 45: Transform the bipartite graph with redundant constraints removed back into a mixed-integer linear programming problem instance: By mapping the structure of the bipartite graph after removing redundant constraints to the variables, constraints, and objective function of a mixed-integer linear programming problem, we obtain an instance of a mixed-integer linear programming problem that can be solved by an optimizer.
[0030] Preferably, in the above method, the acceleration benefit function in the reward function of step 43 The acceleration benefit function measures the solution time after constraint removal using logarithmic interpolation. for: ; in, and These represent the solution times of the model before and after the removal of the pre-approval criteria, respectively. To prevent the occurrence of extremely small positive numbers with a value of zero during the solution process, the value is set to 10. -6 .
[0031] Preferably, in the above method, the target penalty function in the reward function of step 43 is... This objective penalty function is used to quantify the relative change in the optimal objective value after removing constraints. for: ; in, This represents the optimal value of a mixed-integer linear programming problem after removing redundant constraints. Represents the optimal value of the original mixed-integer linear programming problem; To prevent the occurrence of extremely small positive numbers with zero values during the solution process, the value is set to 10. -6 .
[0032] In summary, the method of this invention establishes a full-process transformation mechanism from model to MILP problem, including precise embedding of machine learning architectures of different scales, integrating dynamic constraint reduction technology, training customized constraint reduction strategies for the mathematical characteristics of various models, and intelligently identifying and progressively filtering redundant constraints. This ensures the rigor of the model-to-optimization problem transformation while effectively reducing the problem-solving complexity. It constructs an adaptive closed loop of embedding-reduction-solving, significantly improving solution efficiency while ensuring solution reliability through intelligent filtering technology; and employs reinforcement learning methods to accurately filter and remove redundant constraints in the embedded machine learning model. The MILP problem obtained from machine learning embedding is converted into a bipartite graph, and a graph structure like GCN is used for feature extraction and information transmission. By comparing the solution time and optimal value before and after constraint removal, a reinforcement learning network is trained to identify and remove constraints with minimal impact on the optimal value. This method avoids the problem of large fluctuations in the optimal value that may be caused by traditional random removal strategies, effectively balancing solution efficiency and solution quality.
[0033] To more clearly demonstrate the technical solution and its effects provided by the present invention, the following detailed description of the solution provided by the embodiments of the present invention is provided with reference to specific examples.
[0034] Example 1 like Figure 1 , Figure 2 As shown, this embodiment provides a method for optimizing industrial scenarios using model embedding mixed-integer linear programming, including the following steps: Step 1, Industrial Data Acquisition and Preprocessing: Data was collected from multiple industrial scenarios, including production, sales, production scheduling, process parameters, energy consumption monitoring, and demand forecasting. A feature matrix was constructed using this multi-source data. and label vector , Represents the set of real numbers. Indicates the number of samples. This represents the feature dimension; during the data preprocessing stage, data cleaning and other operations are performed on the raw data to generate a training dataset that can be directly input into the machine learning model, ensuring the quality and usability of the data.
[0035] Step 2, Constraint Learning Model Training: For complex system relationships that are implicit or difficult to express analytically, various machine learning models are selected for training. These models include decision trees, random forests, gradient boosting trees (GBDT), and MLP neural networks. During training, data from a sample library is used to fit the model, with the goal of learning from input features. To output label The mapping relationship, that is To evaluate model performance, metrics such as mean squared error (MSE), classification precision, and recall are used. Based on specific industrial scenario requirements and evaluation results, the optimal model is dynamically selected to ensure best performance in real-world applications.
[0036] Step 3, constrain the embedding of the machine learning model: A method for automatically identifying and converting models under different frameworks into Mixed Integer Linear Programming (MILP) constraints first automatically identifies and parses the model structure (such as network hierarchy, tree structure, activation function, splitting conditions, etc.) through a model parsing layer, unifying the parsing results into an intermediate representation (IR) containing layer type, weights, thresholds, leaf node rules, etc. Then, in the linearization generation layer, each primitive operation in the IR is mapped to a linear or piecewise linear form acceptable to MILP. For example, for the ReLU activation function (… The linear expansion is as follows: ; Where z represents the input value after linear transformation, w represents the weight associated with the input x, x represents the input, b represents the bias term, which is the parameter that the model needs to learn, y represents the output value after ReLU activation, and s represents the auxiliary variable (slack variable), which is used to transform the nonlinear ReLU function into a linear constraint; Simultaneously, robust modeling techniques based on SOS1 constraints can be used. This technique innovatively introduces SOS1 constraints for piecewise linearization to overcome the heavy dependence of the Big-M method on variable boundaries, thereby improving numerical robustness and solution efficiency. For example, the argmax function ( The linearized expansion of ) is: ; Where 'a' represents the final result of the argmax function; 'J' represents the set of constraint indices; and 'y' represents the result of the argmax function. j This represents the j-th element of the input vector or set of values; s j The variable m represents an auxiliary slack variable; m represents an auxiliary variable used to represent all y. j The maximum value among the values; z j This represents a binary decision variable, and its function is to indicate which y...j It is the largest.
[0037] Finally, the linearization constraints described above are packaged and output as a standard MILP constraint set and the corresponding variable set, and the objective function for subsequent solution is also output.
[0038] Step 4, Redundant constraint identification and removal based on reinforcement learning: The core idea of the constraint handling method based on reinforcement learning is to construct a reinforcement learning environment. First, the constructed MILP example is converted into a bipartite graph. Then, a graph convolutional neural network (GCN) is used to extract the structured features of the mixed integer linear programming (MILP) instance. Subsequently, a customized reward function is used to score the importance of constraints. Finally, a policy network is used to remove redundant constraints that have little impact on the optimal value, thereby shortening the solution time and improving the solution efficiency while ensuring that the quality of the solution is reduced.
[0039] Step 41, Environment Modeling: First, the current MILP instance is transformed into a constraint-variable bipartite graph, where constraint nodes and variable nodes are related by edges representing linear coefficients. (Constraint node feature matrix) Variable node feature matrix and adjacency information Together they constitute the state input, where m represents the number of constraint nodes, and d c The constraint node feature dimension is represented by n, which represents the number of variable nodes, and d represents the number of variable nodes. v The variable node feature dimension is represented. The action space is defined as selecting 1% to 5% of constraint indices for deletion. The system re-solves the problem after each deletion step and calculates the solution time and optimal value.
[0040] Step 42, determine the constraint removal strategy network: A multi-layered GCN is used to perform message passing on the bipartite graph, generating an embedding vector for each constraint node. d represents the feature dimension, and the embedding vector is then mapped to a preference score. The deletion probability is obtained through Softmax: ; in, Represents the preference score of constraint node i; This represents the index number used to enumerate all constraint nodes; This represents the exponential sum of the preference scores over all constraint nodes, used for normalization; During the training phase, sample action 'a' and record its log probability: .
[0041] Step 43, determine the reward function: In the method of this invention, the reward function is used to evaluate the impact of the constraint removal strategy on the solution performance. Its core objective is to achieve a balance between accelerating the solution speed and maintaining the solution quality. The acceleration benefit is measured by the logarithmic difference method to assess the improvement in solution time after constraint removal. For example: ; in and These represent the solution time of the model before and after deletion, respectively. To prevent extremely small positive numbers from reaching zero when taking the logarithm, the objective penalty part is used to quantify the relative change in the optimal objective value after removing constraints. Its design is inspired by the classic method of measuring relative error. ; If the model fails to converge to the optimal solution after removing constraints, then... This is to avoid suboptimal solutions misleading policy training. Finally, adjustable weights are used. and By linearly fusing the two, we obtain the total reward function, whose expression is as follows: ; in, These are used to dynamically control the emphasis on solution speed and solution quality during algorithm training, helping the policy network flexibly adjust its optimization objectives in different application scenarios. This reward function design combines sparsity and density, which helps improve the convergence stability of the policy and avoids the training difficulties caused by reward sparsity.
[0042] Step 44: Use the reduced-constraint bipartite graph obtained after reinforcement learning training: All experiments used SCIP 8.0.4 as the MIP solver, maintaining default parameters during invocation, and setting a 720-second solution cap for each instance to ensure fairness and reproducibility. The machine learning portion was implemented in Python, trained using the PyTorch framework and the Adamw optimizer, with a batch size of 8, 1000 training epochs, an initial learning rate of 1x10⁻⁴, and a decay strategy. Experiments were conducted on a high-performance computing server, requiring dual ADEPYC7763 CPUs, eight RIX4090 GPUs, and 1TB of memory. Finally, the trained model was used to predict mixed-integer linear programming problems and obtain a bipartite graph with redundant constraints removed.
[0043] Step 45: Transform the bipartite graph with redundant constraints removed back into a mixed-integer linear programming problem instance: In a bipartite graph, edges are mapped to 0-1 decision variables, with values indicating whether an edge is selected. Constraints are determined by the matching relationships in the bipartite graph; each left-hand node can select at most one connected edge, and each right-hand node also satisfies degree constraints. The objective function consists of edge weights or costs, and is maximized or minimized by weighted summation of the variables. Thus, the structure of the bipartite graph corresponds to the variables, constraints, and objective function of mixed-integer linear programming, resulting in an instance of a mixed-integer linear programming problem that can be optimized using a solver.
[0044] The method of this invention systematically converts the machine learning model into MILP constraints and represents them as a bipartite graph. It then uses a graph neural network to extract the features of each constraint in detail. Finally, a reinforcement learning policy network adaptively measures and removes redundant constraints that have little impact on the optimal value. By combining the real-time reward signal of the difference between the solution time and the objective, the reduction decision is continuously optimized. This method realizes the constraint reduction of machine learning models embedded in hybrid MILP problems. Under the premise of ensuring the stability of solution quality, it significantly reduces the problem size and search complexity, accelerates the convergence of the solver, and improves the overall solution efficiency.
[0045] Example 2 This invention has played a significant role in production scheduling optimization scenarios in smart factories. First, historical data such as equipment uptime, maintenance records, material requirements, and production task priorities are collected from the production line to construct a feature matrix and label vector, followed by data preprocessing. Next, a trained random forest model is used to predict equipment failure probabilities and material delay risks, and this model is embedded into the initial MILP problem. Subsequently, a reinforcement learning network is initialized and hyperparameters are set. By solving the initial MILP problem multiple times, the reinforcement learning network selectively removes some constraints. The solution time and optimal value before and after constraint removal are compared to calculate the reward signal and update the network parameters accordingly. After a period of training, the reinforcement learning network is used to filter constraints in new MILP problems, removing redundant constraints to form new MILP problems, which are then solved by a solver. Comparing the solution results before and after constraint removal verifies that the method of this invention significantly improves solution efficiency while maintaining solution quality, effectively solving complex production scheduling problems in smart factories and ensuring high-efficiency and continuous production.
[0046] Example 3 In the energy management optimization scenario of industrial parks, the application process of this invention is as follows: First, historical energy consumption data, energy prices, weather conditions, and equipment operating parameters of the park are collected to construct a feature matrix and label vector, and the data is preprocessed. Then, a trained MLP model is used to predict energy demand and embedded into the MILP problem. After initializing the reinforcement learning network and setting hyperparameters, the initial MILP problem is solved multiple times. Redundant constraints are selectively removed by training the reinforcement learning network to form a new MILP problem, which is then solved by the solver. Comparative results show that the method of this invention can significantly shorten the solution time while ensuring the quality of the solution, effectively improving the efficiency and reliability of energy management, realizing the rational allocation and optimization of energy in industrial parks, reducing energy costs, and improving energy utilization efficiency. For example, by accurately predicting energy demand, industrial parks can rationally arrange the operation of generator sets, reduce energy waste, improve energy utilization efficiency, and reduce operating costs.
[0047] In summary, the constraint reduction method of the embedded machine learning model based on reinforcement learning constructed by the embodiment of the present invention transforms the complete MILP problem into a constraint-variable bipartite graph and extracts the deep features of each constraint using a graph neural network. This allows for adaptive measurement of the combined impact of each constraint on the final optimal value and solution time within the policy network. In practical operation, this method continuously optimizes the pruning decision through a policy gradient closed loop, effectively removing redundant constraints while ensuring the stability of the optimal value. This significantly reduces the problem size and search complexity, greatly accelerates the convergence speed of the solver, and improves the overall solution efficiency. Compared with traditional fixed-rule or random pruning methods, the present invention can intelligently identify key constraints and dynamically adjust the pruning strategy, ensuring that the solution process considers both the feasibility and accuracy of the solution while avoiding the waste of redundant computation, achieving an optimization effect that guarantees both acceleration and quality.
[0048] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0049] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.
Claims
1. A method for optimizing industrial scenarios using model embedding mixed-integer linear programming, characterized in that, include: Step 1, Industrial Data Acquisition and Preprocessing: We collect and utilize raw industrial data related to mixed-integer linear programming optimization from multiple industrial scenarios, preprocess the raw industrial data to obtain multi-source data, and use the multi-source data to construct a training dataset that is directly input into the machine learning model. Step 2, Training the Constrained Machine Learning Model: Using the training dataset constructed in step 1, select multiple machine learning models for training, evaluate the performance of the trained machine learning models with predetermined indicators, and dynamically select the optimal machine learning model as the constrained machine learning model based on the evaluation results and the corresponding optimization requirements of the industrial scenario. Step 3, Embedding Constraint Machine Learning Model Steps: The constrained machine learning model selected in step 2 is converted into mixed-integer linear programming constraints, and the standard set of mixed-integer linear programming constraints and the corresponding set of variables are output. Step 4, Redundant constraint removal based on reinforcement learning: A reinforcement learning environment is constructed to convert mixed-integer linear programming instances, which are constructed using a set of mixed-integer linear programming constraints and corresponding variable sets, into a bipartite graph. A graph convolutional neural network is used to extract the structured features of the mixed-integer linear programming instances from the bipartite graph. Based on these structured features and a customized reward function, the importance of all constraints in the mixed-integer linear programming constraint set is scored. Based on the importance scores, a constraint removal strategy is used to remove redundant constraints that prevent changes in the optimal value from exceeding a predetermined value, resulting in a mixed-integer linear programming problem embedded in a machine learning model with redundant constraints removed. Step 5, optimize the solution process: Solve the mixed-integer linear programming problem embedded in the machine learning model obtained in step 4 after removing redundancy, and the optimal solution obtained is the optimization result for the corresponding industrial scenario.
2. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 1, characterized in that, In step 1, the multiple industrial scenarios are any one of the following: production scheduling optimization scenario in a smart factory and energy management optimization scenario in an industrial park; If the industrial scenario is a smart factory production scheduling optimization scenario, then the raw industrial data related to mixed-integer linear programming optimization collected and utilized from multiple industrial scenarios includes: Collect historical data on equipment uptime, maintenance records, material requirements, and production task priorities from the production line; If the industrial scenario is an energy management optimization scenario in an industrial park, then the raw industrial data related to mixed-integer linear programming optimization collected and utilized from multiple industrial scenarios includes: The data collected from the industrial park includes historical energy consumption data, energy prices, weather conditions, and equipment operating parameters.
3. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 1, characterized in that, In step 1, multi-source data is obtained by preprocessing the raw industrial data through data cleaning. The training dataset obtained from the multi-source data is constructed as follows, which can be directly input into the machine learning model: The feature matrix and label vector are constructed from multi-source data, and the training dataset composed of the feature matrix and label vector can be directly input into the machine learning model.
4. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 2, characterized in that, In step 2, the selected machine learning models include: Decision trees, random forests, gradient boosting trees, and MLP neural networks; During the training process, each model uses data from the training dataset to fit the model, with the goal of learning the mapping relationship from input features to output labels; Predetermined metrics for evaluating the performance of a trained machine learning model include at least one of mean squared error, classification accuracy, and recall.
5. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to any one of claims 1-4, characterized in that, In step 3, the constrained machine learning model selected in step 3 is converted into mixed-integer linear programming constraints in the following manner, outputting a standard set of mixed-integer linear programming constraints and a corresponding set of variables, including: The structure of the constrained machine learning model is automatically identified and parsed by the constrained machine learning model parsing layer, and the parsed structure is unified into an intermediate representation that includes layer type, weight, threshold, and leaf node rules. In the linearization generation layer, each primitive operation in the intermediate representation is mapped to a linear form or piecewise linear form acceptable to the mixed-integer linear programming as a linearization constraint. The above linearization constraints are packaged and output as a standard mixed-integer linear programming constraint set and corresponding variable set.
6. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 5, characterized in that, In step 3, a robust modeling method based on SOS1 constraints is used. SOS1 constraints are introduced to map each primitive operation in the intermediate representation to a piecewise linearized form acceptable to mixed integer linear programming.
7. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 5, characterized in that, In step 3, the structure of the resulting constrained machine learning model includes: network hierarchy, tree structure, activation function, and splitting condition.
8. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 5, characterized in that, In step 4, a reinforcement learning environment is constructed as follows: the mixed-integer linear programming instance constructed using the mixed-integer linear programming constraint set and corresponding variable set is converted into a bipartite graph; structural features of the mixed-integer linear programming instance are extracted from the bipartite graph using a graph convolutional neural network; based on the structural features and a customized reward function, the importance of all constraints in the mixed-integer linear programming constraint set is scored; and based on the importance scores, redundant constraints that prevent the change in the optimal value from exceeding a predetermined value are removed using a constraint removal strategy, resulting in a mixed-integer linear programming problem embedded in a machine learning model with redundant constraints removed, including: Step 41, Environment Modeling: The current mixed-integer linear programming instance is converted into a constraint-variable bipartite graph, in which constraint nodes and variable nodes are associated with linear coefficients through edges; The constraint node feature matrix, variable node feature matrix, and adjacency information of the constraint-variable bipartite graph are used to form the state input s. The action space is defined as selecting 1% to 5% of constraints to delete. After each step of deleting constraints, the mixed integer linear programming problem is solved again, and the solution time and optimal value are calculated. Step 42, determine the constraint removal strategy network: A multi-layer graph convolutional neural network is used to perform message passing on the constraint-variable bipartite graph in step 41, generating an embedding vector for each constraint node. The embedding vectors are then mapped to preference scores, and the deletion probability is obtained through the Softmax function. : ; in, Represents the preference score of constraint node i; This represents the index number used to enumerate all constraint nodes; This represents the exponential sum of the preference scores over all constraint nodes, used for normalization; Sampling actions during training phase And record the logarithmic probability: ; Step 43, determine the reward function: The reward function used to evaluate the impact of constraint removal policies on solution performance in a constraint removal policy network. for: ; in, These are weights used to dynamically control the solution speed during training; To accelerate the payoff function; and solution quality These are weights used to dynamically control the quality of solutions during training. Let be the objective penalty function. If the model fails to converge to the optimal solution after removing constraints, then ; Step 44: Use the multi-layer graph convolutional neural network trained by reinforcement learning to remove redundant constraints in the bipartite graph: The MIP solver is used, with default parameters retained during invocation, and a predetermined time limit is set for solving each mixed-integer linear programming instance. Using the PyTorch framework and Adamw optimizer, a multi-layer graph convolutional neural network (MLN) as a reinforcement learning model is trained with a set batch size, training period, and initial learning rate, and a decay strategy is used. The trained MNN is then used to predict mixed-integer linear programming problems to obtain a bipartite graph after removing redundant constraints. Step 45: Transform the bipartite graph with redundant constraints removed back into a mixed-integer linear programming problem instance: By mapping the structure of the bipartite graph after removing redundant constraints to the variables, constraints, and objective function of a mixed-integer linear programming problem, we obtain an instance of a mixed-integer linear programming problem that can be solved by an optimizer.
9. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 8, characterized in that, The acceleration benefit function in the reward function of step 43 The acceleration benefit function measures the solution time after constraint removal using logarithmic interpolation. for: ; in, and These represent the solution times of the model before and after the removal of the pre-approval criteria, respectively. To prevent the occurrence of extremely small positive numbers with a value of zero during the solution process, the value is set to 10. -6 .
10. The method for optimizing industrial scenarios using model embedding mixed-integer linear programming according to claim 8, characterized in that, The target penalty function in the reward function of step 43 This objective penalty function is used to quantify the relative change in the optimal objective value after removing constraints. for: ; in, This represents the optimal value of a mixed-integer linear programming problem with redundant constraints removed. Represents the optimal value of the original mixed-integer linear programming problem; To prevent the occurrence of extremely small positive numbers with a value of zero during the solution process, the value is set to 10. -6 .
Citation Information
Patent Citations
Solving method of mixed integer linear programming model
CN104156508A
Multi-stage power transmission network planning method and system considering flexibility of thermal power generating unit
CN111799842A
Mixed integer linear programming problem solving model generalization optimization method and system
CN119106711A
Method and system for hyperparameter and algorithm selection for mixed integer linear programming problems using representation learning
US20200193323A1
Integrated machine learning prediction and optimization for decision-making
US20230316150A1