Separate groups of people based on members
- by tevch
I have groups of people. I need to move groups with at least one same member as far as possible from each other.
Example:
GroupA - John, Bob, Nick
GroupB - Jack, Nick
GroupC - Brian, Alex, Steve
As you can see GroupA and GroupB overlap(they both contain Nick)
I need an algorithm to set groups as GroupA-GroupC-GroupB
Thank you