API for clojure.math.combinatorics

by Mark Engelberg
Full namespace name:
clojure.math.combinatorics
Overview
Efficient, functional algorithms for generating lazy
sequences for common combinatorial functions. (See the source code
for a longer description.)
Public Variables and Functions
cartesianproduct
function
Usage: (cartesianproduct & seqs)
All the ways to take one item from each sequence
Source
combinations
function
Usage: (combinations items n)
All the unique ways of taking n different elements from items
Source
lexpermutations
function
Usage: (lexpermutations c)
DEPRECATED as a public function.
In prior versions of the combinatorics library, there were two similar functions: permutations and lexpermutations. It was a source of confusion to know which to call. Now, you can always call permutations. When appropriate (i.e., when you pass in a sorted sequence of numbers), permutations will automatically call lexpermutations as a speed optimization.
Deprecated since Lazy sequences for common combinatorial functions version 1.3
Source
partitions
function
Usage: (partitions items & args)
All the lexicographic distinct partitions of items.
Optionally pass in :min and/or :max to specify inclusive bounds on the number of parts the items can be split into.
Source
permutations
function
Usage: (permutations items)
All the distinct permutations of items, lexicographic by index.
Source
selections
function
Usage: (selections items n)
All the ways of taking n (possibly the same) elements from the sequence of items
Source
subsets
function
Usage: (subsets items)
All the subsets of items
Source