  It has been known for a long time that the ground state problem of random
magnets, e.g. random field Ising model (RFIM), can be mapped onto the
max-flow/min-cut problem of transportation networks. I build on this approach,
relying on the concept of residual graph, and design an algorithm that I prove
to be exact for finding all the minimum cuts, i.e. the ground state degeneracy
of these systems. I demonstrate that this algorithm is also relevant for the
study of the ground state properties of the dilute Ising antiferromagnet in a
constant field (DAFF) and interfaces in random bond magnets.
