Graph partitioning and ordering for sparse matrix factorization