Skip to content

Recursive DFS Backtracking Algorithm with visualization

Notifications You must be signed in to change notification settings

egemengulpinar/DFS-with-Pygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

DFS-with-Pygame

This repo solves the question below creating with Pygame animation. We found all possible ways to ending square and display it on the Pygame UI

Question

You are given an m × n integer array grid where grid [i][j] could be:

  • 1 representing the starting square. There is exactly one starting square.
  • 2 representing the ending square. There is exactly one ending square.
  • 0 representing empty squares we can walk over.
  • -1 representing obstacles that we cannot walk over. Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once.
Ekran.Kaydi.2023-07-04.21.13.53.mov

Usage

Before running the main code, you can give specific 2D matrix.

python main.py

Contributing

Feel free to contribute. I am working on creating a WebAssembly script that will enable displaying output in the browser. In next, I will add other path-finding and search algorithms with animations.

Releases

No releases published

Packages

No packages published

Languages