A setup that simulates ground states of spin graphs would allow one to solve computationally hard optimization problems efficiently. Current optical setups to this goal have difficulties decoupling the amplitude and phase degrees of freedom of each effective spin, which risks that the resultant mapping will be invalid, a problem known as amplitude heterogeneity. Here, we propose a setup with coupled active optical cavity modes, where this problem is eliminated through their particular geometric arrangement. Acting as an effective Monte Carlo solver, the ground state can be found exactly. By tuning a parameter, the setup solves XY or Ising problems.