SGM: use sparse matrices, except for solve_LSAP #22

This makes things 3-4 times faster.