Giter Site home page Giter Site logo

gunjankadu / pathfindingvisualizer Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 8.19 MB

An application to Visualize various pathfinding algorithm using React.js

Home Page: https://gunjankadu.github.io/PathFindingVisualizer/

HTML 2.97% CSS 12.89% TypeScript 84.14%
react typescript react-hooks dijkstra-shortest-path bellman-ford-algorithm bfs-algorithm dfs-algorithm recursive-algorithm recursive-division graph

pathfindingvisualizer's Introduction

Path Finding Visualizer

Live at - https://gunjankadu.github.io/PathFindingVisualizer/

This project is live visualiztion of the famous path finding algorithms.


Gif

Algorithms Included

  • * Dijkstra
  • * Bellman-Ford
  • * DFS
  • * 0-1 BFS
  • Features

    Selecting an Algorithm and Running the Visualizer

    You can select a path algorithm using the Algorithms dropdown menu from the navbar. The starting node for the algorithm is represented by the green node on the graph and the end node is represented by the red node. You can alter the positions of the starting and ending nodes, by clicking and dragging them. Any changes to the starting and ending node's locations will persist until the "Clear Board" button is pressed. Once an algorithm is selected you can visualize the algorithm by pressing the "Visualize It!" button. Doing so will change the color of nodes on the graph in the order they are visited. Once the end node is reached the shortest path will be displayed in yellow. Buttons will be disabled for the majority of the animation process.

    Weighted Graphs and Non-Weighted Graphs

    The app will automatically generate edge weights for algorithms that are meant for weighted graphs. These edge weights represent the distance to travel to that node from its neighbors, and are displayed in the center of each node. In the case of this app neighbors are considered to be those nodes directly next to the current node in the four main directions: up, down, left, right. If the algorithm does not need these weights none will be generated, and a "0" will be displayed.

    Building Walls

    You can build walls to eliminate some nodes from the graph. To do so simply click on a node in the graph and it will change colors to black, signifying that it is now a wall. You can click your mouse, hold it and drag it in order to create larger walls. Clicking, or dragging your cursor over, existing walls will turn those walls back to normal nodes.
    Any walls built will persist through algorithm changes, weight changes, and visualizations. To remove walls you will need to use the "Clear Board" button.

    Generating Mazes

    Currently there are two maze algorithms implement: random walls and the recursive division. The random walls method generates a random number in the range [0, 1) for each node. Based on this number the node is transformed to a wall. The recursive division method follows the basic recursive division algorithm with one difference. The difference is that instead of generating a single passage in each wall here we generate multiple. This allows for mulitple paths between the start and end node instead of just a single path.

    Changing Speed

    This setting adjusts the animation speed of the app. There are three settings: "Slow", "Average", and "Fast." The default setting is "Fast."


    Made Using

    • React
    • TypeScript - Strongly Typed No JS
    • [CSS Animations] - Animation Effect

    Build Guide

    git clone https://github.com/GunjanKadu/PathFindingVisualizer.git
    cd Pathfinding-Visualizer
    yarn install
    yarn start

    pathfindingvisualizer's People

    Contributors

    gunjankadu avatar

    Stargazers

     avatar  avatar  avatar

    Watchers

     avatar  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.