In this paper the notion of convexity of clusterings for the given ord
ering of units is introduced. In the case when at least one (optimal)
solution of the clustering problem is convex, dynamic programming lead
s to a polynomial algorithm with complexity O(kn(3)). We prove that, f
or several criterion functions, convex optimal clusterings exist when
dissimilarity is pyramidal for a given ordering of units.