Sitelet https://github.com/dojoengine/origami/pull/119
Skip to content

Feature/dijkstra pathfinding - #119

Merged
bal7hazar merged 5 commits into
dojoengine:mainfrom
JJScar:feature/dijkstra-pathfinding
Jan 30, 2025
Merged

bal7hazar merged 5 commits into
dojoengine:mainfrom
JJScar:feature/dijkstra-pathfinding

Conversation

@JJScar

@JJScar JJScar commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

Introduced changes

This PR adds the Dijkstra pathfinding algorithm to the Origami Map crate. It includes:

  • The Dijkstra algorithm implementation.
  • Comprehensive tests to validate the algorithm's correctness.
  • Comparisons with the existing A* algorithm to ensure results are consistent.

Checklist

  • Issue [Feature]: Dijkstra pathfinding algorithm #98
  • The Dijkstra.cairo is similar to the Astar.cairo file so it is easy to navigate. The code is clearly commented and documented. No need for a separate README. I can add one need be.
  • Tests are implemented in the added Cairo file Dijkstra.cairo. I will add the some libs are not yet ready, I ran into many issues when running tests.
  • No dedicated CI job added, as existing workflows already run all tests.

@glihm

glihm commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

cc @bal7hazar on this one if you have the time to look at it. I'll make a review during the week otherwise. 👍

@bal7hazar

bal7hazar commented Jan 30, 2025 •

Copy link
Copy Markdown
Collaborator

Few modifications:

  • Remove the inner loop to save some gas and closer to other finder algorithms
  • Use the shared Finder::check algo (also cleaned the one in A*)
  • Added the new algo to the package (to include in lib.cairo) and fix the tests

Thank you for the contribution @JJScar and sorry for the delay on review

@bal7hazar
bal7hazar merged commit 4d6a98e into dojoengine:main Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants