{{ message }}
/ combinatorics.js Public

Combinatorics Javascript Library

# devanp92/combinatorics.js

Switch branches/tags
Nothing to show

## Files

Failed to load latest commit information.
Type
Name
Commit time

# Introduction

Combinatorics.js is a standalone math library for Javascript and Node.js. It features a solution to work with Permutations, Posets, Trees, and other enumerative collections.

Combinatorics.js is also a module to math.js.

Please see this blog article to get a general feel for this project.

# Install/Build

To clone this project:

``````git clone git@github.com:devanp92/combinatorics.js.git
cd combinatorics.js
``````

To install via npm:

``````npm install combinatoricsjs
``````

To install the necessary dependencies:

``````npm install
``````

To test we use Mocha:

``````npm test // mocha test --recursive
``````

To build we use Gulp:

``````gulp
``````

1. Permutation: π : {1...n} -> {1...n}:

• Behaviors
• Inverse
• Multiply
• Calculate number of cycles
• Complement
• Reverse
• Randomize Permutation
• States
• Number of cycles
• Parity (odd/even)
• Number of fixed points (is it a Derangement?)
• Is Identity
• Ancillary
• Create/Return iterator
• Print to cycle notation
2. Permutation Patterns (subclass of Permutation)

A permutation π is said to 'contain' a permutation σ (σ is a permuation {1..m}, such that m < n) if there exists a subsequence in π in the same relative order.

Alternatively, a permutation avoids σ if there does not exist such a subsequence.

• Behaviors
• Contains
• Avoids
• Permutation avoiding pattern generator (all permutations π from [1..n] avoiding σ)
• States
• List of permutations given containing or avoiding a pattern
• Cardinality
3. Util Functions

• Is Integer
• Combinations
• Enumerative Methods
• Bell Numbers
• Stirling numbers of the first kind
• Partitions
• (Weak) Compositions
• Set Partitions
• Stirling numbers of the second kind
• Integer Paritions

# Contributing

Feel free to contribute to combinatorics.js! You can contribute in different ways: spread the word, report bugs, come up with ideas and suggestions, and contribute to the code.

There are a few preferences regarding code contributions:

Combinatorics.js follows the node.js code style

Send pull requests to the develop branch, not the master branch.

Pleae do not commit any files other than in lib/ and test/.

Thanks!

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Combinatorics Javascript Library

## Releases

No releases published

## Packages 0

No packages published