4 reputation
4
bio website starlogic.nl
location
age
visits member for 2 years
seen Feb 20 at 15:38

Feb
11
awarded  Commentator
Feb
11
comment algorithm to extract “possibilities” from a tree
So I have a recursive function on a node, that returns a list of nodes containing all possibilities on that node: - If the node contains multiple variants to be combined, the returned list contains the cartesion product, - If not then the list contains the tuples, which is the end result So at the top level the tuples are already combined.
Feb
11
awarded  Scholar
Feb
11
comment algorithm to extract “possibilities” from a tree
A vote I can not give, I lost my reputation posting something with code. I did accept it as the answer, because this answer gave me the best push in programming a solution
Feb
11
accepted algorithm to extract “possibilities” from a tree
Feb
11
comment algorithm to extract “possibilities” from a tree
thank you for your answer, I'll try to re-formulate the question after solving this problem in code ("to truly understand a problem you first have to solve it"). I am wrapping my head around your solution, and will try to use it in a piece of code later. I'll get back to it. Thanks again.
Feb
9
comment algorithm to extract “possibilities” from a tree
I tried to keep any language specifics out of it. Have no clue where to start explaining without some sort of sample. But, I guess this is part of an implementation issue and therefor not suitable for programmers.stackexchange.
Feb
9
revised algorithm to extract “possibilities” from a tree
added 236 characters in body
Feb
9
comment algorithm to extract “possibilities” from a tree
@david.pfx the catch is in de asterisk *, that is the rule to mark nodes to make variants with. I'll try to edit the question to make this more clear.
Feb
9
revised algorithm to extract “possibilities” from a tree
added 1 characters in body
Feb
9
answered algorithm to extract “possibilities” from a tree
Dec
25
comment algorithm to extract “possibilities” from a tree
@msell although there aren't any requirements really, I'll try and go formulate some thoughts. Non-solvable would be an answer too :).
Dec
25
comment algorithm to extract “possibilities” from a tree
@DanielKaplan I have edited the example to contain more layers
Dec
25
comment algorithm to extract “possibilities” from a tree
Thanks! The idea is to eventually end up with a tree with thousands of nodes within dozens of levels, so probably only the nodes with multiple choices would have to be defined in the grammar then to generate the subsets of possibilities
Dec
25
revised algorithm to extract “possibilities” from a tree
edited body
Dec
25
awarded  Editor
Dec
25
revised algorithm to extract “possibilities” from a tree
Extended the example to a third level
Dec
24
comment algorithm to extract “possibilities” from a tree
Ah, would that mean you would loop all the children first, before going further down the leaves?
Dec
24
comment algorithm to extract “possibilities” from a tree
they would be treated as the third level I guess, so if "heavy box" would have childs "small" and "large", there would be 6 new trees in total to be generated... that's the difficult part, that's why I am stuck :)
Dec
24
awarded  Student