liveBook · Manning

Disjoint set

As explained in Advanced Algorithms and Data Structures

A disjoint group is a collection of elements that shares no elements with another group in the same partition.

A disjoint set organizes elements into groups that share no elements with one another. In a changing catalog, partitioning items this way can let algorithms process groups instead of the entire collection. section 5.1

A practical grouping scenario has three stages:

  • Begin with each catalog item in its own group, or start from predefined categories. section 5.1
  • Combine items associated through frequent purchases, such as laptops with external disks or tennis rackets with tennis balls. section 5.1
  • Keep the groups current as new items arrive and relationships change. section 5.1
Figure 5.2 An example of an application of a disjoint set. (A) In this scenario, an e-commerce website is trying to understand what products sell well together in order to provide better recommendations to its customers. (B) Initially, each item on sale is in a different category. (This would also work if we started from already predefined categories, such as SSD disks or blenders, and grouped categories of objects selling together. But for the sake of simplicity, bear with me and imagine there is only one product of each category on sale.) (C) Items frequently bought together, such as laptops and external disks, or tennis rackets and tennis balls, are grouped together. (D) After a while, things tend to stabilize and steady groups are formed. Now, the next time a customer adds a football to her cart, we can suggest a pair of skis as a follow-up purchase.

Shows an e-commerce catalog progressing from separate item categories to stable groups used for follow-up recommendations. section 5.1

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines partitioning and motivates dynamic updates, but does not detail operations, implementation, or complexity.
Examples
Uses product associations such as laptops with external disks and footballs with skis.
What you can do after
Evaluate how disjoint grouping can reduce catalog-processing work and support recommendations.
How it connects
Connects partitioning with clustering and recommender systems.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.