-
Notifications
You must be signed in to change notification settings - Fork 93
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
Lazy graphs #115
Comments
You can totally create your own graph type that lazily computes neighborhoods. See here for the full list of methods to implement. |
I see thank you for the guidance. I believe that gives me the functionality I would deserve of dynamically creating the graph during search! |
As a follow up, I have created a prototype package for lazy graphs: https://github.com/acxz/SimpleLazyGraphs.jl/ |
Another example of dynamic edge generation is https://github.com/gdalle/GridGraphs.jl |
@gdalle thanks for sharing this package, however, I don't think it solves the issue. I believe I would still need to specify the entire graph, before I pass the graph to the a_star method right? |
Also, would you be willing to incorporate lazy functionality in Graphs.jl? (maybe with a To get astar to work with lazy graphs I have had to add some code in astar to expand the vectors used to keep track of information:
Would it be possible that such functionality can be incorporated inside of Graphs.jl (again maybe wrapped with a is_lazy conditional)? Maybe this is also a consideration for Graphs.jl 2.0? |
In that case yes, but a grid graph is stored as a matrix of vertices, and the connections between these vertices are generated on the fly. It was just meant as an example anyway |
I'm not sure I understand your code. At any rate, potentially reallocating |
As for |
Okay, I had not understood what you meant by "lazy".
I'll take a look at your LazySimpleGraphs.jl package, but in the meantime I'm closing this if that's okay |
I would like to argue this statement. Can we be more specific here? All traversal based algorithms lend themselves well to lazy graphs. This includes any algorithm that requires neighbor information.
the only addition would be changing preallocated arrays to be dynamic and this check could even be done under a
The "graph" as I see it in my head does not change, I have a function that determines the neighbors for any given vertex. However, what if my graph is enormous? Adding neighbors lazily to the Right now there are two workarounds to this issue (want to find shortest path from vertex a -> vertex b using astar (as provided in Graphs.jl), given a, b, and the neighbors of any given vertex)
In fact, you can think of this as a Generator for the Graph. Lazy refers to adding neighbors lazily not retrieving them lazily
That would be wonderful! Please do, I am willing to edit and change much of the code and the necessary things to incorporate a solution to this problem inside of Graphs.jl. |
Hello JuliaGraph!,
Pardon me if this is a very naive question, however, I was looking for an A* implementation in Julia and found the one here in Graphs.jl.
For problems where I know my graph before hand, A* can be easily used since I just define my graph, heuristic and go on my merry way.
However, A* itself doesn't require the complete graph structure, just the neighbors of the current vertex it is expanding from. This is primarily evident if your search space is enourmous. Would it be possible incorporate this feature, where given a user defined neighbor functin, a graph can be dynamically created within a_star? In fact this could be even be seen as a way to generate a graph, rather than just a Path Traversal method.
The text was updated successfully, but these errors were encountered: