Giter Club home page Giter Club logo

pathfinding-lab's Introduction

Pathfinding Laboratory

Docker Image Size Docker Image Version

A playground where you can run, test and compare pathfinding algorithms and heuristic functions.

Visit the website running on DigitalOcean and try it out.

The project is written in ASP.NET Core MVC/Web API and TypeScript. The algorithm part of the project is based on LINQ to A*: a POC about pathfinding algorithms written in C# and used with LINQ expressions.

Features

  • An editable, retro RPG-style map where you can place various obstacles, creating whatever maze you want.
  • Five algorithms and three heuristic functions available for playing with (more to be added).
  • Right-clicking on two positions to find a path (can be undone).
  • An overlay grid with animation to show expanded nodes and depths(levels).
  • A line chart that fully illustrates the evolution of Open List during the process.
  • A code snippet that demonstrates LINQ statement using LINQ to A*.

Build the project

cd src/Heuristic.PathfindingLab/Heuristic.PathfindingLab/
npm i -s d3
npm i -s @types/d3
tsc -p tsconfig.json
dotnet build Heuristic.PathfindingLab.csproj

Build Docker image

cd src/Heuristic.PathfindingLab/Heuristic.PathfindingLab/
docker build -t pathfinding-lab .

Run Dockerized instance

docker pull rvhuang/pathfinding-lab:latest
docker run -d -p 8080:80 pathfinding-lab:latest --name p-lab

License

Copyright © Robert Vandenberg Huang

The project is licensed under the MIT license. Feel free to copy, modify and use it in your computer science homework (grades not guaranteed).

pathfinding-lab's People

Contributors

rvhuang 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

Watchers

 avatar  avatar  avatar  avatar  avatar

pathfinding-lab's Issues

Obstacle Erase Button

Add a new button that allows users to erase obstacles only instead of the entire map.

Data Import and Export

Add new options and APIs that enable users to import and export map data and pathfinding histories.

Tile Highlighting

Highlight the corresponding tile when the mouse cursor moves to a node on the Open List Analysis chart.

Statistic Area

Add a descriptive area that shows the number of nodes the algorithm has explored and the number of nodes it has estimated.

Share Link

Add the following optional parameters to the query string that can pre-select the algorithm and heuristic functions.

  • algorithm (the algorithm's short name in lower case)
  • heuristic (the function's initial letter in lower case)
  • path to find
  • obstacles

Example:

https://pathfinding-lab.codedwith.fun/?o=2,[12,13,16];3,21;4,28&p=astar1,21-12,17m,e;bfs13,2-12,15c

This will perform the following works:

  1. Place obstacles on (2, 12), (2, 13) and (2,16), then place obstacles on (3, 21) and (4, 28).
  2. Find a path between (1, 21) and (12, 17) using A* as search algorithm and combining Manhattan distance and Euclidean distance as the heuristic function.
  3. Find a path between (13, 2) and (12, 15) using Best-first search algorithm and Chebyshev distance.

HTML Sample for Embedding

Add an <iframe> HTML sample to share dialog which the width and height will change to current map settings accordingly.

Undo Button

Add a new button that allows users to undo the latest pathfinding result.

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.