Capacity-constrained vehicle routing modeling and solving method based on large language model
The CVRP solution method using a large language model and a multi-round feedback mechanism solves the problems of high modeling threshold and unstable solution in existing technologies, and realizes the automated generation and efficient solution of CVRP optimization schemes from natural language.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2026-06-01
- Publication Date
- 2026-07-28
AI Technical Summary
The existing CVRP solution process relies on operations research experts, which results in high modeling and solution costs. When using large language models directly, key constraints are easily overlooked, and the solution process is unstable.
A capacity-constrained vehicle path modeling and solution method based on a large language model is adopted. Through structured information extraction and a confidence-driven multi-round feedback mechanism, the generation of CVRP optimization schemes is automated from natural language description, including semantic parsing, structured parameter and variable extraction, and objective and constraint extraction. Combined with confidence verification and iterative repair mechanisms, the integrity of the model and the stability of the solution are ensured.
It achieves end-to-end automated generation from natural language description to CVRP optimization scheme, which significantly improves modeling efficiency and solution success rate, reduces human intervention, and enhances the integrity and reliability of the model.
Smart Images

Figure CN122288543B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and operations research optimization. Specifically, it relates to a capacity-constrained vehicle routing modeling and solution method based on a large language model, which is used to automatically convert the business description of the capacity-constrained vehicle routing problem (CVRP) in natural language form into an executable mathematical model and solution, and output the corresponding vehicle delivery route plan. Background Technology
[0002] The Capacity-Constrained Vehicle Routing Problem (CVRP) is one of the fundamental and typical problems in the field of vehicle routing optimization. In this problem, multiple delivery vehicles depart from the same distribution center, visit several customer nodes, and return to the distribution center. The total demand served by each vehicle must not exceed its capacity limit, and each customer must be served only once. By properly modeling and solving CVRP, the total travel distance of vehicles can be effectively reduced, transportation costs and empty-running rates can be decreased, and delivery efficiency can be improved. Therefore, it has significant application value in logistics scheduling and transportation decision-making.
[0003] Current CVRP solution processes typically rely on operations research experts. Modelers translate business descriptions into mathematical models, which are then mapped to solvers by programmers. This process is lengthy and highly dependent on expert experience. For example, Chinese invention patent CN114169488B discloses a capacity-constrained vehicle path acquisition method based on a hybrid metaheuristic algorithm, using the Grey Wolf optimization algorithm combined with local search to solve CVRP. However, the modeling and solving of this method still require manual intervention, necessitating remodeling if business conditions change, resulting in high implementation costs. To reduce manual intervention costs, the industry has begun to incorporate large language models into the CVRP solution process. For example, Chinese invention patent CN120106324A discloses an automatic algorithm design method for solving vehicle routing problems using a large language model. This method uses a two-level Markov decision process to allow the agent to choose among multiple heuristics, and the large language model generates or adjusts the heuristic algorithm. However, this method limits the large language model to the heuristic design stage, and its input remains formalized structured parameters, failing to address the end-to-end automation problem from natural language to mathematical models and solution results. Furthermore, directly using a large language model to parse complex business descriptions can easily overlook key constraints, and the solution process may suffer from inconsistent variable dimensions or non-standard solver interface calls, affecting the executability and reliability of the solution results. Therefore, it is necessary to propose an automated modeling and solving method for CVRP that maintains the convenience of natural language interaction while improving the accuracy of semantic extraction, the completeness of the mathematical model, and the stability of the solution process. Summary of the Invention
[0004] The purpose of this invention is to provide a capacity-constrained vehicle path modeling and solution method based on a large language model, which solves the problems of high modeling threshold, heavy reliance on operations research experts, low model building efficiency, and long code implementation cycle in existing CVRP applications. At the same time, it solves the problems of constraint omission, semantic ambiguity, and code non-executability that are easy to occur when directly using a large language model to process CVRP, and realizes end-to-end automated generation from natural language description to CVRP optimization scheme.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A capacity-constrained vehicle path modeling and solution method based on a large language model includes the following steps: Step S1: Receive the capacity-constrained vehicle routing problem (CVRP) problem description and perform semantic parsing and structured information extraction.
[0006] S1-1: Obtain the capacity-constrained vehicle routing problem description text input by the user in natural language. The problem description includes at least distribution center information, customer information, vehicle information, and optimization target information.
[0007] S1-2: Call the parameter extraction prompt template and variable extraction prompt template to extract the structured parameters and variable definitions required for CVRP from the problem description; wherein, the structured parameters include at least customer set, vehicle set, distribution center, customer demand, vehicle capacity and distance data between nodes, and the variable definitions include at least path decision variables and auxiliary variables for sub-loop elimination.
[0008] S1-2-1: Construct a structured parameter extraction prompt template, including: Task Description: This task informs the large language model of its objective, namely, to extract the structured parameter information required for modeling from the CVRP problem description, and requires the large language model to output the data strictly in accordance with the specified JSON format. Problem Description: This section contains the natural language problem description to be processed, which is used as the input to the large language model; that is, the problem description text. Mind chain guidance: Through step-by-step prompts, guide the large language model to complete entity recognition, numerical extraction, dimension judgment and semantic interpretation in sequence; Output format constraints: Each structured parameter must be output as a quadruple {name, value, dimension, semantic definition} to ensure the uniformity and standardization of the extraction results; Example Reference: The template provides several standardized input and output examples so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities.
[0009] The structured parameter extraction prompt template is invoked to extract all structured parameters from the question description text and output them in the form of a quadruple {name, value, dimension, semantic definition}, specifically including: The distribution center parameter is {depot, 0, scalar, distribution center node number}; where depot represents the distribution center and 0 represents the unique number of the distribution center node.
[0010] Customer set parameters { , The set, the set of IDs for all client nodes, contains a total of 1,000 customers; among them Represents the set of client nodes. This represents the range of numbers for all client nodes, which includes... One customer node.
[0011] Node set parameters { , , a set, consisting of the distribution center and all customer nodes}; where, Represents the set of all nodes. Indicates the distribution center node. This represents the set of client nodes, therefore This represents the complete set of nodes formed by merging the distribution center nodes with all customer nodes.
[0012] Vehicle set parameters { , A set, a set of available vehicle IDs, containing a total of Vehicles}; among them, Indicates a collection of vehicles. This indicates the range of available vehicle numbers, which includes... A vehicle.
[0013] Vehicle capacity parameters { , , scalar, the maximum loading capacity limit of each vehicle in a homogeneous fleet; where... This indicates the maximum loading capacity of each vehicle; in a homogeneous fleet scenario, all vehicles share the same maximum capacity. .
[0014] Customer demand parameters { , Vector, Client Node The quantity of goods to be delivered; among which, Indicates the first The demand of each customer node This represents a vector consisting of the total demand of all customer nodes.
[0015] Node distance parameter { , , Matrix, Node With nodes The distance between them is calculated from the customer's coordinates when the input text provides those coordinates; otherwise, it is directly extracted from the distance matrix provided in the input text. Indicates from node To the node Distance, node and nodes All belong to the node set ; This represents the distance matrix consisting of the pairwise distances between all nodes; This means that the number of rows and columns of the distance matrix are both equal to the number of nodes. The number of nodes in the middle.
[0016] S1-2-2: Construct a variable extraction prompt template, including: Task Description Section: This section informs the large language model of the objective of this task, namely, to extract the decision variable information required for modeling from the CVRP problem description, and requires the large language model to output strictly in accordance with the specified JSON format. Problem description section: This section carries the natural language problem description to be processed, which serves as the input content for the large language model; that is, the problem description text. The thought chain guidance section guides the large language model through step-by-step prompts to complete the decision object identification, variable dimension judgment, value type analysis, and semantic interpretation in sequence. Output format constraints: Each variable must be output as a quadruple {variable name, dimension, type, and semantic definition} to ensure the uniformity and standardization of the extraction results; Example Reference Section: Several standardized variable output examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities.
[0017] The variable extraction prompt template is invoked to extract all variables from the problem description text and output them as a quadruple {name, dimension, type, semantic definition}, specifically including: Path decision variables { , 0-1 variables, if vehicle From node Drive directly to the node If the expression is true, then the value is 1; otherwise, it is 0. Represents nodes ,node and vehicles Corresponding path selection variables, nodes and nodes All belong to the node set ,vehicle Belongs to the vehicle collection When the vehicle From node Drive directly to the node hour, =1, otherwise =0; This indicates the scale of the path decision variable, meaning that for each vehicle, it is necessary to determine whether it travels between any two nodes.
[0018] Sub-ring elimination of auxiliary variables { , A continuous variable, representing the vehicle's access to the client node. The access order corresponding to the time is used to eliminate sub-loops in the path. Represents client node The corresponding access order variable, client node Belongs to customer collection ; This indicates that the number of auxiliary variables is consistent with the number of client nodes, meaning each client node corresponds to one. This variable is used in conjunction with sub-loop constraint elimination to prevent independent loops in the vehicle path from not passing through the distribution center.
[0019] S1-3: Call the target extraction prompt template and constraint extraction prompt template to extract the target and constraint, and obtain the optimization target and candidate constraints.
[0020] S1-3-1: Construct a target extraction prompt template, including: Task Description: This task informs the large language model of the objective of this task, namely, to identify the core optimization objective from the CVRP problem description; the large language model is also required to output strictly in the specified JSON format. Context embedding: used to carry all the contextual information required for modeling, including the natural language problem description, the extracted structured parameters, decision variables, and auxiliary variables; Mind chain guidance: Through step-by-step prompts, guide the large language model to complete the optimization of intent recognition, target object judgment, measurement index determination, and mathematical meaning interpretation in sequence; Output format constraints: The output results are specified to adopt a two-layer expression form of "natural language statement + structured encapsulation", that is, both a natural language description of the target is given, and it is encapsulated in a structured output block of "target"; Example Reference: Several standardized examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities.
[0021] The aforementioned target extraction prompt template is used to extract the optimization objective from the natural language as: "Minimize the number of capacity-constrained vehicles in the fleet starting from distribution center 0, and complete the task of optimizing all vehicles while satisfying vehicle capacity constraints." "A unique access for each customer, and returns the total distance traveled to the distribution center." This statement is uniformly encapsulated in a structured output block identified by the "Target" field.
[0022] S1-3-2: Construct a constraint extraction prompt template, including: Task Description: This task informs the large language model of the objective of the task, namely, to identify the constraints required for modeling from the CVRP problem description one by one; the large language model is also required to output the results in the specified JSON format. Context embedding: used to carry all the contextual information required for modeling, including the natural language problem description, the extracted structured parameters, decision variables, and auxiliary variables; Mind chain guidance: Through step-by-step prompts, the large language model is guided to complete the constraint recognition and semantic interpretation in sequence, making the construction process of the constraint set more orderly; Output format constraints: Each constraint is required to adopt a two-layer expression of "natural language statement + structured encapsulation", that is, both the natural language description of the constraint is given and it is encapsulated in a unified "constraint" output block. Example Reference: Several standardized examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities.
[0023] The constraint extraction prompt template is invoked to transform the natural language description into a standardized constraint. The specific process includes: The customer unique service constraint means that each customer must be accessed by exactly one vehicle and only once. Vehicle departure and return constraints, meaning that each vehicle must depart from the distribution center and eventually return to the distribution center; Path flow balance constraint, which means that the number of times a vehicle enters a node is equal to the number of times it leaves, in order to ensure the continuity of the path; Vehicle capacity constraints mean that the total demand of customers served by each vehicle must not exceed its maximum loading capacity. Sub-loop elimination constraint means that independent closed loops that do not pass through the distribution center are not allowed.
[0024] The above constraints are encapsulated as candidate constraints in an output block identified by the "constraint" field.
[0025] Step S2: Verify the obtained candidate constraints using a confidence-driven multi-round feedback mechanism to obtain the CVRP constraint set.
[0026] S2-1: Quantify each extracted candidate constraint with a score from 0 to 100. The specific steps are as follows: S2-1-1: The candidate constraints, original problem description, structured parameter set, and variable set are input into the large language model as context, and the candidate constraints are judged based on preset constraint evaluation rules. The large language model identifies the semantic basis, involved symbols, usable mathematical expression forms, constraint types, and relationships with existing constraints from the candidate constraints, and outputs the corresponding judgment results; then, according to preset scoring criteria, the judgment results are converted into scores for the candidate constraints on multiple evaluation dimensions.
[0027] The multiple evaluation dimensions include: Semantic consistency: This is evaluated based on the semantic correspondence between candidate constraints and the original problem description, the consistency of task objectives, and the correspondence between keywords or entities. It is used to determine whether candidate constraints can be supported by the original problem description. Symbol alignment: Based on the structured parameters and variables involved in the candidate constraints, determine whether a corresponding symbol can be found in the structured parameter set and variable set, and determine the evaluation result based on whether the corresponding symbol is complete, whether the symbol type is consistent, and whether the meaning is consistent; Mathematical expressibility: Candidate constraints are evaluated based on whether they can be expressed as mathematical expressions in linear programming or integer linear programming. These mathematical expressions include linear summation, constant coefficients, equality constraints, inequality constraints, binary variable constraints, and integer variable constraints. For candidate constraints that involve variable multiplication, nonlinear functions, or are difficult to convert into linear expressions, their evaluation results are reduced. Necessity: Determine whether the candidate constraints are necessary constraints to ensure the correctness of the CVRP mathematical model; the necessary constraints include customer unique service constraints, vehicle departure and return constraints, path flow balance constraints, vehicle capacity constraints, sub-loop elimination constraints, and variable value constraints. Non-redundancy: Based on the comparison between the current candidate constraint and other candidate constraints, determine whether the current candidate constraint has an independent effect; if the current candidate constraint can be obtained from other candidate constraints, or is just a different expression of other candidate constraints, then its evaluation result is reduced.
[0028] For each evaluation dimension, a pre-defined scoring point is established, which includes high matching level, medium matching level, and low matching level. High matching level corresponds to 15 to 20 points, medium matching level corresponds to 7 to 14 points, and low matching level corresponds to 0 to 6 points. The large language model outputs a score within the corresponding score range based on the degree of matching between the candidate constraints and the corresponding evaluation rules.
[0029] S2-1-2: Calculate the weighted sum of the scores from the five dimensions to obtain the comprehensive score for the candidate constraint. To improve the robustness of the scoring, the same constraint is applied... The average of the two independent scores is taken as the final score.
[0030] S2-1-3: Based on the final comprehensive score Screening: When the score is higher than the threshold, the constraint is directly included in the formal constraint set; when the score is lower than the threshold, the constraint is marked as a candidate constraint to be reviewed and processed in step S2-2.
[0031] S2-2: When the overall score Below the preset threshold When this occurs, the constraint repair process is triggered. The specific process is as follows: S2-2-1: Input the candidate constraints to be repaired, their scores and deduction reasons for each dimension, the original problem description, the structured parameter set and variable set as context into the large language model, and guide the large language model to make targeted corrections for the deduction items.
[0032] S2-2-2: Based on the score loss in the scoring dimensions, the large language model selects the appropriate repair method from the following three types of operations: Rewriting: When semantic consistency or mathematical expressibility scores are lost, the natural language statement of the constraints is rewritten to make its semantics more consistent with the original problem description. Completion: When symbol alignment is lost, supplement the missing symbol references, scope of action or quantification conditions in the constraint to make the mathematical structure of the constraint complete; Deletion: When the necessity or non-redundancy score is severely lost, mark the constraint as redundant or invalid and delete it.
[0033] S2-2-3: Send the repaired candidate constraints back to step S2-1 for re-evaluation. If the comprehensive score is... If it is found to be true, it will be included in the formal constraint set; otherwise, proceed to step S2-2 to continue the repair.
[0034] S2-2-4: Once all candidate constraints have passed the scoring, proceed to step S2-3; otherwise, continue with the repair process.
[0035] S2-3: Set up a circuit breaker mechanism to prevent the same constraint from getting stuck in an invalid loop during repair. The specific process is as follows: S2-3-1: Maintain a circuit breaker counter for each candidate constraint, with an initial value of 0; increment the counter for the constraint by 1 after each "scoring-repairing-rescoring" cycle.
[0036] S2-3-2: When the circuit breaker counter for a candidate constraint reaches a preset upper limit. And the overall score is still lower than If a candidate constraint cannot be repaired through an automated process, it is removed from the candidate constraint set to avoid invalid iterations.
[0037] S2-3-3: After all candidate constraints have been scored, repaired, or circuit-breaking processed, the final high-confidence CVRP constraint set is output as the modeling input for subsequent steps.
[0038] Step S3: Construct the CVRP mathematical model. Based on the structured parameters and variables extracted in Step S1, the target semantics, and the validated CVRP constraint set output in Step S2, the target semantics and constraint semantics are mapped one by one to the corresponding LaTeX mathematical expressions to form a complete CVRP mathematical model.
[0039] S3-1: Based on the structured parameters and variables extracted in step S1, establish the structured parameter set and variable set in the CVRP mathematical model.
[0040] S3-2: An objective function based on minimizing the number of vehicles in a fleet with limited capacity starting from distribution center 0, completing a unique visit to all customers while satisfying vehicle capacity constraints, and returning the total travel distance to the distribution center.
[0041] S3-3: Construct a unique service constraint for each customer, meaning that each customer must be accessed by exactly one vehicle and only once.
[0042] S3-4: Construct vehicle departure and return constraints, meaning that each vehicle must depart from the distribution center and eventually return to the distribution center.
[0043] in, Indicates if vehicle Drive directly from distribution center 0 to node ,but ,otherwise , Indicates if vehicle From node If you drive directly to distribution center 0, then... ,otherwise .
[0044] S3-5: Construct path flow balance constraints, that is, the number of times a vehicle enters a node is equal to the number of times it leaves, in order to ensure the continuity of the path.
[0045] in, Indicates if vehicle From node Drive directly to the node ,but ,otherwise , Indicates if vehicle From node Drive directly to the node ,but ,otherwise .
[0046] S3-6: Establish vehicle capacity constraints, meaning that the total demand of customers served by each vehicle must not exceed its maximum loading capacity.
[0047] S3-7: Construct sub-loops to eliminate constraints, i.e., do not allow independent closed loops that do not pass through the distribution center.
[0048] S3-8: Construct constraints on the values of decision variables, limiting the range of values for path decision variables and auxiliary variables, thereby forming a complete CVRP mathematical model.
[0049] Step S4: Solve and repair the CVRP mathematical model and output the results.
[0050] S4-1: Establish the mapping relationship between CVRP mathematical formulas and the solver. Import the CVRP mathematical model obtained in step S3 into the solver for solution preparation. Specifically, this includes: CVRP mathematical model initialization: Based on the interface specification of the selected solver (such as Gurobi, CPLEX, etc.), establish a CVRP mathematical model instance; Structured parameter loading: Load the structured parameter set extracted in step S1 (including the customer set). Vehicle assembly Vehicle capacity Customer demand and the distance matrix between nodes (etc.) are sequentially imported into the solver; Variable mapping: The path decision variables and auxiliary variables extracted in step S1 are mapped to the corresponding variable objects in the solver, wherein multidimensional path decision variables are mapped using... Subscript indexing is performed in the form of [format], and auxiliary variables are [used in the format of ]. Single-dimensional indexing is performed in the form of [format missing]. Objective and Constraint Import: Import the objective function and all constraints into the solver in sequence, and convert the summation-type mathematical expressions into aggregate forms supported by the solver.
[0051] S4-2: After completing the above mapping and import, call the solver to solve the CVRP mathematical model and perform branch processing according to the solution status: when the solver returns the optimal solution status, directly output the optimal target value (i.e., the minimum total travel distance) and the access path order corresponding to each vehicle, and proceed to step S4-4 for result parsing; when the solver returns infeasible, unbounded, solution timeout or other abnormal status, proceed to step S4-3 to start the repair process.
[0052] S4-3: Repair the CVRP mathematical model that failed to solve. Details are as follows: S4-3-1: Automatically captures the complete error information returned by the solver when the solution fails, archives and stores it, and extracts key diagnostic information as input for subsequent repair.
[0053] S4-3-2: Input the original problem description, the currently failed CVRP mathematical model, the error information extracted in step S4-3-1, the structured parameter set and variable set as context into the large language model, guide the large language model to analyze the root causes of the solution failure (such as undefined symbols, mismatched constraint dimensions, out-of-bounds summation range, improper variable type setting, etc.), and generate a corrected complete CVRP mathematical model.
[0054] S4-3-3: The corrected CVRP mathematical model is re-submitted to S4-2 for solving, forming a closed-loop iterative process of "solving-diagnosis-repair" until the solution is successful.
[0055] S4-4: Analysis and Output of the Final Solution. Details are as follows: S4-4-1: After a successful solution, the solution returned by the solver is automatically parsed, and the optimal target value and the access path sequence corresponding to each vehicle are extracted.
[0056] S4-4-2: Output the solution results in a structured format, including at least: Target value: The optimal total travel distance obtained; Path: The access path for each vehicle; Solution status: The final state returned by the solver and the solution time, to ensure the traceability of the results.
[0057] S4-4-3: Use the above structured solution results as the final output to complete the end-to-end automated solution from natural language CVRP problem description to optimal delivery solution.
[0058] The beneficial effects of this invention are: (1) This invention takes the capacity-constrained vehicle routing problem (CVRP) as the only modeling object, and carries out automated modeling around the core constraints such as unique customer service, vehicle capacity, departure and return from the distribution center and elimination of sub-loops. The problem boundary is clear, the technical solution is focused and clear, and avoids the decrease in modeling accuracy caused by the overly broad coverage of generalized methods. (2) Through structured information extraction and confidence-driven constraint verification mechanism, this invention can automatically identify, complete and iteratively repair key constraints that are easily missed or semantically ambiguous in CVRP, effectively reduce the interference of ambiguity in natural language description on the modeling process, and significantly improve the integrity, standardization and reliability of CVRP mathematical model. (3) This invention realizes the automated transformation from CVRP natural language problem description to a solvable mathematical model, which greatly reduces the workload of manual modeling, shortens the modeling cycle, improves modeling efficiency, and provides a convenient way for non-professional users to use CVRP optimization methods; (4) The present invention introduces a closed-loop iterative mechanism of “solution-diagnosis-repair” to automatically diagnose and correct problems that occur when the solution fails, which significantly improves the success rate of solving the CVRP mathematical model and realizes end-to-end automated solution from natural language input to optimal delivery solution output. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the overall process for automated modeling and solving of CVRP problems provided in this embodiment of the invention.
[0060] Figure 2 This is a schematic diagram of the semantic parsing and structured information extraction process provided in the embodiments of the present invention.
[0061] Figure 3 This is a schematic diagram of a confidence-driven multi-round feedback mechanism provided in an embodiment of the present invention.
[0062] Figure 4 This is a schematic diagram of the CVRP mathematical model construction process provided in the embodiments of the present invention.
[0063] Figure 5 This is a schematic diagram of the model solving, repair, and result output process provided in the embodiments of the present invention. Detailed Implementation
[0064] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0065] This embodiment describes the capacity-constrained vehicle routing problem. There is a distribution center and 15 customer nodes, with the distribution center uniformly numbered 0 and customer nodes numbered 1 to 15. The system has 4 identical delivery vehicles, each with a maximum load capacity of 100 units. The distance matrix between nodes and the demand of each customer are known input data. All vehicles depart from the distribution center, visit several customers, and return to the distribution center. The requirement is that each customer is served by only one vehicle, and the total demand carried by each vehicle does not exceed 100 units. The optimization objective is to minimize the total travel distance of all vehicles. The overall process of this invention is as follows: Figure 1 As shown, the details are as follows: S101: Receives CVRP natural language description text and performs semantic parsing and structured information extraction.
[0066] S101-1: Obtain the CVRP description text input by the user in natural language. The system receives the CVRP input by the user as the raw input. The description text includes at least distribution center information, customer information, vehicle information, and optimization target information. In this embodiment, the description text received by the system contains complete CVRP scenario information, including the aforementioned 15 customers, 4 vehicles of the same model, a capacity of 100 units per vehicle, and minimizing the total driving distance.
[0067] S101-2: Structured Parameters and Variable Extraction. For example... Figure 2 As shown, the system extracts the structured information required for CVRP modeling from natural language descriptions based on preset parameter extraction prompt templates and variable extraction prompt templates. The specific steps are as follows: S101-2-1: Extracting structured parameters. (1) Distribution center parameters {depot, 0, scalar, distribution center node number, uniformly denoted as 0}; (2) Customer set parameters { , Set, the set of IDs of all customer nodes, containing a total of 15 customers}; (3) Node set parameters { , , set, a set of nodes consisting of distribution centers and all customer nodes. (4) Vehicle set parameters { , , set, set of available vehicle numbers, containing a total of 4 vehicles}; (5) vehicle capacity parameter { , 100, scalar, maximum loading capacity limit of each vehicle in the homogeneous fleet}; (6) Customer demand parameters { , Vector, Client Node Required quantity of goods to be delivered}; (7) Distance parameters between nodes { , , Matrix, Node With nodes The distance between them.
[0068] S101-2-2: Extracting Path Decision Variables Used to indicate vehicles From node Drive directly to the node Extracting auxiliary variables This is used to construct CVRP sub-loops to eliminate constraints. In this embodiment, It is a 16×16×4 dimensional 0-1 variable. It is a continuous auxiliary variable array of length 15.
[0069] S101-3: Extracting objectives and constraints. For example... Figure 2 As shown, the details are as follows: S101-3-1: The system calls the target extraction prompt template to perform semantic parsing on the natural language description and identifies the optimization target as minimizing the total driving distance.
[0070] S101-3-2: Initially extract a set of candidate constraints from the description text based on the constraint extraction prompt template. In this embodiment, the system extracts five candidate constraints from the description text in the first round: customer unique service constraint, vehicle departure and return to the distribution center constraint, path flow balance constraint, vehicle capacity constraint, and sub-loop elimination constraint. Among them, the sub-loop elimination constraint is problematic because the original description does not explicitly mention the implicit requirement that "the path should not contain isolated sub-loops," leading to a deviation in the semantic expression of this constraint during extraction by the large language model.
[0071] S102: Constraint verification based on a confidence-driven multi-round feedback mechanism. For example... Figure 3 As shown, the extracted candidate constraint set is scored and repaired, and the specific steps are as follows: S102-1: Quantify each candidate constraint with a score from 0 to 100. The specific steps are as follows: S102-1-1: The candidate constraints, original problem description, structured parameter set, and variable set are used as context input to the large language model. Based on preset constraint evaluation rules, the system judges the candidate constraints from the perspectives of semantic consistency, symbolic alignment, mathematical expressibility, necessity, and non-redundancy. The corresponding judgment results are output. According to preset scoring criteria, the system converts the judgment results into scores for the candidate constraints on multiple evaluation dimensions.
[0072] S102-1-2: Calculate the weighted sum of the scores from the five dimensions to obtain the comprehensive score for the candidate constraint. To improve the robustness of the scoring, the same constraint is applied... The average of the two independent scores is taken as the final score (in this embodiment). Take 5).
[0073] S102-1-3: Setting a high confidence threshold (In this embodiment) (80 points will be taken), based on the final comprehensive score. The system performs a screening process: when the score is higher than the threshold, the constraint is directly included in the formal constraint set; when the score is lower than the threshold, the constraint is marked as a candidate constraint to be reviewed and processed in step S102-2. In this embodiment, the system scores the first round of candidate constraints as follows: the customer unique service constraint, vehicle departure and return to the distribution center constraint, path flow balance constraint, and vehicle capacity constraint are all greater than or equal to the threshold and are directly included in the formal constraint set; the sub-loop elimination constraint is marked as a suspicious constraint due to expression deviation being lower than the threshold, triggering the feedback repair process.
[0074] S102-2: When the overall score Below the preset threshold When this occurs, the constraint repair process is triggered. The specific process is as follows: S102-2-1: The candidate constraints to be repaired, their scores and deduction reasons in each dimension, the original problem description, the structured parameter set and variable set are all used as context input to the large language model.
[0075] S102-2-2: Guide the large language model to correct, rewrite, or delete this constraint. In this embodiment, the large language model rewrites the LaTeX expression for the sub-loop elimination constraint.
[0076] S102-2-3: Re-evaluate. Remove the constraints from the sub-loop and return to step S102-1-1 for re-evaluation. If the overall score is... If the score is greater than the threshold, the sub-loop constraint elimination score is included in the formal constraint set; otherwise, proceed to step S102-2 for further repair. In this embodiment, if the score of the corrected sub-loop constraint elimination is greater than the threshold, it is included in the formal constraint set.
[0077] S102-3: Set up a circuit breaker mechanism to prevent the same constraint from getting stuck in an invalid loop during repair. The specific process is as follows: S102-3-1: Maintain a circuit breaker counter for each candidate constraint, with an initial value of 0; increment the counter for the constraint by 1 after each "scoring-repairing-rescoring" cycle.
[0078] S102-3-2: When the circuit breaker counter for a candidate constraint reaches a preset upper limit. (In this embodiment, 3 rounds are set) and the overall score is still lower than If a candidate constraint cannot be repaired through an automated process, it is removed from the candidate constraint set to avoid invalid iterations. In this embodiment, after the first "scoring-repairing-rescoring" cycle, the comprehensive score of the candidate sub-loop elimination constraint has reached a preset threshold, so the circuit breaker mechanism is not triggered, and it is retained in the candidate constraint set as a repaired valid constraint.
[0079] S103: Construction of the CVRP mathematical model. For example... Figure 4 As shown, based on the structured parameters and decision variable definitions obtained in step S101, as well as the target semantics and high-confidence constraint set output in steps S101 and S102, the system calls the objective function modeling hint template and constraint modeling hint template to map the target semantics and constraint semantics into LaTeX mathematical expressions one by one, forming a complete CVRP mathematical model. The specific steps are as follows: S103-1: Based on the structured parameters and decision variables extracted in step S101, and the target semantics and high-confidence constraint set output in steps S101 and S102, establish the structured parameter set and variable set of the CVRP mathematical model. S103-2: Construct the objective function that minimizes the total travel distance, as shown in the following equation: S103-3: Construct a unique service constraint for each customer, meaning each customer must be accessed by exactly one vehicle and only once. As shown in the following formula: S103-4: Construct vehicle departure and return constraints, meaning that each vehicle must depart from the distribution center and eventually return to the distribution center, as shown in the following formula: S103-5: Construct path flow balance constraints, that is, the number of times a vehicle enters a node equals the number of times it leaves, to ensure the continuity of the path, as shown in the following formula: S103-6: Establish vehicle capacity constraints, meaning that the total demand served by each vehicle must not exceed its maximum loading capacity, as shown in the following formula: S103-7: Construct sub-loops to eliminate constraints, i.e., do not allow independent closed loops that do not pass through the distribution center, as shown in the following equation: S103-8: Construct constraints on the values of decision variables, limiting the range of values for path decision variables and auxiliary variables, as shown in the following formula: Through the above steps S103-1 to S103-8, a complete CVRP mathematical model is formed.
[0080] S104: CVRP mathematical model solution, repair, and result output. For example... Figure 5 As shown, a mapping relationship is established between the CVRP mathematical formula and the solver. The CVRP mathematical model obtained in step S103 is imported into the solver for solution preparation. The specific steps are as follows: S104-1: Establish the mapping relationship between CVRP mathematical formulas and the solver. Import the CVRP mathematical model obtained in step S103 into the solver for solution preparation. Specifically, this includes: S104-1-1: CVRP Mathematical Model Initialization: Based on the interface specification of the selected solver, a CVRP mathematical model instance is established. In this embodiment, Gurobi is used as the solver. S104-1-2: Loading Structured Parameters: Loading the extracted structured parameter set (including the customer set) Vehicle assembly Vehicle capacity Customer demand and the distance matrix between nodes (etc.) are sequentially imported into the solver; S104-1-3: Variable Mapping: Mapping the extracted path decision variables and auxiliary variables to the corresponding variable objects in the solver, wherein multidimensional path decision variables adopt... Subscript indexing is performed in the form of [format], and auxiliary variables are [used in the format of ]. Single-dimensional indexing is performed in the form of [missing information]. In this embodiment, the three-dimensional path decision variables are indexed through [missing information]. x The auxiliary variables are declared using `model.addVars(16, 16, 4, vtype=GRB.BINARY, name="x")`; u = model.addVars(15, vtype=GRB.CONTINUOUS, name=" u Make a statement; S104-1-4: Importing Objectives and Constraints: The objective function and all constraints are imported into the solver sequentially, and summation-type mathematical expressions are converted into aggregate forms supported by the solver. In this embodiment, the objective function is set using model.setObjective(...), and the optimization direction of GRB.MINIMIZE is explicitly specified as minimization. Each constraint is added one by one using model.addConstr(...).
[0081] S104-2: After completing the above mapping and import, call the solver to solve the CVRP mathematical model and perform branch processing according to the solution status: (1) When the solver returns the optimal solution status, directly output the optimal target value (i.e. the minimum total driving distance) and the access path order corresponding to each vehicle, and enter step S8 to perform result analysis; (2) When the solver returns infeasible, unbounded, solution timeout or other abnormal status, enter step S104-3 to start the repair process.
[0082] S104-3: Repairing CVRP mathematical models that failed to solve; see reference. Figure 5 The CVRP mathematical model that failed to be solved in step S106 will be repaired. The specific steps are as follows: S104-3-1: Automatically capture the complete error information returned by the solver when the solution fails, archive and store it, and extract key diagnostic information as input for subsequent repair.
[0083] S104-3-2: Input the original problem description, the currently failed CVRP mathematical model, the error information extracted in step S104-2, the structured parameter set and variable set as context into the large language model, guide the large language model to analyze the root cause of the solution failure, and generate a corrected complete CVRP mathematical model.
[0084] S104-3-3: The corrected CVRP mathematical model is re-submitted to S104-2 for solving, forming a closed-loop iterative process of "solving - diagnosis - repair" until the CVRP mathematical model is successfully solved.
[0085] S104-4: Analysis and Output of the Final Solution. Details are as follows: S104-4-1: After a successful solution, the solution returned by the solver is automatically parsed, and the optimal target value and the access path sequence corresponding to each vehicle are extracted.
[0086] S104-4-2: Output the solution results in a structured format, including at least: Target value: The optimal total travel distance obtained; Path: The access path for each vehicle; Solution status: The final state returned by the solver and the solution time, to ensure the traceability of the results.
[0087] S104-4-3: The structured solution results described above are used as the final output to complete the end-to-end automated solution from natural language CVRP problem description to optimal delivery plan. In this embodiment, the system finally outputs the optimal total travel distance for this CVRP instance and outputs the specific delivery plans for 4 vehicles, such as: "Vehicle 1: 0-3-7-10-0"; "Vehicle 2: 0-1-5-9-14-0"; "Vehicle 3: 0-2-6-11-13-0"; "Vehicle 4: 0-4-8-12-15-0". The total load of each vehicle does not exceed 100 units, thus providing a directly executable decision basis for delivery scheduling.
Claims
1. A method for capacity-constrained vehicle path modeling and solution based on a large language model, characterized in that, Includes the following steps: Step S1: Receive the capacity-constrained vehicle routing problem (CVRP) problem description and perform semantic parsing and structured information extraction; S1-1: Obtain the capacity-constrained vehicle routing problem description text input by the user in natural language; the problem description includes at least distribution center information, customer information, vehicle information, and optimization target information; S1-2: Call the parameter extraction prompt template and variable extraction prompt template to extract the structured parameters and variable definitions required for CVRP from the problem description; wherein, the structured parameters include at least customer set, vehicle set, distribution center, customer demand, vehicle capacity and distance data between nodes, and the variable definitions include at least path decision variables and auxiliary variables for sub-loop elimination; input the problem description into the large language model and output the structured parameters and variables; S1-3: Call the target extraction prompt template and constraint extraction prompt template to extract the target and constraint, and obtain the optimization target and candidate constraints; Step S2: Verify the obtained candidate constraints using a confidence-driven multi-round feedback mechanism to obtain the CVRP constraint set; S2-1: Quantify each extracted candidate constraint with a score from 0 to 100 to obtain a comprehensive score. ; S2-2: When the overall score Below the preset threshold When this occurs, the constraint repair process is triggered; S2-3: Set up a circuit breaker mechanism to prevent the same constraint from getting stuck in an invalid loop for repair; Step S3: Construct the CVRP mathematical model; Based on the structured parameters and variables extracted in step S1, the target semantics, and the verified CVRP constraint set output in step S2, map the target semantics and constraint semantics one by one into the corresponding LaTeX mathematical expressions to form a complete CVRP mathematical model. Step S4: Solve and repair the CVRP mathematical model and output the results.
2. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Step S1-2 is as follows: S1-2-1: Construct a parameter extraction prompt template, including: Task Description: This task informs the large language model of its objective, namely, to extract the structured parameter information required for modeling from the CVRP problem description, and requires the large language model to output the data strictly in accordance with the specified JSON format. Problem Description: This section contains the natural language problem description to be processed, which is used as the input to the large language model; that is, the problem description text. Mind chain guidance: Through step-by-step prompts, guide the large language model to complete entity recognition, numerical extraction, dimension judgment and semantic interpretation in sequence; Output format constraints: Each structured parameter must be output as a quadruple {name, value, dimension, semantic definition} to ensure the uniformity and standardization of the extraction results; Example Reference: The template provides several standardized input and output examples so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities; The structured parameter extraction prompt template is invoked to extract all structured parameters from the question description text and output them in the form of a quadruple {name, value, dimension, semantic definition}, specifically including: The distribution center parameter is {depot, 0, scalar, distribution center node number}; where depot represents the distribution center, and 0 represents the unique number of the distribution center node. Customer set parameters { , The set, the set of IDs for all client nodes, contains a total of 1,000 customers; among them Represents the set of client nodes. This represents the range of numbers for all client nodes, which includes... One customer node; Node set parameters { , , a set, consisting of the distribution center and all customer nodes}; where, Represents the set of all nodes. Indicates the distribution center node. This represents the set of client nodes, therefore This represents the complete set of nodes formed by merging the distribution center nodes with all customer nodes; Vehicle set parameters { , A set, a set of available vehicle IDs, containing a total of Vehicles}; among them, Indicates a collection of vehicles. This indicates the range of available vehicle numbers, which includes... vehicle; Vehicle capacity parameters { , , scalar, the maximum loading capacity limit of each vehicle in a homogeneous fleet; where... This indicates the maximum loading capacity of each vehicle; in a homogeneous fleet scenario, all vehicles share the same maximum capacity. ; Customer demand parameters { , Vector, Client Node The quantity of goods to be delivered; among which, Indicates the first The demand of each customer node A vector representing the total demand of all customer nodes; Node distance parameter { , , Matrix, Node With nodes The distance between them is calculated from the customer's coordinates when the input text provides the customer's coordinates; when the input text directly provides the distance matrix, the distance matrix is directly extracted. Indicates from node To the node Distance, node and nodes All belong to the node set ; This represents the distance matrix consisting of the pairwise distances between all nodes; This means that the number of rows and columns of the distance matrix are both equal to the number of nodes. The number of nodes in the middle; S1-2-2: Construct a variable extraction prompt template, including: Task Description Section: This section informs the large language model of the objective of this task, namely, to extract the decision variable information required for modeling from the CVRP problem description, and requires the large language model to output strictly in accordance with the specified JSON format. Problem description section: This section carries the natural language problem description to be processed, which serves as the input content for the large language model; that is, the problem description text. The thought chain guidance section guides the large language model through step-by-step prompts to complete the decision object identification, variable dimension judgment, value type analysis, and semantic interpretation in sequence. Output format constraints: Each variable must be output as a quadruple {variable name, dimension, type, and semantic definition} to ensure the uniformity and standardization of the extraction results; Example Reference Section: Several standardized variable output examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities; The variable extraction prompt template is invoked to extract all variables from the problem description text and output them as a quadruple {name, dimension, type, semantic definition}, specifically including: Path decision variables { , 0-1 variables, if vehicle From node Drive directly to the node If the expression is true, then the value is 1; otherwise, it is 0. Represents nodes ,node and vehicles Corresponding path selection variables, nodes and nodes All belong to the node set ,vehicle Belongs to the vehicle collection When the vehicle From node Drive directly to the node hour, =1, otherwise =0; This indicates the scale of the path decision variable, meaning that for each vehicle, it is necessary to determine whether it travels between any two nodes. Sub-ring elimination of auxiliary variables { , A continuous variable, representing the vehicle's access to the client node. The access order corresponding to the time is used to eliminate sub-loops in the path; where, Represents client node The corresponding access order variable, client node Belongs to customer collection ; This indicates that the number of auxiliary variables is consistent with the number of client nodes, meaning each client node corresponds to one. This variable is used in conjunction with sub-loop constraint elimination to prevent independent loops from appearing in the vehicle path that do not pass through the distribution center.
3. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Steps S1-3 are as follows: S1-3-1: Construct a target extraction prompt template, including: Task Description: This task informs the large language model of the objective of this task, namely, to identify the core optimization objective from the CVRP problem description; the large language model is also required to output strictly in the specified JSON format. Context embedding: used to carry all the contextual information required for modeling, including the natural language problem description, the extracted structured parameters, decision variables, and auxiliary variables; Mind chain guidance: Through step-by-step prompts, guide the large language model to complete the optimization of intent recognition, target object judgment, measurement index determination, and mathematical meaning interpretation in sequence; Output format constraints: The output results are specified to adopt a two-layer expression form of "natural language statement + structured encapsulation", that is, both a natural language description of the target is given, and it is encapsulated in a structured output block of "target"; Example Reference: Several standardized examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities; The aforementioned target extraction prompt template is used to extract the optimization objective from the natural language as: "Minimize the number of capacity-constrained vehicles in the fleet starting from distribution center 0, and complete the optimization of all vehicles while satisfying vehicle capacity constraints." "A unique access for each customer, and return the total distance traveled to the distribution center"; this statement is uniformly encapsulated in a structured output block identified by the "target" field; S1-3-2: Construct a constraint extraction prompt template, including: Task Description: This task informs the large language model of the objective of the task, namely, to identify the constraints required for modeling from the CVRP problem description one by one; the large language model is also required to output the results in the specified JSON format. Context embedding: used to carry all the contextual information required for modeling, including the natural language problem description, the extracted structured parameters, decision variables, and auxiliary variables; Mind chain guidance: Through step-by-step prompts, the large language model is guided to complete the constraint recognition and semantic interpretation in sequence, making the construction process of the constraint set more orderly; Output format constraints: Each constraint is required to adopt a two-layer expression of "natural language statement + structured encapsulation", that is, both the natural language description of the constraint is given and it is encapsulated in a unified "constraint" output block. Example Reference: Several standardized examples are provided in the template so that the large language model can refer to the structure and expression of the examples when generating results, thereby reducing format deviations and ambiguities; The constraint extraction prompt template is invoked to transform the natural language description into a standardized constraint. The specific process includes: The customer unique service constraint means that each customer must be accessed by exactly one vehicle and only once. Vehicle departure and return constraints, meaning that each vehicle must depart from the distribution center and eventually return to the distribution center; Path flow balance constraint, which means that the number of times a vehicle enters a node is equal to the number of times it leaves, in order to ensure the continuity of the path; Vehicle capacity constraints mean that the total demand of customers served by each vehicle must not exceed its maximum loading capacity. Sub-loop constraint elimination means that independent closed loops that do not pass through the distribution center are not allowed; The above constraints are encapsulated as candidate constraints in an output block identified by the "constraint" field.
4. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Step S2-1 is as follows: S2-1-1: The candidate constraints, original problem description, structured parameter set, and variable set are used as context input to the large language model, and the candidate constraints are judged based on the preset constraint evaluation rules. The large language model identifies the semantic basis, involved symbols, usable mathematical expression forms, constraint types, and relationships with existing constraints from the candidate constraints, and outputs the corresponding judgment results. Then, according to the preset scoring criteria, the judgment results are converted into scores of the candidate constraints on multiple evaluation dimensions. The multiple evaluation dimensions include: Semantic consistency: This is evaluated based on the semantic correspondence between candidate constraints and the original problem description, the consistency of task objectives, and the correspondence between keywords or entities. It is used to determine whether candidate constraints can be supported by the original problem description. Symbol alignment: Based on the structured parameters and variables involved in the candidate constraints, determine whether a corresponding symbol can be found in the structured parameter set and variable set, and determine the evaluation result based on whether the corresponding symbol is complete, whether the symbol type is consistent, and whether the meaning is consistent; Mathematical expressibility: Candidate constraints are evaluated based on whether they can be expressed as mathematical expressions in linear programming or integer linear programming. These mathematical expressions include linear summation, constant coefficients, equality constraints, inequality constraints, binary variable constraints, and integer variable constraints. For candidate constraints that involve variable multiplication, nonlinear functions, or are difficult to convert into linear expressions, their evaluation results are reduced. Necessity: Determine whether the candidate constraints are necessary constraints to ensure the correctness of the CVRP mathematical model; the necessary constraints include customer unique service constraints, vehicle departure and return constraints, path flow balance constraints, vehicle capacity constraints, sub-loop elimination constraints, and variable value constraints. Non-redundancy: Based on the comparison between the current candidate constraint and other candidate constraints, determine whether the current candidate constraint has an independent effect; if the current candidate constraint can be obtained from other candidate constraints, or is just a different expression of other candidate constraints, then its evaluation result is reduced; For each evaluation dimension, a pre-defined scoring point is set, which includes a high matching level, a medium matching level, and a low matching level; wherein, the high matching level corresponds to 15 to 20 points, the medium matching level corresponds to 7 to 14 points, and the low matching level corresponds to 0 to 6 points; the large language model outputs a score within the corresponding score range based on the degree of matching between the candidate constraints and the corresponding evaluation rules. S2-1-2: Calculate the weighted sum of the scores from the five dimensions to obtain the comprehensive score for the candidate constraint. To improve the robustness of the scoring, the same constraint is applied... The average of the two independent scores is taken as the final score. S2-1-3: Based on the final comprehensive score Screening: When the score is higher than the threshold, the constraint is directly included in the formal constraint set; when the score is lower than the threshold, the constraint is marked as a candidate constraint to be reviewed and processed in step S2-2.
5. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Step S2-2 is as follows: S2-2-1: Input the candidate constraints to be repaired, their scores and deduction reasons for each dimension, the original problem description, the structured parameter set and variable set as context into the large language model, and guide the large language model to make targeted corrections for the deduction items. S2-2-2: Based on the score loss in the scoring dimensions, the large language model selects the appropriate repair method from the following three types of operations: Rewriting: When semantic consistency or mathematical expressibility scores are lost, the natural language statement of the constraints is rewritten to make its semantics more consistent with the original problem description. Completion: When symbol alignment is lost, supplement the missing symbol references, scope of action or quantification conditions in the constraint to make the mathematical structure of the constraint complete; Deletion: When the necessity or non-redundancy score is seriously lost, the constraint is marked as redundant or invalid and deleted. S2-2-3: Send the repaired candidate constraints back to step S2-1 for re-evaluation. If the comprehensive score is... If yes, it is included in the formal constraint set; otherwise, proceed to step S2-2 to continue the repair. S2-2-4: Once all candidate constraints have passed the scoring, proceed to step S2-3; otherwise, continue with the repair process.
6. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Steps S2-3 are as follows: S2-3-1: Maintain a circuit breaker counter for each candidate constraint, with an initial value of 0; increment the counter for that constraint by 1 after each "scoring-repairing-rescoring" cycle. S2-3-2: When the circuit breaker counter for a candidate constraint reaches a preset upper limit. And the overall score is still lower than If the constraint cannot be repaired through the automated process, it is removed from the candidate constraint set to avoid invalid iterations. S2-3-3: After all candidate constraints have been scored, repaired, or circuit-breaking processed, the final high-confidence CVRP constraint set is output as the modeling input for subsequent steps.
7. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Step S3 is as follows: S3-1: Based on the structured parameters and variables extracted in step S1, establish the structured parameter set and variable set in the CVRP mathematical model; S3-2: An objective function based on minimizing the number of capacity-constrained vehicles in the fleet starting from distribution center 0, completing a unique visit to all customers while satisfying vehicle capacity constraints, and returning the total travel distance to the distribution center. S3-3: Construct a unique service constraint for each customer, meaning that each customer must be accessed by exactly one vehicle and only once; S3-4: Construct vehicle departure and return constraints, that is, each vehicle must depart from the distribution center and eventually return to the distribution center; in, Indicates if vehicle Drive directly from distribution center 0 to node ,but ,otherwise , Indicates if vehicle From node If you drive directly to distribution center 0, then... ,otherwise ; S3-5: Construct path flow balance constraints, that is, the number of times a vehicle enters a node is equal to the number of times it leaves, in order to ensure the continuity of the path; in, Indicates if vehicle From node Drive directly to the node ,but ,otherwise , Indicates if vehicle From node Drive directly to the node ,but ,otherwise ; S3-6: Establish vehicle capacity constraints, that is, the total demand of customers served by each vehicle must not exceed its maximum loading capacity; S3-7: Construct sub-loops to eliminate constraints, that is, do not allow independent closed loops that do not pass through the distribution center; S3-8: Construct constraints on the values of decision variables, limit the range of values for path decision variables and auxiliary variables, and thus form a complete CVRP mathematical model; 。 8. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 1, characterized in that, Step S4 is as follows: S4-1: Establish the mapping relationship between CVRP mathematical formulas and the solver. Import the CVRP mathematical model obtained in step S3 into the solver for solution preparation. Specifically, this includes: CVRP mathematical model initialization: Create a CVRP mathematical model instance according to the interface specification of the selected solver; Structured parameter loading: The structured parameter set extracted in step S1 is sequentially imported into the solver, including the client set. Vehicle assembly Vehicle capacity Customer demand and the distance matrix between nodes ; Variable mapping: The path decision variables and auxiliary variables extracted in step S1 are mapped to the corresponding variable objects in the solver, wherein multidimensional path decision variables are mapped using... Subscript indexing is performed in the form of [format], and auxiliary variables are [used in the format of ]. Single-dimensional indexing is performed in the form of [format missing]. Importing Objectives and Constraints: Import the objective function and all constraints into the solver in sequence, and convert summation-type mathematical expressions into aggregate forms supported by the solver; S4-2: After completing the above mapping and import, call the solver to solve the CVRP mathematical model and perform branch processing according to the solution status: when the solver returns the optimal solution status, directly output the optimal target value, i.e., the minimum total travel distance and the access path order corresponding to each vehicle, and proceed to step S4-4 for result analysis; when the solver returns infeasible, unbounded, or solution timeout, proceed to step S4-3 to start the repair process; S4-3: Repairing CVRP mathematical models that failed to solve; S4-4: Analysis and Output of the Final Solution Results 9. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 8, characterized in that, Step S4-3 is as follows: S4-3-1: Automatically capture the complete error information returned by the solver when the solution fails, archive and store it, and extract key diagnostic information as input for subsequent repairs; S4-3-2: Input the original problem description, the current CVRP mathematical model that failed to solve, the error information extracted in step S4-3-1, the structured parameter set and variable set as context input to the large language model, guide the large language model to analyze the root cause of the solution failure, and generate a corrected complete CVRP mathematical model. S4-3-3: The corrected CVRP mathematical model is re-submitted to S4-2 for solving, forming a closed-loop iterative process of "solving-diagnosis-repair" until the solution is successful.
10. The method for capacity-constrained vehicle path modeling and solving based on a large language model according to claim 8, characterized in that, Step S4-4 is as follows: S4-4-1: When the solution is successfully obtained, the solution returned by the solver is automatically parsed, and the optimal target value and the access path sequence corresponding to each vehicle are extracted. S4-4-2: Output the solution results in a structured format, including at least: Target value: The optimal total travel distance obtained; Path: The access path for each vehicle; Solution status: The final status returned by the solver and the solution time, to ensure the traceability of the results; S4-4-3: Use the above structured solution results as the final output to complete the end-to-end automated solution from natural language CVRP problem description to optimal delivery solution.