We have a set of N objects 1,...,N arranged in a given order. We want to group these objects in clusters that contain consecutive objects. For each subset i, i+ 1,...,i+k, there is an associated cost c(i, k). We want to find the grouping that minimizes the sum of the clusters' cost. Use the ideas of the paragraphing problem (Example 2.4) to formulate this problem as a shortest path problem.