Wolfram Language

Graphs and Networks

Clustering Tree

Construct and visualize the hierarchical cluster of arbitrary data using the new ClusteringTree function in Version 11.

Cluster cities based on the proximity to one another.

In[1]:=
Click for copyable input
ClusteringTree[{Entity[ "City", {"London", "GreaterLondon", "UnitedKingdom"}], Entity["City", {"Paris", "IleDeFrance", "France"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"Tokyo", "Tokyo", "Japan"}], Entity["City", {"Boston", "Massachusetts", "UnitedStates"}], Entity["City", {"Moscow", "Moscow", "Russia"}], Entity["City", {"SanDiego", "California", "UnitedStates"}], Entity["City", {"Baltimore", "Maryland", "UnitedStates"}]}]
Out[1]=

Obtain a cluster hierarchy from a list of colors.

In[2]:=
Click for copyable input
colors = RandomColor[18]
Out[2]=
In[3]:=
Click for copyable input
ClusteringTree[colors, ClusterDissimilarityFunction -> "Centroid"]
Out[3]=

Choose a different GraphLayout.

In[4]:=
Click for copyable input
ClusteringTree[RandomColor[40], ClusterDissimilarityFunction -> "Centroid", GraphLayout -> "RadialDrawing"]
Out[4]=

Related Examples

de es fr ja ko pt-br ru zh