Skip to main content

Abstract

Path planning is a fundamental scientific problem in robotics and autonomous navigation, requiring the derivation of efficient routes from starting to destination points while avoiding obstacles. Traditional algorithms like A* and its variants are capable of ensuring path validity but suffer from significant computational and memory inefficiencies as the state space grows. Conversely, large language models (LLMs) excel in broader environmental analysis through contextual understanding, providing global insights into environments. However, they fall short in detailed spatial and temporal reasoning, often leading to invalid or inefficient routes. In this work, we propose LLM-A*, an new LLM based route planning method that synergistically combines the precise pathfinding capabilities of A* with the global reasoning capability of LLMs. This hybrid approach aims to enhance pathfinding efficiency in terms of time and space complexity while maintaining the integrity of path validity, especially in large-scale scenarios. By integrating the strengths of both methodologies, LLM-A* addresses the computational and memory limitations of conventional algorithms without compromising on the validity required for effective pathfinding.

Directory Structure

.
└── dataset
└── env
    └── search
└── model
    ├── chatgpt
    └── llama3
└── pather
    ├── astar
    └── llm_astar
└── utils

⏬ Installation

pip install llm-astar

🚀 Quick Start

import openai
openai.api_key = "YOUR API KEY"

from llmastar.pather import AStar, LLMAStar
query = {"start": [5, 5], "goal": [27, 15], "size": [51, 31],
        "horizontal_barriers": [[10, 0, 25], [15, 30, 50]],
        "vertical_barriers": [[25, 10, 22]],
        "range_x": [0, 51], "range_y": [0, 31]}
astar = AStar().searching(query=query, filepath='astar.png')
llm = LLMAStar(llm='gpt', prompt='standard').searching(query=query, filepath='llm.png')

📝 Citation

If you found this work helpful, please consider citing it using the following:

LLM-A*: Large Language Model Enhanced Incremental Heuristic Search on Path Planning
Silin Meng, Yiwei Wang, Cheng-Fu Yang, Nanyun Peng, Kai-Wei Chang

💫 Showcase


🪪 License

MIT. Check LICENSE.

Downloads PyPI - Version

Metadata

Release files for llm-astar 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-astar 0.1.4
File Size Uploaded
llm_astar-0.1.4.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-astar 0.1.4
File Interpreter ABI Platform
llm_astar-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / llm_astar-0.1.4.tar.gz

Download URL llm_astar-0.1.4.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12cd596527542841a6389f502e32b6a8859744f04f6d7a9c79a65b55a65bd371
BLAKE2b-256 checksum
How to use checksums
022683ca94354c5092980f7b4b3fd364fa4eca03953a34eb6107157ec9a93e65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release files / llm_astar-0.1.4-py3-none-any.whl

Download URL llm_astar-0.1.4-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d387d14d4592f6db8c4c1b88fc2c39850aaf9d1438f13735f3edec20b21f2e8b
BLAKE2b-256 checksum
How to use checksums
a624ba0f4122ab352468d11ebb777668284097b2c49a1315a9aa14562c0a9497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page