Comments (6)
Very good work! please provide a Pull Request!
from python-pathfinding.
@brean, PR is created please review. Please note if we want to make it even faster the whole thing would need to be rewritten with numba in mind.
from python-pathfinding.
I am not sure about numba, the idea of python-pathfinding was to be as little dependent on other libraries as possible, with education in mind, for performance I would probably go with a c++ wrapper in the first place.
Yeah I agree.
However, with currently over 260 projects using python-pathfinding according to github, I think many of these might benefit from a numba-version, I am unsure how we can provide both.
It would require a rewrite and lots of testing. Numba class support is in beta last I checked.
A numba-version would probable be its own pathfinding-library and we can close this issue.
Yeah I agree too.
Thanks for getting this reviewed and merged so quickly.
from python-pathfinding.
PS: we really need to remove nsmallest from the implementation as that requires looping through the whole open_list which kind of defeats the purpose of using a heapq in the first place.
I see why nsmallest is being used though. The reason is the open_list.remove which invalidates the heap. I read your suppose to heapify to make the heap valid again right after the remove.
An alternative approach maybe to just put the things you want to remove into a dict and when you pop you check the dict to see if it exists in it. If it does you ignore it.
Let me know if you want me to create a PR for both issues.
I noticed the above change also changes the result but the path actually looked at lot better. I am not entirely sure why though, it could be because because if the f value is the same you get a different order than above tuple value.
from python-pathfinding.
Alright this will take some time. Ran the tests and there lots of failures to go through.
from python-pathfinding.
merged. Thanks a lot!
I am not sure about numba, the idea of python-pathfinding was to be as little dependent on other libraries as possible, with education in mind, for performance I would probably go with a c++ wrapper in the first place.
However, with currently over 260 projects using python-pathfinding according to github, I think many of these might benefit from a numba-version, I am unsure how we can provide both.
A numba-version would probable be its own pathfinding-library and we can close this issue.
from python-pathfinding.
Related Issues (20)
- Show only adjacent path, not diagonal HOT 5
- Implement Tunnel Discovery for Puzzle Path Planning
- Switch to another CI
- Measure time and show stats
- Add elevators/ladders, steps and portals HOT 2
- switch from tox/travis/coveralls to github actions HOT 1
- Performance and benchmark discussion
- Path smoothening and optimization tools and documentation
- 3D-pathfinding
- Slow Pathfinding for Larger Matrices HOT 1
- New Type Hint Breaking previous Python3 versions HOT 2
- Is it possible to avoid getting too close to a non walkable cell ? HOT 2
- Typo in CONTRIBUTING.md?
- On names and parameter orders of coodinates HOT 1
- Bug when edges are defined from the end HOT 1
- Correctness on :Advent of Code problem HOT 4
- find_path() giving me complex output rather than list of tuples HOT 5
- How to favor path with less turns? (A*) HOT 4
- Grid does not allow an algorithm to make a diagonal crossing over a border HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-pathfinding.