I am trying to find an effective approach for generating unique pairings. For example I have a set of Users
[ John, Joe, Tim, Fred, Todd, Kevin ]
I am trying to come up with a program such that each time I run it it will give everyone a different pair
For Example
1st run
John Joe
Tim Fred
Todd Kevin
2nd Run
John Tim
Joe Fred
Kevin Todd
and so on
Im trying to make it such that this algorithm does not repeat a pair until all pairs have gone through
This is not for hw!!! this is for my own personal project.
I am trying to use Node.js for this any advice would be great!!!