Giter Site home page Giter Site logo

balcilar / multi-robot-path-planning-on-graphs Goto Github PK

View Code? Open in Web Editor NEW
90.0 2.0 22.0 151 KB

Multi-Robot Path Planning on Graphs Solution by A* algorithm

License: Apache License 2.0

MATLAB 100.00%
puzzle-solution robotics multirobot path-planning matlab robot graph

multi-robot-path-planning-on-graphs's Introduction

Multi-Robot Path Planning on Graphs

We study the problem of optimal multi-robot path planning on graphs (MPP) over the makespan (last arrival time) criteria. We implemented A* search algorithm to find solution. In an MPP instance, the robots are uniquely labeled (i.e., distinguishable) and are confined to an nxn squared connected graph. The robots may move from a vertex to an adjacent one in one time step in the absence of collision, which may occur when two robots simultaneously move to the same vertex or along the same edge in different directions. A distinguishing feature of our MPP formulation is that we allow robots on fully occupied cycles to rotate synchronously.

Let G = (V, E) be a connected, undirected, simple graph, with V = {vi} being the vertex set and E = {(vi, vj )} the edge set. Let R = {r1, . . . , rn} be a set of n robots. The robots move at discrete time steps (i.e., at t = 0, 1, . . .). At time step t = 0, each robot occupies a distinct vertex of G. In general, at any time step t = 0, 1, . . ., the robots assume a configuration that is an injective map from R to V . The start (initial) and goal configurations of the robots are denoted as xI and xG, respectively. Following figure shows a possible configuration and its possible goal configuration of 9 robots on a 3 × 3 grid graph.

Alt Text

During a discrete time step, each robot may either remain stationary or move to an adjacent vertex. To formally describe a plan, let a scheduled path be a map pi : Z+ → V , in which Z+ := N ∪ {0}. A scheduled path pi is feasible if it satisfies the following properties:

    1. pi(0) = xI (ri).
    1. For each i, there exists a smallest ti ∈ Z+ such that pi(ti) = xG(ri).
    1. For any t ≥ ti, pi(t) ≡ xG(ri).
    1. For any 0 ≤ t < ti , (pi(t), pi(t + 1)) ∈ E or pi(t) = pi(t + 1) (if pi(t) = pi(t + 1)

robot ri stays at vertex pi(t) between the time steps t and t + 1). We say that two paths pi, pj are in collision if there exists k ∈ Z+ such that pi(t) = pj (t) (meet collision) or (pi(t), pi(t + 1)) = (pj (t + 1), pj (t)) (head-on collision).

Solution

To solve above problem, we implemented A* algorithm to find optimum route from given initial 3x3 robot positions and desired 3x3 robot positions. First algorithm starts to construct graph, whose connections shows possible movement. Then we extented it as time based graph. According to time extented graph, all nodes are dublicated for every single of time step. That means, if we have 3x3 node for given example, we will have 3x3xts number of node in our time expanded graph. We set it ts=7 for our demo which means algorithm just search optimal solution up to 7 time step. Every node in t layer has connection to its own node in (t+1) layer but it has connection to one step far nodes in (t+1) layer as well.

Result

You can define your own start and end positions of all 9 robot repectively. For instance here is the demo's starting and end positions.

sp=[3 5 6 2 9 7 8 4 1];
ep=[1 2 3 4 5 6 7 8 9] + ngrid*ngrid*(ts-1);

You should define all 9 robots start position with sp vector. !st elemnet show 1st robot position, 2nd element show 2nd robot position. So as given vector, 1st robot stay on 3th cell, 2nd robot stay on 5th cell, as how it was in above figure.

You can run all demo with following command.

> main

Then you will take following results for given start and end positions.

Alt Text

Reference

[1] Yu, Jingjin, and Steven M. LaValle. "Optimal multirobot path planning on graphs: Complete algorithms and effective heuristics." IEEE Transactions on Robotics 32.5 (2016): 1163-1177.

multi-robot-path-planning-on-graphs's People

Contributors

balcilar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

multi-robot-path-planning-on-graphs's Issues

a question about code error

Hello,sir!
I downloaded your program and ran it in MATLAB. But it appears the error shown in the picture and I can't solve it. Do you know the cause of the error? Thank you very much!

image

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.