Skip to content
C

Problem 1: Build and Visualize a Dendrogram

Easypython

Problem Description

Write a Python program that builds a dendrogram for a small 2D dataset using Ward linkage.

Input

A small 2D dataset with visually distinct groups.

Output

A displayed dendrogram.

Constraints

  • At least 6 points.

Example Input

text
[[1,1],[2,2],[2,3],[8,8],[9,8],[8,9]]

Example Output

text
(A dendrogram showing the merging sequence and heights)

Concepts Covered

linkage(), dendrogram().

Input (stdin)

Output

Run your code to see output here...