Table of Contents
Fetching ...

Constraint-aware Path Planning from Natural Language Instructions Using Large Language Models

Dylan Shim, Minghan Wei

Abstract

Real-world path planning tasks typically involve multiple constraints beyond simple route optimization, such as the number of routes, maximum route length, depot locations, and task-specific requirements. Traditional approaches rely on dedicated formulations and algorithms for each problem variant, making them difficult to scale across diverse scenarios. In this work, we propose a flexible framework that leverages large language models (LLMs) to solve constrained path planning problems directly from natural language input. The core idea is to allow users to describe routing tasks conversationally, while enabling the LLM to interpret and solve the problem through solution verification and iterative refinement. The proposed method consists of two integrated components. For problem types that have been previously formulated and studied, the LLM first matches the input request to a known problem formulation in a library of pre-defined templates. For novel or unseen problem instances, the LLM autonomously infers a problem representation from the natural language description and constructs a suitable formulation in an in-context learning manner. In both cases, an iterative solution generation and verification process guides the LLM toward producing feasible and increasingly optimal solutions. Candidate solutions are compared and refined through multiple rounds of self-correction, inspired by genetic-algorithm-style refinement. We present the design, implementation, and evaluation of this LLM-based framework, demonstrating its capability to handle a variety of constrained path planning problems. This method provides a scalable and generalizable approach for solving real-world routing tasks with minimal human intervention, while enabling flexible problem specification through natural language.

Constraint-aware Path Planning from Natural Language Instructions Using Large Language Models

Abstract

Real-world path planning tasks typically involve multiple constraints beyond simple route optimization, such as the number of routes, maximum route length, depot locations, and task-specific requirements. Traditional approaches rely on dedicated formulations and algorithms for each problem variant, making them difficult to scale across diverse scenarios. In this work, we propose a flexible framework that leverages large language models (LLMs) to solve constrained path planning problems directly from natural language input. The core idea is to allow users to describe routing tasks conversationally, while enabling the LLM to interpret and solve the problem through solution verification and iterative refinement. The proposed method consists of two integrated components. For problem types that have been previously formulated and studied, the LLM first matches the input request to a known problem formulation in a library of pre-defined templates. For novel or unseen problem instances, the LLM autonomously infers a problem representation from the natural language description and constructs a suitable formulation in an in-context learning manner. In both cases, an iterative solution generation and verification process guides the LLM toward producing feasible and increasingly optimal solutions. Candidate solutions are compared and refined through multiple rounds of self-correction, inspired by genetic-algorithm-style refinement. We present the design, implementation, and evaluation of this LLM-based framework, demonstrating its capability to handle a variety of constrained path planning problems. This method provides a scalable and generalizable approach for solving real-world routing tasks with minimal human intervention, while enabling flexible problem specification through natural language.
Paper Structure (10 sections, 5 figures, 1 table)

This paper contains 10 sections, 5 figures, 1 table.

Figures (5)

  • Figure 1: Challenges in applying existing path planning algorithms to practical requests
  • Figure 2: Overview of a two pathway method capable of solving a natural language path planning problem. An LLM first analyzes the natural language path planning input to find a matching case from a pre-generated path planning case library, then solves the routing problem using a structured prompt from the library. For instances where there is no matching case from the library, the LLM self-generates a structured prompt to solve the problem. Multiple solutions are produced before selecting the most optimal solution as the final output.
  • Figure 3: A pre-formulated structured prompt example stored within the path planning case library. This prompt is used to assist an LLM in solving the first path planning problem type, the basic TSP problem.
  • Figure 4: Solutions for a three-day trip to 10 cities with distinct depot cities per day (problem type 3). (a) shows a suboptimal route generated without iteration. (b) shows a better route obtained using iterative refinement.
  • Figure 5: Example routed solutions for four constrained path-planning problem types generated by an LLM: problem type 1 (top left), problem type 2 (top right), problem type 3 (bottom left), and problem type 4 (bottom right) are highly optimal routes with corresponding travel costs for a problem case of each problem type.