Skip to content

Find the shortest path and the least number of turns between two squares in a grid

Notifications You must be signed in to change notification settings

ouiam-dot/optimized-path-finder

Repository files navigation

Demo:

Demo

Overview

The aim of this web application is to:

  • Find the shortest path between two squares/points in a grid.
  • Find the least number of turns on a path.
  • Avoid walls(Non walkable squares/points) on a path.
  • Visualize all paths.

Quick start

In the project directory, you can run:

npm install 

Then:

npm start

How it works

stack

The application is:

  • boostraped with Create React App.

  • automately deployed and hosted to Firebase hosting: CI/CD (Continuous Integration/ Continuous Deployment) pipeline using GitHub actions.

  • calling the path finder algorithm through firebase cloud functions.

The path finder algorithm is composed of:

Step1: Find at least 4 of the shortest paths:

    Use different famous algorithms:
    *  `AStarFinder` *
    *  `DijkstraFinder` *
    *  `BreadthFirstFinder` *
    *  `BiBreadthFirstFinder` *
    *  `BiDijkstraFinder` *
    *  `IDAStarFinder.js` *
    *  `JumpPointFinder` *
    *  `OrthogonalJumpPointFinder` *

Note: These algorithms were implemented using the path finding library for js. Library

Step 2: Smoothening process( Find the shortest path with minimal turns)

    1.  The algorithm takes the array of paths returned by the first step.

    2.  Find the path with minimal turns. 

The path finder algorithm: the algorithm's gist

License

MIT License

About

Find the shortest path and the least number of turns between two squares in a grid

Resources

Stars

Watchers

Forks

Packages

No packages published