Hey all, I got a fun challenge for purposes of dat...
# coroutines
t
Hey all, I got a fun challenge for purposes of data science and operations research problems. Is there a way to parallelize this binary tree traversing problem? I have tried to use coroutines but I frequently run into two problems: 1) Waiting for the entire search to complete 2) Memory issues for larger values of
treeRowCount
. Thoughts on an implementation?
v
How do you get the values you are optimizing agains? Can I assume you have a (pure) function
(Node) -> Double
which calculates a value for each node on the fly and you are looking for a minimum ?
t
@voddan it's a bit more of a shared state strategy where the current minimum is checked and accessed across each node iteration I got this problem fixed and running in a few seconds on a single thread. Turns out I didn't make my sort greedy, which was critical to reduce the search space quickly. I'll send you the code later if you're interested.
v
Yes I am interested) Please send the code if it is not a big trouble
My concern was about where you get your input from. Normally each node has a value (weight), provided from outside the system. But here you explained that you don't keep the nodes in memory, so I was wondering how you get the weights to different threads