unique-grouping
Groups list of individuals into K unique groupings of N groups using simulated annealing.
Please consider following this project's author, SwiftWinds, and starring the project to show your ❤️ and support.
Installation
Install with npm:
$ npm install --save unique-grouping
Usage
; const people = // people to group "Alleson" "Brad" "Charlie" "Danielle" "Fredric" "George" "Harriet" "Ivan" "Jenny" "Karen" "Laura" "Mona" "Nathan" "Olive" "Penelope" "Rachel" "Stan" "Tom"; const history = // previous groupings "Harriet" "Karen" "Charlie" "Brad" "Nathan" "Rachel" "Ivan" "George" "Penelope" "Olive" "Danielle" "Jenny" "Tom" "Alleson" "Laura" "Stan" "Fredric" "Mona" "Alleson" "Mona" "Penelope" "Rachel" "Laura" "Ivan" "Charlie" "Tom" "Brad" "George" "Karen" "Nathan" "Fredric" "Olive" "Stan" "Jenny" "Danielle" "Harriet" ; // people to be seperated at all costsconst forbiddenPairs = "Alleson" "Brad" "Fredric" "Tom"; // target size of each groupconst groupSize = 4; // optional parameters to tune the simulated annealing algorithmconst options = tempMax: 50 tempMin: 0001 coolingRate: 00001 alpha: 1 beta: 1 ;
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.