The stochastic design of force-minimized compact magnets for high-field magnetic resonance imaging applications