-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks in advance #8
Comments
Can you share a minimal piece of code that demonstrates what you want to accomplish? |
Sure. ... where Mxy holds the tiles that are differently placed in both states, and Gxy is just an empty array with same dimensions. It works okay, but as n grows it takes more time. And i have defined a linear conflict function, that needs to calculate manhattan distance first. I want to speed things up a little bit. |
Have you tried browsing the unit tests of the |
Actually no, but what should i do? Look through to see if any function is of interest to my approach? |
Yeah. I'm afraid I'm not too sure how to deal with your example code. Hopefully @EelcoHoogendoorn can answer your question directly. |
ok thanks! |
Actually, do you mind providing an example input & output, so I can test my solution? I might be able to figure it out. |
This is kind of what i want: I would like to know the index for every element of the current state in the goal state, in some sort of vectorized way that involves no looping. So i would expect getting: |
Hi; There are various graph-like algorithms that you can reasonably efficiently implement using the techniques in this library; at least compared to any python for loops; but its not going to be very fast, compared to the very optimized graph libraries available in python for A* specifically. But certainly interesting as an exercise in vectorized graph algorithms. It is not clear to me what the code you posted thus far is trying to accomplish though; as per stackoverflow, a self-contained example would help a lot. Speaking of which; its a better format for these type of questions. |
Ah posted that last comment without refreshing my page; thats a lot more of a self-contained problem! Indeed you could do something like:
on a higher level, I really doubt this is the most efficient way to approach A* using numpy_indexed though... |
ok thank you very much! |
Hey guys!
I have used you indexing function indices(). Works great!
One question though, is there any way to use it for a 2 dimensional array?
The text was updated successfully, but these errors were encountered: