Hey all, could really use your expertise in determining if what i need here is a tree… and how i would go about doing that
At the moment my code basically determines out the difference of all trades between currencies.
c.Ai represents the name of a currency, example USD or EUR, represented numerically.
Lets say i have a 10 currencies
[1,2,3,4,5,6,7,8,9,10]
The code below takes all of my exchanges and computes the grand total difference.
for (Δ, Λ, c) in zip(r.Δs, r.Λs, r.exchanges)
difference[c.Ai] += Λ - Δ
end
an example result:
[ 100, 0, 4, 50, 70000, 450, 20, 1, 42, .01 ]
coinciding to the final output of currency 1 - 10
What i need to do is instead of grab just total difference, id like to be create a path of what was exchanged. Tracking more or less what my loop is doing
ex
[1,2...10]
3 7 5
6 1 8
2 4 9
basically a tree i think? Essentially say from currency 10, user converted to 5 then 8 then 9. Id also like to like highlight in the event a user took a currency and split it into more than one currency, ex:
[1,2......10]
3 7 5
6 1 8 4
2 4 9 3
which is makes me think a tree is valid here. Is there a smart clear cut way to accomplish this in Julia without introducing a ton of code debt weighing me down? Similar to how i have the for loop that just rips through the zip for totals?
Can trees store multi values? Like in addition to the path, also the difference at each step?
extra question out of curiosity:
was doing some research on for loops with multi threads for enhanced speed, or GPU based Arrays with CUDA - should i look into multi thread here?