The biological phenomena described in the previous chapter were corpse aggregation and brood sorting by ants. The clusters of items obtained with the models introduced in sections 4.3.1 and 4.3.2 emerged at arbitrary locations. The underlying self-organizing process, whereby large clusters grow even larger because they are more attractive than smaller clusters, does not ensure the formation of clusters at specific locations. In the two biological examples described in this chapter, the self-organizing dynamics of aggregation is constrained by templates. A template is a pattern that is used to construct another pattern. The body of a termite queen or a brood pile in ants are two examples of structures—the second one resulting from the activities of the colony—that serve as templates to build walls. Walls built around the termite queen form the royal chamber; walls built around the brood pile form the ant nest. When a mechanism combines self-organization and templates, it exhibits the characteristic properties of self-organization, such as snowball effect or multistability, and at the same time produces a perfectly predictable pattern that follows the template. The two nonparametric algorithms presented in chapter 4, one for multidimensional scaling and the other for graph partitioning, can be made parametric through the use of templates. The number of clusters of data points or vertices can be predefined by forcing items to be deposited in a prespecified number of regions in the space of representation, so that the number of clusters and their locations are known in advance. In the previous chapter, we saw how the attractivity of corpses or the differential attractivity of items of different types could lead to the formation of clusters of specific items. Self-organization lies in this attractivity, which induces a snowball effect: the larger a cluster, the more likely it is to attract even more items. But selforganization can also be combined with a template mechanism in the process of clustering. A template is a kind of prepattern in the environment, used by insects— or by other animals—to organize their activities.