Michael Haufe (\"TNO\")
1/26/2015 4:49:00 PM
On Monday, January 26, 2015 at 9:29:56 AM UTC-6, jonas.t...@gmail.com wrote:
> If i have full period permutation algorithm for x nodes, is there a way to make a node pairing algorithm from it without to much work?
>
> I want to write all possible branch structures using x nodes and y branches.
> But it seem i have to store how many nodes already connected to the graph.
>
> Lets say i have a 16 node tree "valued array" and want 2 branches from each node i could connect 1->2 & 1->3 that made full branch for slot 1. And then 2->3 and 2->4 but then 3 already have 2 branches and have to be skipped.
>
> Is there really no simpler way than storing the number of used branches with the three and check. It seem to create quite a highnumber of redundant check for heavily branched trees.
my 10 second thought: start from the bottom up. Use the algorithm from the first half of merge-sort, then as you walk up the tree, you build your permutations. When time permits, I'll sit down and do something concrete (if someone doesn't beat me to it)