Function Repository Resource:

PartitionByCooccurence

Source Notebook

Find the best-fitting partitions for a list of groups using co-occurrence counts

Contributed by: Ryan Bell

ResourceFunction["PartitionByCooccurence"][subgroups]

partitions the subgroups list based on the co-occurrence frequency of list items.

Details and Options

This function is used to partition a collection of items into subgroups based on the co-occurrence frequency of the list items.

Examples

Basic Examples (1) 

For all the elements in a set of lists, find a set of disjoint subsets containing all the elements:

In[1]:=
ResourceFunction[
 "PartitionByCooccurence"][{{1, 2, 3, 4}, {1, 2}, {3, 4}}]
Out[1]=

Applications (1) 

Self-assembling communities (1) 

Suppose you have a list of user IDs which are conversing on different threads. On one thread, there’s a discussion between users {"Alice","Bob","Carol","Dan"}, on another thread between {"Alice","Bob"} and on a third thread, users {"Carol","Dan"} are chatting. Using this information, let’s find the best way to organize all participants into groups based on these self-assembling communities:

In[2]:=
ResourceFunction[
 "PartitionByCooccurence"][{{"Alice", "Bob", "Carol", "Dan"}, {"Alice", "Bob"}, {"Carol", "Dan"}}]
Out[2]=

Publisher

Wolfram Summer School

Version History

  • 1.0.0 – 17 July 2020

Related Resources

License Information