PHPackages                             mikegarde/partition - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mikegarde/partition

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mikegarde/partition
===================

Partition a set of values into equal sets or near equal sets.

0.4.0(1y ago)218.7k3GPL-3.0-or-laterPHPPHP ^5.6|^7.4|^8.0

Since Apr 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MikeGarde/partition)[ Packagist](https://packagist.org/packages/mikegarde/partition)[ RSS](/packages/mikegarde-partition/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

The Partition Problem
=====================

[](#the-partition-problem)

[![Packagist](https://camo.githubusercontent.com/e3709414d903a5701fcea54a34906f804f90fb617f9c3a99cae8b4beddbccec7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696b6567617264652f706172746974696f6e2e737667)](https://packagist.org/packages/mikegarde/partition)[![Packagist](https://camo.githubusercontent.com/965f7e1bbb95afd8e6b7ded91be9bd9c5e3fd98818c8716be0d3816c1193f1bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f6d696b6567617264652f706172746974696f6e2e737667)](https://packagist.org/packages/mikegarde/partition)[![GitHub](https://camo.githubusercontent.com/9bf127ec8f180d57b0b8c6169c04d3954e580b697a82a49bcc1e01a963521367/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d696b6567617264652f706172746974696f6e2e737667)](https://github.com/MikeGarde/partition)[![PHP from Travis config](https://camo.githubusercontent.com/06a76d83eedf2f97b946a3537ecf6db1276c34748317d5de11863441d3846430/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f6d696b6567617264652f706172746974696f6e2e737667)](https://travis-ci.org/MikeGarde/partition)[![GitHub code size in bytes](https://camo.githubusercontent.com/0d94c51f9ae34e1359c6e8bf77c85a2160a57887d4fa192438c0152e0e09447d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6d696b6567617264652f706172746974696f6e2e737667)](https://github.com/MikeGarde/partition)[![Travis (.org)](https://camo.githubusercontent.com/ba7944b136ca020691048d2d6a6c55fe3743da304debbe1b8451fd8d09b9cfd5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d696b6567617264652f706172746974696f6e2e737667)](https://travis-ci.org/MikeGarde/partition)

A PHP function to partition a set of values into equal sets or near equal sets (partitions). Read more about the [partition problem on wikipedia](https://en.wikipedia.org/wiki/Partition_problem).

Installing
----------

[](#installing)

Find on [packagist.org](https://packagist.org/packages/mikegarde/partition)

`composer require mikegarde/partition`

Example
-------

[](#example)

```
