Decomposition algorithm