monotonic chains graph decomposition