Test-Example~9.5:  8 points in R^2

Data and Dendrogram

Needs["HierarchicalClustering`"]

A={{2,7},{3,9},{4,8},{3,7},{5,7},{8,3},{8,5},{9,4}}; m=Length[A];
tab=Table[i,{i,10}];
AG={{Min[A[[All,1]]]-1,Max[A[[All,1]]]+1},{Min[A[[All,2]]]-1,Max[A[[All,2]]]+1}};
PI=Table[{A[[i]]},{i,Length[A]}];slpart=ListPlot[Table[PI[[j]],{j,Length[PI]}],PlotStyle->Table[{PointSize[.05],Hue[2j/Length[PI]]},{j,Length[PI]}] ,PlotRange->AG,AspectRatio->1,GridLines->{tab,tab},ImageSize->Small];
(*slden=DendrogramPlot[A,Linkage->"Median",ImageSize->300,HighlightLevel->2,LeafLabels->(#&)];*)
slden=DendrogramPlot[A,Linkage->"Median",LeafLabels->(#&)];
GraphicsGrid[{{slpart,slden}},ImageSize->Medium]

Call AgglNest[]

Input: parameter p=1 or 2 specifying whether to use (Subscript[ℓ, 1])-norm or LS distance-like
 function, parameter DD specifying the distance function between sets: 
 DD=0: Dc-distance.  DD=1: Dmin1-distance;  DD=2: Dmin2-distance; 
	DD=5: Ward.
If DD=1, it should be p=1; If DD=2, it should be p=2;
	If Ind≠0, Print: DistanceMatrix, Figure;
Submodules: MinEl[], Fmin[], Dmin1[], Dmin2[], Indexes[];
Output: data set, optimal partition, Rand and Jaccard index, confusion matrix;

AgglNest[A,2,0,1]