Optimal construction of MPO