Skip to content

Commit

Permalink
Merge branch 'master' of github.com:psaia/kcomb
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Saia committed Mar 17, 2020
2 parents 878e515 + 3cbe03f commit 21069af
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# kcomb

kcomb implements a variation of [n choose k](https://en.wikipedia.org/wiki/Binomial_coefficient) in order
to compute every possible distinct combination of values within a streamable series of columns.
Compute (and stream/generate) every possible combination within N sets of data using an implementation of [n choose k](https://en.wikipedia.org/wiki/Binomial_coefficient).

This could be useful when doing something like generating every possible template string given a set of
values for each variable in the template.
values for each variable in the template. This works even when the number of variables per template is unknown.

When working with larger sets, this can be resource intensive as results could be in the millions+. The `CombineGenerator` func will allow you to create a pipeline and efficently iterate without eating much CPU or memory.

See [tests](kcomb_test.go) and the [demo](demo/main.go) for usage and benchmarking.


```
go get -u github.com/psaia/kcomb
```

See [tests](kcomb_test.go) and the [demo](demo/main.go) for usage and benchmarking.

![data stream](demo/fruit.gif)

0 comments on commit 21069af

Please sign in to comment.