Classes of graphs with bounded expansion have been introduced in [15], [12]. They generalize both proper minor closed classes and classes with bounded degree. For any class with bounded expansion C and any integer p there exists a constant N(C, p) so that the vertex set of any graph G C may be partitioned into at most N(C, p) parts, any i p parts of them induce a subgraph of tree-width at most (i-1) [12] (actually, of tree-depth [16] at most i, what is sensibly stronger). Such partitions are central to the resolution of homomorphism problems like restricted homomorphism dualities [14]. We give here a simple algorithm to compute such partitions and prove that if we restrict the input graph to some fixed class C with bounded expansion, the running time of the algorithm is bounded by a linear function of the order of the graph (for fixed C and p).