Path planning heuristic function generation platform and method based on large language model and evolutionary computation collaborative optimization

Through a large language model and evolutionary computing collaborative optimization platform, the heuristic functions are automatically generated and optimized, and the problem of inefficient path planning in complex and dynamic environments is solved, and the generation of high-quality heuristic functions and the efficient operation of path planning algorithms are realized.

CN120335780APending Publication Date: 2025-07-18EAST CHINA NORMAL UNIV
View PDF 0 Cites 14 Cited by

Patent Information

Application Number
CN202510513596.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The prior art is difficult to generate high-quality heuristic functions in complex and dynamic environments, resulting in inefficient or failure of path planning algorithms, and traditional manual design and existing automation methods are costly, time-consuming and labor-intensive, and difficult to generalize.

Method used

A platform that uses a coordinated optimization of large language model (LLM) and evolutionary computing (EC) is adopted to receive task configurations through a visual interface, generate and optimize heuristic functions, and combine environmental context and performance feedback to automatically generate heuristic functions that are adapted to a specific environment.

Benefits of technology

It significantly improves the performance and adaptability of path planning algorithms in complex and dynamic environments, reduces dependence on human expert experience, improves the quality of heuristic functions and the efficiency of path planning, and shortens the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335780A_ABST
    Figure CN120335780A_ABST
Patent Text Reader

Abstract

The invention discloses a path planning heuristic function generation platform and method based on collaborative optimization of a large-scale language model and evolutionary computation. According to the technology, the large-scale language model (LLM) and evolutionary computation (EC) work cooperatively. The platform generates or mutates a heuristic function expressed as an executable code through LLM based on a structured prompt containing an environment context and performance feedback; and an EC framework (such as genetic programming) is combined with performance evaluation feedback to perform selection and iterative optimization on a heuristic code population, and population diversity is maintained. The method aims at overcoming the limitation that a traditional heuristic design is difficult and poor in adaptability, a high-quality heuristic function adapting to a complex and dynamic environment is automatically generated, and therefore the efficiency of a path planning algorithm and path quality are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of algorithm design and optimization driven by artificial intelligence, and particularly relates to a search optimization framework that utilizes the code generation and understanding capabilities of large language models (LLMs) and combines evolutionary computation (EC) to automatically generate, evaluate, and iteratively optimize the core components of path planning algorithms (especially heuristic search-based algorithms such as A* and its variants) - the heuristic function platform and methods. The present invention aims to overcome the limitations of traditional heuristic function design and significantly improve the performance, efficiency, and adaptability of path planning in complex, dynamic, and high-dimensional environments, and is applicable to a wide range of technical fields such as robot navigation, autonomous driving, unmanned aerial vehicle path planning, logistics distribution, and game artificial intelligence (AI). Background Art

[0002] Path planning is one of the basic capabilities of intelligent systems, and the goal is to find the optimal or a path that meets specific constraints from a starting point to an ending point in a given environment. Heuristic search algorithms represented by the A* algorithm guide the search direction by introducing a heuristic function h(n) (estimating the cost from state n to the goal), and can significantly reduce the state space to be explored compared to blind search (such as the Dijkstra algorithm), improving the search efficiency. The quality of the heuristic function directly determines the algorithm performance: an accurate (close to the real cost) and computationally efficient heuristic function can greatly accelerate the discovery of the optimal solution, while a poor-quality heuristic function may lead to algorithm performance degradation or even be inferior to blind search.

[0003] However, designing high-quality heuristic functions faces great challenges. General heuristics (such as Manhattan distance, Euclidean distance) are simple and easy to use, but often perform poorly in environments with complex obstacles, non-uniform costs, or dynamic factors. Manually designing and adjusting heuristic functions for specific problem domains requires in-depth domain knowledge, a large amount of engineering experience, and repeated trial-and-error experiments, which are costly, time-consuming, and difficult to generalize to new environments or task requirements. Especially in a dynamically changing environment (such as the presence of moving obstacles), fixed, offline-designed heuristic functions are difficult to adapt to environmental changes in real time, resulting in low path planning efficiency or even failure.

[0004] To overcome these limitations, researchers have explored methods for automating or learning heuristic functions. Early work included using machine learning techniques such as neural networks (NNs) to learn heuristic functions, or using traditional evolutionary computation methods, especially genetic programming (GP), to evolve the mathematical expressions or program structures of heuristic functions. These methods have achieved certain success, but may face problems such as dependence on training data, poor model interpretability (for NNs), or limited search efficiency (for traditional GP).

[0005] In recent years, large language models (LLMs) have demonstrated remarkable capabilities in areas such as natural language processing and code generation. They can understand context, follow instructions, and generate code snippets with complex structures and correct semantics. This offers new possibilities for automated algorithm design, including the generation of heuristic functions. Meanwhile, the paradigm of combining the creative generation ability of LLMs with the systematic optimization ability of evolutionary computation (EC) has also attracted wide attention. For example, the FunSearch framework proposed by DeepMind successfully combines an LLM (such as PaLM 2) with an evaluator and an evolutionary process to search in the program space and discover novel solutions to combinatorial optimization problems (such as the cap set problem, online bin packing problem). The core idea of FunSearch is to use an LLM to generate candidate programs (or program fragments), verify their effectiveness through an evaluator, and use evolutionary mechanisms (such as the island model) to retain and iteratively improve high-performance programs. In addition, the AutoHD method also explores directly using an LLM to generate heuristic functions (Python code) for planning tasks through prompt engineering and perform iterative optimization.

[0006] Although existing techniques such as FunSearch and AutoHD demonstrate the potential of LLMs in code generation and optimization, they are not specifically designed for the complexity of path planning heuristic functions. FunSearch focuses more on discovering solutions to mathematical problems or optimizing specific function fragments, and its LLM-evaluator-evolution loop mechanism does not fully utilize the structured information of the environment and detailed performance feedback to specifically guide the LLM to generate heuristics adapted to a specific path planning environment. Although AutoHD directly generates heuristics, its evolutionary mechanism and deep integration with the path planning environment are also insufficient. The evolutionary process of AutoHD mainly optimizes the success rate or accuracy of the task, rather than the theoretical properties of the heuristic function. For example, the heuristic function used in path planning algorithms must satisfy admissibility or consistency. Therefore, the heuristic functions generated by AutoHD may guide the search to quickly find a solution, but this solution is not guaranteed to be the optimal solution, which is an important limitation for applications that require an optimal path guarantee (such as logistics optimization, precise operation).

[0007] In addition, how to effectively encode the complexity of the environment (such as dynamic obstacles, high-dimensional spaces) into context information that the LLM can understand and utilize, and how to design feedback loops to guide the LLM to generate heuristics more adapted to a specific environment, remain open challenges.

[0008] Therefore, there is an urgent need for a technical solution and an integrated platform that specifically targets the field of path planning, deeply integrates the code generation ability of the large language model (LLM) and the optimization ability of evolutionary computation (EC), and includes an effective environmental information encoding and feedback mechanism. The platform should be able to automatically and intelligently generate and optimize high-quality path planning heuristic functions, overcome the deficiencies of existing technologies, and significantly improve the performance and adaptability of path planning algorithms in various complex and dynamic environments. Summary of the Invention

[0009] The object of the present invention is to provide a platform and corresponding method for generating path planning heuristic functions through the collaborative optimization of a large language model (LLM) and evolutionary computation (EC). The platform aims to realize an automated, data-driven, and specific environment and task requirement-based generation and optimization process of heuristic functions, overcome the limitations of traditional manual design and existing automated methods, significantly improve the performance, efficiency, and robustness of path planning algorithms (especially heuristic search algorithms) in complex and dynamic environments, and provide intelligent and high-performance technical support for related application fields such as robotics and autonomous driving.

[0010] The specific technical solution to achieve the object of the present invention is as follows: A platform for generating path planning heuristic functions through the collaborative optimization of a large language model and evolutionary computation, the platform comprising: A visualization and user interface module for receiving user-defined task configuration information, the task configuration information including environmental representation data, the type of the target path planning algorithm framework, and evolutionary optimization parameters; the module is further used for monitoring the optimization process and displaying the results; An environmental model interface for providing the standardized environmental information required by the path planning algorithm according to the environmental representation data; A data preprocessing and environmental analysis module for processing the environmental representation data, generating structured environmental information, and extracting key environmental features to construct an environmental context description for use by the large language model LLM; the environmental context description contains environmental characteristic information for guiding the generation of heuristic functions; The LLM-based heuristic generation and optimization module is configured as follows: representing a path planning heuristic function as an executable program code of a predetermined programming language; initializing and maintaining a population consisting of candidate heuristic program codes; in the iterative process of an evolutionary computing EC framework, using a large language model LLM, based on structured prompt information including at least one selected parent program code, associated performance evaluation data, a preset optimization goal, and a description of the environmental context, generating new candidate heuristic program codes or semantically mutating existing program codes; using the evolutionary computing EC framework, iteratively optimizing the population through a selection operation based on a fitness score, a generation or mutation operation based on an LLM, and a population replacement operation; the EC framework includes a diversity maintenance mechanism for maintaining the diversity of candidate heuristic program codes in the population during the evolution process; A path planning algorithm performance evaluation module, which is configured as follows: at least one path planning algorithm framework (such as a heuristic search algorithm) is built in, and the path planning algorithm framework allows the heuristic function program code used by it to be dynamically replaced; according to a predefined performance evaluation protocol, the path planning algorithm framework is executed on the environmental information provided by the environmental model interface, the performance when driven by the candidate heuristic program code in the population is evaluated, and an evaluation result including at least one predefined performance indicator (such as path cost, computing resource consumption) is output; The experimental scheduling and control core is used to coordinate the operation of each module in the platform according to the task configuration information, and manage the automated process from environment processing to heuristic generation, evaluation, feedback, and optimization; the key is to feed back the evaluation results output by the path planning algorithm performance evaluation module to the LLM-based heuristic generation and optimization module to calculate the fitness score of the candidate heuristic program code, and guide the selection operation of the EC framework and the construction of subsequent LLM prompt information that may affect it; Data management and experiment recording system, used for persistent storage of the environment representation data, task configuration information, heuristic program code generated in each evolutionary iteration, performance evaluation log and final optimization results; The parallel computing support module is used to execute multiple performance evaluation tasks in the path planning algorithm performance evaluation module in parallel to accelerate the optimization process.

[0011] Furthermore, the large language model LLM is a pre-trained model with code generation and comprehension capabilities, and the structured prompt information is intended to guide the LLM to generate code that meets the syntax and semantic requirements of the path planning heuristic function and performs targeted improvements based on the performance evaluation data, environmental context description and optimization goals.

[0012] Furthermore, the evolutionary computation EC framework adopts genetic programming GP technology to manage and evolve the program codes in the population.

[0013] Furthermore, the diversity maintenance mechanism is selected from at least one of the following: fitness sharing, novelty search, quality diversity algorithm, niche technology, and island model.

[0014] Furthermore, the predefined performance metrics include at least one of the number of expanded nodes, computation time, cost of finding a path, path smoothness, and safe distance from dynamic or static obstacles in the environment during the path planning process.

[0015] Furthermore, the path planning algorithm framework is the A* algorithm or its variant (such as D* Lite) or other path planning algorithms based on heuristic search.

[0016] A method for generating a path planning heuristic function based on the collaborative optimization of a large language model and evolutionary computation, which is applied to the above platform. The method includes the following steps: (a) Receiving user-defined task configurations through the visualization and user interface module, including environmental representation data, the type of target path planning algorithm framework, and evolutionary optimization parameters; (b) Processing the environmental representation data through the data preprocessing and environment parsing module to generate structured environmental information and environmental context descriptions for use by the large language model LLM; (c) Initializing a population consisting of candidate heuristic program codes through the LLM-based heuristic generation and optimization module; (d) Controlling the execution of the following iterative optimization steps by the experiment scheduling and control core until a preset termination condition is met: (d1) Evaluation: Executed by the path planning algorithm performance evaluation module and accelerated by the parallel computing support module. Under the predefined performance evaluation protocol, evaluate the performance of each candidate heuristic program code in the current population when driving the path planning algorithm framework, and obtain evaluation results including at least one predefined performance metric; (d2) Fitness calculation: Executed by the LLM-based heuristic generation and evolutionary optimization module, and calculate the fitness scores of each candidate heuristic program code based on the performance metrics obtained in step (d1); (d3) Selection: Executed by the EC framework. According to the fitness scores and the diversity maintenance mechanism, use a selection strategy to screen the parent program codes for generating the next generation population; (d4) Generation or Mutation: Executed by the LLM-based heuristic generation and evolutionary optimization module. Based on the selection result in step (d3), construct structured prompt information including parental program code, performance evaluation data, optimization objectives, and environmental context descriptions, and use the large language model LLM to generate new candidate heuristic program codes or perform semantic mutations on existing program codes; (d5) Replacement: Executed by the EC framework, update the population according to the replacement strategy (e.g., combined with elitism retention); (e) After the iterative optimization ends, output the heuristic program code with the highest fitness or meeting specific criteria from the final population as the optimization result; (f) Throughout the process, store the corresponding data through the data management and experiment recording system.

[0017] Furthermore, the evaluation step in step (d1) is accelerated by the parallel computing support module and is executed in parallel on multiple independent test cases or simulation environments.

[0018] Furthermore, the environmental representation data includes static obstacle information (such as map data) and / or dynamic obstacle information (such as predicted trajectories).

[0019] Furthermore, the large language model LLM is a pre-trained code generation large language model, the evolutionary computing (EC) framework adopts the genetic programming (GP) algorithm, and the structured prompt information is dynamically adjusted in step (d4) to reflect previous performance evaluation results or optimization progress.

[0020] Advantageous Effects: Compared with the prior art, the platform and method provided by the present invention have the following remarkable advantages: (1) Higher-quality heuristic functions: By combining the semantic understanding and code generation capabilities of the LLM and the system optimization capabilities of the EC, and being guided by environmental context information and performance feedback, it is possible to generate more accurate and more adaptable heuristic functions to specific environmental and task requirements than traditional manual design or single automation methods (such as only LLM prompts or traditional GP). This directly translates into higher efficiency and better path quality of the path planning algorithm.

[0021] (2) Stronger automation and intelligence levels: The entire design and optimization process of the heuristic function is highly automated, significantly reducing the dependence on human expert experience and the cumbersome manual tuning work. The introduction of the LLM makes the mutation / generation operations more "intelligent" and may discover innovative heuristic strategies that are difficult for traditional EC to reach.

[0022] (3) Adaptability to complex and dynamic environments: By encoding environmental features into the prompts of the LLM and using performance feedback for iterative optimization, the present invention can generate heuristic functions that adapt to complex static obstacle layouts and / or dynamic environmental changes, improving the robustness and efficiency of path planning in real-world scenarios.

[0023] (4) Cooperative mechanism different from the prior art: Compared with FunSearch which may focus more on the mode of LLM creativity + evaluator verification, or the direct prompt generation + evolution of AutoHD, the present invention emphasizes a deeper, two-way cooperation and feedback mechanism between the LLM and the EC. The performance evaluation results not only guide the selection of the EC but also may dynamically adjust the prompts of the LLM, forming a more effective closed-loop optimization. This specific integration method is expected to overcome the limitations of single technologies and achieve the effect of 1 + 1 > 2.

[0024] (5) Improvement of R & D efficiency and scalability: The automated platform significantly shortens the cycle of developing high-performance path planning algorithms for new environments or new robot platforms. The modular design is also convenient for expansion, such as integrating new LLM models, EC algorithms, or path planners.

[0025] (6) Research paradigm for promoting algorithm discovery: This platform is not only an engineering tool but also can be used as a research platform to explore the potential, limitations of the LLM in automated algorithm discovery (especially heuristic design), and the best combination with evolutionary computation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is the architecture diagram of the platform of the present invention; Figure 2 is the flowchart of the generation and optimization of the heuristic function of the present invention; Figure 3 is the schematic diagram of the hierarchical structure of the platform of the present invention; Figure 4 is the schematic diagram of a typical user interface during the optimization process of the platform of the present invention; Figure 5 is the schematic diagram of the test environment and results of the platform of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0027] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that these embodiments are only used to illustrate the present invention and do not limit the scope of the present invention.

[0028] The present invention discloses a platform for generating a heuristic function for path planning through the collaborative optimization of a large language model and evolutionary computation. The platform adopts a modular architecture (such as Figure 1As shown in [figure reference], its core innovation lies in the deep integration of the LLM and EC, as well as the specific design for the path planning field. The platform mainly includes the following functional modules: 1. Visualization and User Interface Module: As the interaction interface between the user and the platform, it allows the user to input task configurations (for example, select or upload environmental representation data, specify the target path planning algorithm framework such as A* or its variants, set LLM model parameters, EC hyperparameters such as population size, number of iterations, optimization objectives, etc.). This module is also used to monitor the optimization process in real time (for example, display the change in population fitness, performance metrics of the best heuristic function), and visually display the finally optimized heuristic function code, its performance in the test environment, and the generated path.

[0029] 2. Environment Model Interface: As the access and query layer for environmental data, it provides a standardized API (Application Programming Interface) for loading and accessing environmental representation data in different formats (such as two-dimensional grid maps, three-dimensional point cloud maps, graph structure representations, spatio-temporal representations containing dynamic obstacle information, etc.). It provides a unified environmental information query service for other modules of the platform (especially the path planning algorithm performance evaluation module and the data preprocessing module) (for example, query the status of a specified location, obtain adjacent obstacles, start and target point information, retrieve map connectivity, etc.).

[0030] 3. Data Processing and Environment Parsing Module: Responsible for deeply analyzing and feature extracting the environmental data obtained through the environment model interface, and transforming it into structured comprehensive environmental information. More importantly, this module extracts key environmental features related to path planning performance (such as obstacle density, channel width, connectivity metric, dynamic obstacle prediction trajectory features, etc.), and encodes these features into a format suitable for the LLM to understand, forming an "environmental context description". This description will serve as important input information when the LLM generates heuristic functions, aiming to guide the LLM to generate heuristic strategies that better adapt to the current environmental characteristics.

[0031] 4. LLM-based Heuristic Generation and Optimization Module: This is the core innovation module of the present invention, which realizes the generation and optimization of heuristic functions through the collaborative work of the LLM and EC.

[0032] Heuristic Representation: Define the heuristic function as an executable program code snippet or a complete function in a specific programming language (such as Python). This representation allows the LLM to directly generate it and is easy to integrate into the path planning algorithm framework.

[0033] Population Management: Adopt the EC framework (preferably the genetic programming GP technique) to maintain a population composed of candidate heuristic program codes (individuals).

[0034] LLM-driven Generation and Mutation: During the iteration of EC, this module constructs structured prompts and sends them to the LLM. These prompts are carefully designed and at least include: (a) one or more parent heuristic program codes selected from the current population; (b) performance evaluation data (fitness scores, specific performance metrics) of these parent programs; (c) clear optimization goals (e.g., "Please modify this function to reduce the number of expanded nodes while maintaining acceptability constraints", "Try to utilize the channel width information in the environmental context description"); (d) environmental context descriptions generated by the data preprocessing module. Based on this prompt, the LLM uses its code generation and understanding capabilities to generate new candidate heuristic program codes (which can be regarded as an intelligent crossover operation) or make meaningful modifications to the existing codes (which can be regarded as an intelligent mutation operation). Parameters such as the sampling temperature of the LLM can be adjusted to control the diversity of generation.

[0035] Evolutionary Loop: This module coordinates the various stages of the EC framework: selection based on fitness scores (e.g., tournament selection), invoking the LLM for generation / mutation, and updating the population according to replacement strategies (such as elitism).

[0036] Diversity Maintenance: Integrates diversity maintenance mechanisms (such as fitness sharing, novelty search, island model, etc.) to prevent the population from prematurely converging to local optima and encourage the exploration of different types of heuristic strategies.

[0037] 5. Path Planning Algorithm Performance Evaluation Module: As the evaluation unit, it is responsible for objectively and efficiently evaluating the performance of each candidate heuristic function in the population.

[0038] Pluggable Framework: Builds in one or more standard path planning algorithm frameworks (such as A*, D* Lite), which are designed to be dynamically loaded and replace the heuristic functions they use.

[0039] Performance Evaluation Protocol: Defines a set of standardized performance evaluation processes and metrics. This includes using a set of predefined, representative test environments (or provided by the environmental model interface), and calculating specific performance metrics, such as: path cost (length, time, energy consumption, etc.), computational efficiency (number of expanded nodes, CPU time), path quality (smoothness, safety / minimum distance from obstacles), planning success rate, etc. Execute a series of path planning tasks (e.g., from multiple different starting points to the end point) using the path planning algorithm framework loaded with candidate heuristic functions. Calculate and record the predefined performance metrics, which should comprehensively reflect the quality of the heuristic.

[0040] Result Output: For each candidate heuristic function, output the set of performance metrics on the test set.

[0041] 6. Platform Scheduling and Control Core: As the "brain" of the platform, it is responsible for automatically scheduling and coordinating the work of all other modules according to the user's task configuration. It manages the entire optimization process: starting from environmental data processing, initializing the population, and then driving the iterative optimization loop (evaluation -> fitness calculation -> selection -> LLM generation / mutation -> replacement) until the termination conditions are met (e.g., reaching the maximum number of iterations, performance convergence, finding a solution that meets the requirements). The key function is to manage the feedback loop between the LLM and the EC: passing the detailed performance metrics generated by the performance evaluation module to the optimization module for fitness calculation and guiding the EC selection process; at the same time, these performance information (possibly including the analysis results of code features that lead to good or bad performance) can be used to dynamically adjust the subsequent prompts provided to the LLM, thereby more effectively guiding the LLM generation process.

[0042] 7. Data Management and Logging System: Responsible for the persistent storage of all relevant data, including the input task configuration, environmental data, candidate heuristic program codes generated during each generation of evolution, detailed performance evaluation logs, fitness scores, and the finally optimized best heuristic function. This ensures the reproducibility and traceability of the experiment and provides a data basis for subsequent analysis and comparison.

[0043] 8. Parallel Computing Support Module: To accelerate the computationally intensive performance evaluation process (each candidate heuristic may need to run path planning on multiple test cases), this module provides parallel computing capabilities, allowing different evaluation tasks to be assigned to multiple CPU cores, threads, or computing nodes for parallel execution, improving the overall operating efficiency of the platform.

[0044] The automated optimization method of the present invention (the process is as Figure 2 shown). Using the above platform, the specific steps are as follows: Receive the task configuration input by the user through the interface.

[0045] Call the data preprocessing module to generate structured environmental information and the environmental context description required by the LLM.

[0046] Call the optimization module to initialize the population of candidate heuristic programs.

[0047] Start the iterative optimization loop managed by the experiment scheduling and control core. This loop continues until the preset termination conditions are met (e.g., reaching the maximum number of generations, population fitness convergence, finding a solution that meets a specific performance threshold, or reaching the preset time budget). Each iteration includes the following sub-steps: Evaluation: Parallelly evaluate the performance of all candidate heuristics in the current population.

[0048] Fitness calculation: Calculate the fitness based on performance metrics.

[0049] Selection: Select parents based on fitness and diversity maintenance mechanisms.

[0050] Generation / Mutation: Construct prompts and call the LLM to generate or mutate offspring programs.

[0051] (Optional) Code processing and verification: Perform syntax checking, interface verification, etc. on the code generated by the LLM.

[0052] Replacement: Update the population.

[0053] Loop until the termination condition is met.

[0054] Output the finally optimized heuristic function code and its performance report.

[0055] Record data throughout the process.

[0056] For the overall architecture and technology selection of the platform of the present invention, refer to Figure 1 (Highlighting each module and its interaction relationships, especially the collaboration between the LLM and EC and the feedback loop) and Figure 3 (For example, the implementation method based on microservices or a specific technology stack (such as Python backend, Web frontend)).

[0057] The present invention preferably adopts a modular architecture to improve the flexibility, maintainability, and scalability of the system.

[0058] Backend core functions: Implemented using the Python language because it has rich scientific computing libraries (such as NumPy, SciPy), deep learning libraries (such as PyTorch, TensorFlow), evolutionary computing libraries (such as DEAP, PyGAD), and path planning libraries (pathfinding, OMPL), etc.

[0059] Heuristic generation and optimization based on LLM: The LLM interface can call commercial APIs (such as OpenAI GPT series, Anthropic Claude series, Google Gemini series) or locally deployed open-source models (such as Llama series, Mistral series, DeepSeek Coder and other models with powerful code capabilities).

[0060] EC framework: Can be customized and developed based on existing EC libraries (such as DEAP) to implement operations such as population management, selection, and replacement of genetic programming (GP), and embed LLM calls into the mutation / crossover link Environment model interface and preprocessing: Load, parse, and extract features using corresponding libraries (such as OpenCV, NumPy, NetworkX) according to the supported environmental data formats (such as raster maps, point clouds, graphs). The generation of environmental context descriptions requires converting the extracted numerical or structured features into a format that is easy for the LLM to understand.

[0061] Platform Scheduling and Control: Implement the platform workflow scheduling logic, manage the data flow and control flow between modules, especially implement the logic of performance feedback to prompt adjustment.

[0062] Path Planning Algorithm Performance Evaluation: Implement or integrate standard path planning algorithms (such as A*, D* Lite), and ensure that the heuristic function part is pluggable, capable of dynamically loading and executing Python code snippets generated by the LLM.

[0063] The parallel computing support module can utilize Python's multiprocessing library, task queues such as Celery, or integrate high-performance computing clusters (such as Slurm).

[0064] Front-end User Interface (such as Figure 4 , displaying functions such as task configuration, process monitoring, and result visualization): Built using a modern web technology stack (such as React, Next.js, DaisyUI with TypeScript), communicating with the backend through RESTful API or WebSocket.

[0065] Data Management: Select a relational database (such as PostgreSQL) or a NoSQL database (such as MongoDB) to store experiment configurations, code, logs, and results.

[0066] Deployment: Use containerization technology (such as Docker) for packaging and deployment to simplify environment configuration and dependency management and ensure consistency.

[0067] Implementation Details of the Automated Heuristic Evolution Module (Interaction of Core Modules 4, 5, 6, refer to Figure 2 , refining each step in the iterative optimization loop) The described module is the technical core of the platform, and its implementation details can be decomposed into the following steps: Step 1: Initialization 1.1 Loading configuration: Read the task configuration from the user interface or configuration file, including: the selected LLM model and its API key / address, the EC framework type (such as GP) and hyperparameters (maximum number of iterations G_max, population size P_size, elitism ratio E_ratio, crossover probability Pc, mutation probability Pm), the target path planning algorithm (such as A*), the performance evaluation protocol (test environment set, performance metrics and their weights), termination conditions (such as reaching G_max or performance convergence), etc.

[0068] 1.2 Environment processing: Invoke the data preprocessing and environment parsing module, load the environment representation data, generate structured environment information, and extract key features to generate an "environment context description" for use by the LLM. For example, for raster map data, the context description can include text or numerical features such as map size, obstacle density, start / end coordinates, and the presence of narrow passages. The final output can be a structured JSON object, for example: { "map_type": "grid", "dimensions": 2, "size": { "width": 100, "height": 50 }, "start": { "x": 5, "y": 10 }, "goal": { "x": 90, "y": 40 } "obstacle_density": 0.25, "presence_of_narrow_passages": "yes" } 1.3 Initializing the population P(0): Generate an initial population containing P_size candidate heuristic programs. The initialization strategy can be diverse: Filling based on templates: Provide one or more basic heuristic function templates (for example, a Python function framework containing state access, target distance calculation, and environment query interfaces), and let the LLM generate initial fills based on the templates and the environment context description; Random generation: If the representation of the heuristic function allows (for example, based on a specific DSL or tree structure), the random tree generation method of GP can be used to create the initial program; Seed heuristic: Include a small number of known standard heuristic functions (such as the implementation code of Manhattan distance and Euclidean distance) as initial seeds; Each individual generated during initialization is a piece of executable Python code. For example: python import numpy as np # environment_info might provide access to map, etc. def heuristic_v1(current_state, goal_state, environment_info): # Simple Manhattan distance dx = abs(current_state['x'] - goal_state['x']) dy = abs(current_state['y'] - goal_state['y']) return dx + dy The population and its metadata (such as source and generation number) are stored in the data management module.

[0069] Step 2: Iterative optimization loop (executed in a loop, t = 0 to G_max - 1 or until other termination conditions are met) 2.1 Evaluation: (Performed by the performance evaluation module, coordinated by the scheduling core, and accelerated by the parallel module) a) For each candidate heuristic program h_i in the current population P(t); b) The control core dynamically loads h_i into a preset path planning algorithm framework (for example, a class implementing the A* algorithm whose heuristic function can be replaced), replacing its default heuristic function; c) The control core instructs the performance evaluation module to execute the path planning task on the N_test test cases defined in the performance evaluation protocol (for example, different test environment instances or different start and end points in the same environment). Using the parallel computing support module, the evaluation of different test cases or different candidate programs is distributed to multiple computing resources for parallel execution; d) Aggregate the detailed performance metrics Metrics_i of h_i over all N_test test cases, such as: average / maximum number of expanded nodes, average / maximum CPU computation time, cost of the found path (length, time, etc.), planning success rate, average / minimum safety distance (for dynamic obstacle scenarios), etc. The performance metrics are stored in association with the corresponding program h_i.

[0070] 2.2 Fitness Calculation: (Performed by the optimization module) a) For each candidate program h_i, calculate its fitness score Fitness_i = FitnessFunc(Metrics_i) according to its set of performance metrics Metrics_i using a predefined fitness function FitnessFunc; b) The fitness function reflects the degree of achieving the goal and can be designed as single-objective (e.g., minimizing the average number of expanded nodes) or multi-objective (e.g., using weighted sum or Pareto ranking to consider efficiency, path cost, and safety simultaneously). The fitness function can also include checks on heuristic properties (such as admissibility, consistency) and impose penalties on programs that violate the properties.

[0071] 2.3 Selection: (Performed by the EC framework within the optimization module) a) Based on the fitness scores {Fitness_i} of all individuals in the current population P(t), apply a selection operator (e.g., tournament selection, roulette wheel selection, fitness proportionate selection, etc.) to select the set of parents Parents(t) for breeding the next generation; b) Implement the elitist retention strategy: Directly copy the individuals with the highest E_ratio proportion of fitness in the current population to the elite set Elites(t + 1) of the next generation population P(t + 1) to ensure that the optimal solution is not lost; c) (Optional) Apply a diversity maintenance mechanism: For example, consider the differences between individuals (code structure differences, behavioral differences, etc.) in the selection pressure calculation, or use novelty search to take the "novelty" of individuals as one of the selection criteria to encourage exploration.

[0072] 2.4 Generation / Mutation: (Performed by the optimization module, calling the LLM) a) Select one or more parent programs h_parent from the set of parents Parents(t) according to a specific strategy (such as fitness-weighted random selection); b) Construct structured prompt information: This step is dynamically completed by the control core according to the current optimization status and goal. The prompt information is a carefully designed text input used to guide the LLM, and its composition includes at least: Task Instruction: Clearly inform the LLM of the goal, e.g., "Please generate an improved heuristic function based on the following parent heuristic function code and its performance feedback, combined with the provided environmental context. The goal is to reduce the number of expanded nodes in path planning while keeping the path cost close to optimal"; Parent Code: The code of the parent program h_parent to be optimized or used as a basis for crossover; Performance Feedback: The fitness score Fitness_parent of h_parent, and possibly key performance metrics Metrics_parent (e.g., "This function expanded too many nodes on test case X"); Optimization Constraints: Soft constraints that need to be satisfied as much as possible during the process, e.g., "Please try to utilize the 'obstacle density' information in the environmental context", "Ensure that the function return value is not less than zero", "Keep the computational complexity of the function as low as possible"; Environmental Context Description: Provide relevant environmental feature information, as shown in Step 1.2: (Optional) Historical Information: May contain brief information on successful or failed modification attempts in previous iterations; (Optional) Code Specification / Template: Remind the LLM to follow a specific function signature or code style; c) Send the constructed Prompt to the configured LLM; d) The LLM generates a new candidate heuristic program code h_child according to the Prompt. The generation process of the LLM can be regarded as a kind of intelligent mutation based on semantic understanding (if based on a single parent) or crossover (if based on information from multiple parents). The certainty and diversity of the generation results can be controlled by adjusting the sampling parameters of the LLM (such as temperature, top-p); e) Repeat a) to d) to generate a sufficient number (e.g., P_size * (1 - E_ratio)) of offspring programs to form the offspring set Children(t).

[0073] 2.5 (Optional) Code Processing and Verification: (Performed by the optimization module) a) For each newly generated program code h_child in the offspring set Children(t); b) Syntax Check: Use the parser of the programming language to check whether the code has syntax errors, and use simple rules or another LLM call to automatically fix simple syntax errors; c) Interface Verification: Perform basic static analysis to check whether it conforms to the predefined interface specifications (e.g., function parameters, return value types); d) Functional testing (optional): Conduct quick functional testing on some simple test cases to eliminate programs that are obviously invalid (e.g., infinite loops, accessing illegal memory) or contain potentially malicious code; e) Package the verified offspring programs into standardized executable objects. Programs that fail verification will be discarded or marked.

[0074] 2.6 Replacement: (Performed by the EC framework within the optimization module) a) Merge the set of verified (or all generated) offspring programs Children(t) with the set of elite individuals Elites(t + 1) retained in 2.3 to form a basic candidate pool; b) Apply replacement strategies (e.g., generational replacement, steady-state replacement, (μ+λ) selection, etc.) to form the next generation population P(t + 1), and ensure that its final size is maintained around P_size.

[0075] If the number of offspring is insufficient (due to verification failures, etc.), supplementary strategies such as re-generation, random generation, or copying some parents can be adopted to maintain the population size P_size.

[0076] 2.7 Termination condition check: a) Check whether the maximum number of iterations G_max has been reached; b) Check whether the best fitness or average fitness of the population has not improved significantly for multiple consecutive generations (detecting a convergence plateau); c) Check whether a solution that meets the user's preset performance threshold has been found; d) If any termination condition is met, exit the loop; otherwise, enter the next generation iteration (t = t + 1).

[0077] Step Three: Output Results 3.1 Optimal result: From the final population P(G_max), select the individual with the highest fitness (or select a representative individual from the Pareto optimal set according to the multi-objective optimization result) as the finally optimized heuristic function program H*.

[0078] 3.2 Result display: Present the code of H* and its detailed performance evaluation report (performance indicators on the test set, comparison with the baseline heuristic, etc.) to the user through the visualization and user interface module.

[0079] 3.3 Result storage: Store the final results and complete experimental records in the data management and experimental record system.

[0080] Example: Optimization of Heuristic Function in a Two-Dimensional Maze Environment 1. Scenario Setting This embodiment aims to demonstrate how to apply the path planning heuristic function generation platform and method (as described in the invention content) disclosed in the present invention, which is based on the collaborative optimization of large language models (LLMs) and evolutionary computing (EC), to solve a classic path planning problem: automatically generate and optimize a heuristic function for the A* search algorithm in a two-dimensional grid maze environment. The maze environment contains complex wall layouts, and there may be structures such as long corridors, dead ends, and U-shaped traps, which pose challenges to the efficiency of heuristic search.

[0081] Objective: Use the platform of the present invention to automatically generate a heuristic function that overcomes the limitations of traditional heuristic design, such as difficulty and poor adaptability. This function should be able to effectively guide the A algorithm to efficiently find the shortest path from the starting point to the ending point in two-dimensional mazes of various complexities. The core measurement criterion is to significantly reduce the number of nodes expanded by the A algorithm (improve search efficiency), while ensuring that the found path is optimal.

[0082] 2. Platform Configuration and Environment Setup (Refer to the Platform Architecture and UI Interface of the Present Invention) 2.1 Task Configuration: The user configures the task through the "Visualization and User Interface Module" of the platform, and its interface example is as Figure 4 shown. According to Figure 4 the content, the specific configuration of this embodiment is described as follows: In the "Environment and Path Planning" setting section, the user selects A* as the target path planning algorithm. The optimization objective (fitness function) is set to minimize the search cost, specifically measured by the number of expanded nodes.

[0083] In the "Heuristic Optimization (EC / Search)" parameter setting section, the following key parameters are configured to guide the collaborative optimization process based on LLMs and EC: Maximum LLM Samples: Set to 20, which limits the total number of times the LLM generates new heuristics during the optimization process.

[0084] Maximum Iteration Count: Set to 100, which defines the upper limit of the main cycle of evolutionary optimization.

[0085] Population Size (EC): Set to 5, indicating the number of candidate heuristic functions maintained during the evolutionary process.

[0086] Timeout: Set to 60 seconds, serving as an additional execution time limit.

[0087] In addition, the LLM model used in this task configuration is deepseek v3. Performance evaluation will be conducted on a predefined set of test environments (50 maze maps with different complexities), and the termination conditions for the entire optimization process include reaching the maximum number of iterations (100 times), reaching the timeout limit (60 seconds), or detecting performance convergence.

[0088] 2.2 Environment Representation and Parsing: Environment representation data: A two-dimensional maze matrix. (Provided by the "environment model interface") Environment model interface: Provides query functions such as is_wall(x, y), etc., to provide standardized environment information for the path planning algorithm.

[0089] Environment context description: The "data preprocessing and environment parsing module" processes the environment data, extracts key features (such as size, density, structure), and generates a structured "environment context description" for use by the "LLM-based heuristic generation and optimization module" when generating prompts to guide the LLM to generate heuristics adapted to the environmental characteristics. For example, the following JSON format description can be generated: { "map_type": "grid", "dimensions": 2 "size": { "width": 30, "height": 30 }, "start": { "x": 1, "y": 1 }, "goal": { "x": 28, "y": 28 } "obstacle_density": 0.4, "structural_features": ["long_corridors", "dead_ends", "u_shaped_traps"], } 3. Automated Heuristic Optimization Process In this embodiment, the platform first initializes based on user configuration and environmental information. This includes invoking the "LLM-based Heuristic Generation and Optimization Module", enabling the configured LLM (such as GPT-4) to generate an initial population P(0) containing a population size of 5 candidate heuristic programs (each containing "thought" and "code") based on a basic template and the "Environmental Context Description". The initialized individuals are executable codes, such as a simple Manhattan distance implementation: import numpy as np # environment_info might provide access to map, etc. def heuristic_v1(current_state, goal_state, environment_info): # Simple Manhattan distance dx = abs(current_state['x'] - goal_state['x']) dy = abs(current_state['y'] - goal_state['y']) return dx + dy Subsequently, the platform enters the core iterative optimization loop managed by the "Experimental Scheduling and Control Core", which continues for multiple generations (up to 100 generations or until the termination condition is met). In each generation of the loop: First is the evaluation, performed by the "Path Planning Algorithm Performance Evaluation Module", which may be accelerated by the "Parallel Computing Support Module". For each candidate heuristic code in the current population, it is loaded into the A* algorithm framework, run on a predefined test maze (which may contain multiple test cases), the average number of expanded nodes is recorded and the path optimality is verified to obtain the performance evaluation results. Then the fitness is calculated. The "LLM-based Heuristic Generation and Optimization Module" calculates the fitness score of each candidate based on the performance metric (number of expanded nodes). Then selection is performed. The EC framework (such as Genetic Programming GP) selects the better-performing parent heuristic algorithms according to the fitness scores (for example, a ranking-based probability selection strategy can be adopted). (Usually, an elitist strategy is combined to retain the best individuals). This process may incorporate a diversity maintenance mechanism to prevent premature convergence. The next step is the LLM-driven generation, performed by the "LLM-based Heuristic Generation and Optimization Module". The system constructs a structured prompt for the selected parents, which includes the task description, the expected output format, the content of the parent heuristic, as well as the key "environmental context description" and performance feedback data. This prompt is sent to the LLM, and the LLM infers and generates a new prompt and its corresponding code. (Diversity can be generated by adjusting LLM sampling parameters such as temperature control). This process consumes one LLM call opportunity (counted in the "maximum number of LLM samples"). Finally, replacement is performed. The EC framework adds the newly generated valid heuristics by the LLM (possibly after merging with the elite individuals) back to the population and updates the population according to the population size limit (set to 5 in this example, as shown in the figure) and the replacement strategy to form the next generation. This evaluation-selection-LLM generation-update loop repeats continuously, driving the heuristic function to evolve towards better performance. The performance of the entire optimization process, such as the change in the best objective function value, is monitored and displayed in real time (as shown by the curve in Figure 4 ). The entire process is recorded by the "Data Management and Experimental Recording System".

[0090] When the preset termination condition is reached (such as reaching the maximum number of iterations, timeout, or performance convergence), the iterative optimization loop ends. The platform selects the heuristic function H*_maze with the lowest fitness (the fewest average number of expanded nodes) and ensuring path optimality from the final population as the optimization result output.

[0091] 4. Performance Evaluation Apply the finally optimized heuristic function H*_maze obtained in step 3 to the A* search algorithm, and conduct a test evaluation on a "maze dataset" containing 10 instances. This evaluation process is executed by the "Path Planning Algorithm Performance Evaluation Module" of the platform. The test results (refer to Figure 5 the "Result Display" section) show that: Success rate of solution: The optimal path was successfully found for all 10 test instances, and the success rate was 100.0%.

[0092] Efficiency of solution: Average number of expanded nodes: 52 nodes.

[0093] Average solution time: 205.60 ms.

[0094] Median solution time: 221.01 ms.

[0095] Detailed analysis: The performance charts in the picture (such as the scatter plot of solution time vs. expanded nodes) can further show the specific performance of this heuristic on a single maze instance.

[0096] Result analysis: These test results indicate that the heuristic function H*_maze automatically optimized and generated by the platform of the present invention exhibits efficient and robust performance on the used maze dataset, and can reliably solve the path planning problem at a relatively low search cost (an average of 52 expanded nodes), reflecting the beneficial effects of the present invention.

Claims

1. A path planning heuristic function generation platform based on the collaborative optimization of large language models and evolutionary computation, characterized in that The platform includes: A visualization and user interface module, which is used to receive user-defined task configuration information, including environment representation data, target path planning algorithm framework type, and evolutionary optimization parameters; the module is also used to monitor the optimization process and display the results; An environment model interface, used to provide standardized environment information required by the path planning algorithm based on the environment representation data; A data preprocessing and environment parsing module, used to process the environment representation data, generate structured environment information, and extract key environment features to construct an environment context description for use by a large language model (LLM); the environment context description includes environment characteristic information for guiding the generation of a heuristic function; The LLM-based heuristic generation and optimization module is configured as follows: representing a path planning heuristic function as an executable program code of a predetermined programming language; initializing and maintaining a population consisting of candidate heuristic program codes; in the iterative process of an evolutionary computing EC framework, using a large language model LLM, based on structured prompt information including at least one selected parent program code, associated performance evaluation data, a preset optimization goal, and a description of the environmental context, generating new candidate heuristic program codes or semantically mutating existing program codes; using the evolutionary computing EC framework, iteratively optimizing the population through a selection operation based on a fitness score, a generation or mutation operation based on an LLM, and a population replacement operation; the EC framework includes a diversity maintenance mechanism for maintaining the diversity of candidate heuristic program codes in the population during the evolution process; A path planning algorithm performance evaluation module, configured as follows: at least one path planning algorithm framework is built-in, and the path planning algorithm framework allows dynamic replacement of the heuristic function program code used by it; according to a predefined performance evaluation protocol, the path planning algorithm framework is executed on the environmental information provided by the environmental model interface, the performance when driven by the candidate heuristic program code in the population is evaluated, and an evaluation result including at least one predefined performance indicator is output; The experimental scheduling and control core is used to coordinate the operation of each module according to the task configuration information, and manage the automated process from environment processing to heuristic generation, evaluation, feedback, and optimization; it feeds back the evaluation results output by the path planning algorithm performance evaluation module to the LLM-based heuristic generation and optimization module to calculate the fitness score of the candidate heuristic program code, guide the selection operation of the EC framework, and influence the construction of subsequent LLM prompt information; Data management and experiment recording system, used for persistent storage of the environment representation data, task configuration information, heuristic program code generated in each evolutionary iteration, performance evaluation log and final optimization results; The parallel computing support module is used to execute multiple performance evaluation tasks in the path planning algorithm performance evaluation module in parallel to accelerate the optimization process.

2. The platform according to claim 1, wherein The large language model LLM is a pre-trained model with code generation and understanding capabilities. The structured prompt information is designed to guide the LLM to generate code that meets the syntactic and semantic requirements of the path planning heuristic function and is specifically improved according to the performance evaluation data, environmental context description, and optimization objectives.

3. The platform according to claim 1, characterized in that, The evolutionary computation EC framework uses genetic programming GP technology to manage and evolve the program code in the population.

4. The platform according to claim 1, wherein The diversity maintenance mechanism is selected from at least one of the following: fitness sharing, novelty search, quality diversity algorithm, niche technology, and island model.

5. The platform according to claim 1, wherein The predefined performance metrics include at least one of the number of expanded nodes, computation time, cost of finding a path, path smoothness, and safety distance from dynamic or static obstacles in the environment during the path planning process.

6. The platform according to claim 1, wherein The path planning algorithm framework is the A* algorithm or its variant D*Lite or a path planning algorithm based on heuristic search.

7. A method for generating a path planning heuristic function based on the collaborative optimization of a large language model and evolutionary computation, applied to the platform described in any one of claims 1 to 6, characterized in that, The method includes the following steps: (a) Receiving user-defined task configurations through the visualization and user interface module, including environmental representation data, the type of target path planning algorithm framework, and evolutionary optimization parameters; (b) Processing the environmental representation data through the data preprocessing and environment parsing module to generate structured environmental information and an environmental context description for use by the large language model LLM; (c) Initializing a population consisting of candidate heuristic program codes through the LLM-based heuristic generation and optimization module; (d) Controlling the execution of the following iterative optimization steps by the experiment scheduling and control core until a preset termination condition is met: (d1) Evaluation: Executed by the path planning algorithm performance evaluation module, accelerated by the parallel computing support module, and evaluating the performance of each candidate heuristic program code in the current population when driving the path planning algorithm framework under a predefined performance evaluation protocol to obtain an evaluation result containing at least one predefined performance metric; (d2) Fitness calculation: Executed by the LLM-based heuristic generation and evolutionary optimization module, calculating the fitness scores of each candidate heuristic program code based on the performance metrics obtained in step (d1); (d3) Selection: Executed by the EC framework, screening the parent program codes for generating the next generation population according to the fitness scores and the diversity maintenance mechanism using a selection strategy; (d4) Generation or mutation: Executed by the LLM-based heuristic generation and evolutionary optimization module, constructing structured prompt information containing the parent program codes, performance evaluation data, optimization objectives, and environmental context description based on the selection result in step (d3), and using the large language model LLM to generate new candidate heuristic program codes or perform semantic mutation on the existing program codes; (d5) Replacement: Executed by the EC framework, updating the population according to the replacement strategy; (e) After the iterative optimization ends, outputting the heuristic program code with the highest fitness or meeting specific criteria from the final population as the optimization result; (f) Storing the corresponding data through the data management and experiment recording system throughout the process.

8. The method according to claim 7, characterized in that, Step (d1) accelerates the parallel execution on multiple independent test cases or simulation environments by using the parallel computing support module.

9. The method according to claim 7, wherein The environment indicates that the data contains static obstacle information and / or dynamic obstacle information.

10. The method according to claim 7, characterized in that, The large language model LLM is a pre-trained large language model for code generation. The evolutionary computing (EC) framework adopts a genetic programming (GP) algorithm. The structured prompt information is dynamically adjusted in step (d4) to reflect the previous performance evaluation results or optimization progress.

Citation Information

Cited By

  • Planetary gearbox fault diagnosis algorithm automatic generation system and method based on large language model

    CN121233973A

  • Planetary gearbox fault diagnosis algorithm automatic generation system and method based on large language model

    CN121233973B

  • Code set generation method and device suitable for language model evolution

    CN121349417A

  • Automatic design optimization method of buffer configuration scheme based on LLM

    CN121615198A

  • An automatic design optimization method for a buffer configuration scheme based on an LLM

    CN121615198B