Sparse reordering for non-terminal pairs