egui_node_graph icon indicating copy to clipboard operation
egui_node_graph copied to clipboard

change non recurring DFS

Open kkngsm opened this issue 2 years ago • 2 comments

I changed the implementation to non-recurring DFS. This will do the following well.

  1. This implementation does not use recursion, so it does not cause a stack overflow even if the number of nodes is large.
  2. #21

inf

kkngsm avatar Aug 05 '22 16:08 kkngsm

One problem with this approach is that if more than one input receives a single output, it will be stored in a duplicate calculation order list. I'm currently working on a solution to this problem, but have not been able to improve it.

kkngsm avatar Aug 07 '22 06:08 kkngsm

Hi! Many thanks for the PR :) Currently a bit busy but I'll have a look and get back to you soon :+1:

setzer22 avatar Aug 11 '22 10:08 setzer22

Close because this PR has little merit and is getting old. 

kkngsm avatar Sep 17 '22 12:09 kkngsm

I'm sorry you feel that way! I already had a quick look at the changes and I like the overall direction, but to be honest I haven't yet had time to take a proper look at it due to several irl things that have got me quite busy for the past few months.

I've been merging other PRs since, but the scope of this is a bit larger so I wanted to take proper time to review it. My overall feeling was that this change is useful to other users and I was inclined to merge it :+1:

setzer22 avatar Sep 17 '22 18:09 setzer22

Sorry, I didn't word it right. I realized that the infinite loop countermeasure can be done by just adding a little bit of writing to the current state using a recursive function. On top of that, I have decided to build another minimal PR because there is little advantage to a NON RECURRING DFS. I thank @setzer22 for building a great library and of course you can prioritize your day job😊👍.

kkngsm avatar Sep 18 '22 11:09 kkngsm