Compute minimum profile (not finished yet)