GithubHelp home page GithubHelp logo

tubo213 / py-lacam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kei18/py-lacam

0.0 0.0 0.0 1.59 MB

Minimal Python implementation of LaCAM* for MAPF

Home Page: https://kei18.github.io/lacam/

License: MIT License

Python 100.00%

py-lacam's Introduction

py-lacam

MIT License CI

A minimal Python implementation of LaCAM* (lazy constraints addition search) for Multi-Agent Path Finding (MAPF).

Description

LaCAM* is a graph pathfinding algorithm to solve MAPF. With the effective use of other MAPF algorithms, such as PIBT, LaCAM can achieve remarkable scalability (e.g., for 10k agents), while maintaining nice theoretical guarantees.

  • Okumura, K. LaCAM: Search-Based Algorithm for Quick Multi-Agent Pathfinding. AAAI. 2023. [project-page]
  • Okumura, K. Improving LaCAM for Scalable Eventually Optimal Multi-Agent Pathfinding. IJCAI. 2023. [project-page]
  • Okumura, K. Engineering LaCAM*: Towards Real-Time, Large-Scale, and Near-Optimal Multi-Agent Pathfinding. AAMAS. 2024. [project-page]

The original references use PIBT as a submodule, which makes the implementation a bit complicated. Here, I provide a much simpler implementation by replacing PIBT with random action selection. While this is not at all effective from a performance perspective, it can highlight the simple (and beautiful imo) structure of the algorithm and also can help understand the underlying concept.

Feel free to use/extend this repo!

News

  • 13 Jan. 2024: A simple implementation of LaCAM with PIBT is now available. It is scalable. Check this branch.

Setup

This repository is based on Poetry. After cloning this repo, run the following to complete the setup.

poetry config virtualenvs.in-project true && poetry install

Demo

poetry run python app.py -m assets/tunnel.map -i assets/tunnel.scen -N 4 --time_limit_ms 5000 --verbose 2

The result will be saved in output.txt. The grid maps and scenarios follow the format of MAPF benchmarks.

Visualization

You can visualize the planning result with @Kei18/mapf-visualizer.

mapf-visualizer ./assets/tunnel.map ./output.txt

demo

without refienment

When you need just a suboptimal solution, try:

poetry run python app.py -m assets/tunnel.map -i assets/tunnel.scen -N 2 --no-flg_star

Jupyter Lab

Jupyter Lab is also available. Use the following command:

poetry run jupyter lab

You can see an example in notebooks/demo.ipynb.

Licence

This software is released under the MIT License, see LICENSE.txt.

Notes

py-lacam's People

Contributors

kei18 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.