Grasshopper

algorithmic modeling for Rhino

Hi Everyone

I'm trying to make an algorithm which gives out possible combination of indexes

for example we have 

0

1

2

3

now I want to have these as groups

{0}

0

{1}

1

{2}

2

{3}

3

{4}

0,1

{5}

0,2

{6}

0,3

{7}

1,2

{8}

1,3

{9}

2,3

{10}

0,1,2

{11}

0,1,3

{12}

0,2,3

{13}

1,2,3

{14}

0,1,2,3

I want it to be parametric so I can have it for any set of indexes

I have tried to solve it with points and then removing duplicate points but it's not helping much

any help is truly appreciated

Views: 278

Replies to This Discussion

I don't understand your image, but the algorithm you're looking for is a recursive algorithm to calculate the "Power Set". The Power Set is the set of all subsets of {0,1,2,3}.

https://en.wikipedia.org/wiki/Power_set

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service