-
Notifications
You must be signed in to change notification settings - Fork 0
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
General findPath
function
#27
Comments
I don't think #26 is a blocker. But if this function ends up walking, it should definitely set parent pointers as it goes! |
One issue is: you'd expect this function to stop once it finds the requested node. But currently, we assume that if a node has a parent pointer, its descendants also have parent pointers. |
Yeah, maybe we should wait on setting parent pointers here |
Not sure. When we really care we do tend to use |
I am unclear on the usage of this function so can't assess the design
…On Mar 25, 2024, 8:42 PM, at 8:42 PM, Lea Verou ***@***.***> wrote:
Not sure. When we *really* care we do tend to use `force`. Maybe we
should invert `force` and make it be the default behavior of
`updateParents()`.
--
Reply to this email directly or view it on GitHub:
#27 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
One of our use cases is a general
findPath
function, so I wanted to make an issue to discuss design before diving into implementing it. My thoughts are it should be a function like followswhich returns a path of type
Array<string | number>
to get from start to end. The function should attempt to use parent pointers to climb from end to start, but do a BFS/DFS if no parents are set. Before implementing this, we will need to resolve #26 because in a situation like this where parents aren't necessary but helpful, it would be nice to do a console.warn about it (see end of #26)The text was updated successfully, but these errors were encountered: