Concepts / Introduction to Clustering

Introduction to Clustering

Clustering must balance keeping similar elements together with keeping dissimilar elements apart.

  • Programming

The Clustering Tension

Clustering sounds simple: place similar objects together and keep dissimilar objects apart. The difficulty is that these two goals can conflict. Similarity can connect objects locally without connecting the endpoints of the whole chain. Cluster membership, however, carries through the chain. Understanding this difference is the key to understanding the central challenge of clustering.

Clustering must balance two objectives: keeping similar elements together and keeping dissimilar elements apart.

A Chain of Local Similarities

What do you think happens?

Suppose A is similar to B, and B is similar to C, but A is dissimilar to C. If every similar neighboring pair must share a cluster, what happens to A and C?

  • A and C must remain in separate clusters
  • A and C can be placed in the same cluster through B
  • The similarity between A and B disappears
  • B must belong to no cluster
Reveal answer

Answer: A and C can be placed in the same cluster through B.

A and B share a cluster because they are a similar pair. B and C also share a cluster. Because sharing a cluster is transitive, A and C then share that cluster as well, even though they are dissimilar.

similarsimilardissimilarAobjectBobjectCobject
How can A be similar to B and B similar to C, yet A and C be dissimilar while all three end up in one cluster?

The diagram shows three objects connected by neighboring similarities. The first pair, A and B, is similar. The second pair, B and C, is also similar. Nothing in these local relationships guarantees that A and C are similar. They can be dissimilar even though each is similar to the object next to it.

Similarity Is Not Transitive

A relationship is transitive when a relationship from A to B and the same relationship from B to C guarantees that the relationship also holds from A to C. Similarity does not necessarily work this way. A can be similar to B, and B can be similar to C, without A being similar to C. Similarity can therefore form a chain whose endpoints are very dissimilar.

similarsimilarnot necessarily similarAobjectBobjectCobject
What is the difference between A being similar to B, B being similar to C, and A being similar to C?

Consider a generated chain of objects A, B, and C. A and B are locally similar, and B and C are locally similar. If the endpoints A and C are very different, the chain still demonstrates the same principle: neighboring similarity does not guarantee similarity between distant endpoints.

Cluster Sharing Carries Through

Cluster sharing behaves differently from similarity. If A shares a cluster with B, and B shares a cluster with C, then A and C share that cluster as well. This transitive property applies to the act of sharing a cluster, even when similarity itself is not transitive.

containscontainscontainsClustershared groupAmemberBmemberCmember
If A shares a cluster with B and B shares a cluster with C, what does that imply about A and C?

Once the similar pair A and B is assigned to one cluster, and the similar pair B and C is assigned to one cluster, B connects those assignments. The result is a shared cluster containing A, B, and C. This does not change the fact that A and C may be dissimilar; it shows that cluster membership can extend farther than direct similarity.

The Forced Decision

Following the Chain

A, B, and C form a chain. A is similar to B, B is similar to C, and A is dissimilar to C. What follows if every similar pair is required to share a cluster?

First pair: Because A and B are similar, the first objective places A and B in the same cluster.

Second pair: Because B and C are similar, the same objective places B and C in the same cluster.

Transitive membership: A and C are now connected through B. Since sharing a cluster is transitive, A and C share the cluster too.

Conflict: The first objective has been preserved, but the dissimilar endpoints A and C now share a cluster, which conflicts with the objective of keeping dissimilar objects apart.

The two objectives cannot always be satisfied simultaneously. Separating A and C requires allowing at least one similar neighboring pair not to share a cluster.

supportscan conflict withSimilar pairstogetherpreserve local linksDissimilar pairsapartseparate distant endpointsSimilarity chainA-B-C
Why can keeping every similar pair together conflict with keeping every dissimilar pair in separate clusters?

Practical Clustering Judgment

When analyzing a clustering decision, inspect both kinds of relationships. First ask which similar neighboring objects the grouping keeps together. Then ask whether transitive cluster sharing has brought dissimilar endpoints into the same group. This makes the trade-off visible instead of treating a cluster as proof that every pair inside it is directly similar.

  • Assuming that similarity is transitive.

    The source concept states that similarity is non-transitive. Local similarity does not guarantee similarity between the endpoints.

    Fix: Treat each similarity relationship as local unless the clustering method provides another reason to connect the objects.

  • Assuming that objects in one cluster must all be directly similar to one another.

    A and C can be connected through B even when A and C are dissimilar.

    Fix: Distinguish direct similarity from sharing a cluster.

  • Expecting both clustering objectives to be satisfied perfectly in every chain.

    The two requirements can contradict each other when a chain connects locally similar pairs to dissimilar endpoints.

    Fix: Recognize that a clustering method must choose how to balance the competing objectives.

Check Your Reasoning

MEDIUM

Explain the result of this situation in your own words: A is similar to B, B is similar to C, and A is dissimilar to C. If A and B must share a cluster and B and C must share a cluster, why can A and C end up sharing a cluster? Which clustering objective is placed at risk?

Hints
  • Separate the meaning of similarity from the meaning of sharing a cluster.
  • Follow the connection from A to C through B.
  • Name the objective that concerns dissimilar objects.

A complete answer should state that similarity is not necessarily transitive, cluster sharing is transitive, and preserving every local similarity can force dissimilar endpoints into one cluster.

What to Remember

  1. Similarity is non-transitive: A can be similar to B and B can be similar to C without A being similar to C.
  2. Sharing a cluster is transitive: if A shares a cluster with B and B shares a cluster with C, A and C share that cluster.
  3. A chain of neighboring similarities can connect very dissimilar endpoints within one cluster.
  4. Keeping all similar pairs together can conflict with keeping all dissimilar pairs apart.
  5. Clustering is therefore a balancing decision between preserving local similarity and separating dissimilar objects.

Key Takeaways

  • Similarity does not necessarily carry from A to B and B to C through to A and C.
  • Cluster membership does carry through such a chain.
  • A clustering method may place dissimilar endpoints together if it insists on preserving every neighboring similarity.
  • The central challenge is balancing cohesion among similar elements with separation among dissimilar elements.