Giter Site home page Giter Site logo

bala4krish / mind_your_path Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 188 KB

C++ implementation of A-Star path planning algorithm

License: MIT License

C++ 11.15% Jupyter Notebook 88.85%
path-planning astar-pathfinding astar-search-algorithm astar-algorithm astar-search

mind_your_path's Introduction

Mind_Your_Path

C++ implementation of A-Star path planning algorithm

Credit

  1. Stanford lecture notes - http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html
  2. Medium article - https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2

Algorithm

Initialize both open and closed list
    let the openList equal empty list of nodes
    let the closedList equal empty list of nodes

Add the start node
    put the startNode on the openList (leave it's f at zero)

Loop until you find the end
while the openList is not empty
    // Get the current node
          let the currentNode equal the node with the least f value
          remove the currentNode from the openList
          add the currentNode to the closedList
    // Found the goal
          if currentNode is the goal
                Congratz! You've found the end! Backtrack to get path
    // Generate children
          let the children of the currentNode equal the adjacent nodes

    for each child in the children
        // Child is on the closedList
          if child is in the closedList
                continue to beginning of for loop
        // Create the f, g, and h values
          child.g = currentNode.g + distance between child and current
          child.h = distance from child to end
          child.f = child.g + child.h
        // Child is already in openList
          if child.position is in the openList's nodes positions
                if the child.g is higher than the openList node's g
                      continue to beginning of for loop
        // Add the child to the openList
          add the child to the openList

Sample Output

Future Work

Implementing a live skecth of the exploration of nodes and the evolution of optimal path when found over the grid with obstacles using Python and OpenCV.

mind_your_path's People

Contributors

bala4krish avatar

Stargazers

 avatar

Watchers

 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.