Gallery
Norons
Share
Explore

icon picker
Documentation

The formula for a 1 deep connected network is based on this formula:
[1][6][15][20][15][6]
You should notice that this is the binomial coefficient. Here’s the fully expanded output:
[[ABCDE]]
[[ABCD][BCDE][CDEA][DEAB][EABC]]
[[ABC][BCD][CDE][DEA][EAB][ABC][BCD][CDE][DEA][EAB]]
[[AB][BC][CD][DE][EA][AB][BC][CD][DE][EA]]
[[A][B][C][D][E]]
[]
[]
[]
[]
[]
[[[1[2345]]]]
[[[1[234]]][[1[234]]][[1[234]][2[34]]][[1[234]][2[34]]][[1[234]][2[34]][3[4]]]]
[[[1[23]]][[1[23]]][[1[23]][2[3]]][[1[23]][2[3]]][[1[23]][2[3]][3[43]]][[1[23]][2[3]][3[43]]][[1[23]][2[3]][3[43]][4[543]]][[1[23]][2[3]][3[43]][4[543]]][[1[23]][2[3]][3[43]][4[543]][5[6543]]][[1[23]][2[3]][3[43]][4[543]][5[6543]]]]
[[[1[2]]][[1[2]]][[1[2]][2[32]]][[1[2]][2[32]]][[1[2]][2[32]][3[432]]][[1[2]][2[32]][3[432]]][[1[2]][2[32]][3[432]][4[5432]]][[1[2]][2[32]][3[432]][4[5432]]][[1[2]][2[32]][3[432]][4[5432]][5[65432]]][[1[2]][2[32]][3[432]][4[5432]][5[65432]]]]
[[[1[21]]][[1[21]]][[1[21]][2[321]]][[1[21]][2[321]]][[1[21]][2[321]][3[4321]]]]
[1][5][10][10][5]
You can read this as:
All the layers
The 5 ways to select 4 of the 5 elements
The 10 ways to select 3 of the 4 elements
...
...
The 5 ways to select 1 of each of the five elements

Sequence([Input Nodes].Count(), 1, -1).FormulaMap(WithName(CurrentValue, SequenceSize,
SequenceSize.FormulaMap(WithName(
Factorial([Input Nodes].Count())
/ (Factorial(CurrentValue) * Factorial([Input Nodes].Count() - CurrentValue)),
ComboCount,
Sequence(0, ComboCount-1).FormulaMap(WithName(CurrentValue, IndexOffset,
Sequence(0, SequenceSize-1).FormulaMap(WithName(CurrentValue, StartingIndex,
[Input Nodes].Nth(1 + Remainder(StartingIndex + IndexOffset, [Input Nodes].Count()))
))
))
))
))
It’s not easy to understand, but at least we have WithName providing a bit of documentation.
I don’t know how to do this without the n choose k formula (the part with all the factorials). I’m sure there’s a Monte Carlo approach, but I’m also sure this is faster.
Next thing to do is to make the formula add a row for each group. We do that with:
Sequence([Input Nodes].Count(), 1, -1).FormulaMap(WithName(CurrentValue, SequenceSize,
SequenceSize.FormulaMap(WithName(
Factorial([Input Nodes].Count())
/ (Factorial(CurrentValue) * Factorial([Input Nodes].Count() - CurrentValue)),
ComboCount,
Sequence(0, ComboCount-1).FormulaMap(WithName(CurrentValue, IndexOffset,
Norons.AddRow([DB Items].[In Edges],
Sequence(0, SequenceSize-1).FormulaMap(WithName(CurrentValue, StartingIndex,
[Input Nodes].Nth(1 + Remainder(StartingIndex + IndexOffset, [Input Nodes].Count()))
))
)
))
))
))

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.