adapt problem + fix pyamg randomness