The algorithm then performs a multicanonical ensemble simulation: a Metropolis–Hastings random walk in the phase space of the system with a probability distribution given by P ( r ) = 1 / ρ ρ ^ ^ ( E ( r ) ) = exp ⁡ ⁡ ( − − S ( E ( r ) ) ) and a probability of proposing a new state given by a probability distribution g ( r → → r ′ ) . A histogram H ( E ) of visited energies is stored. Like in the Metropolis–Hastings algorithm, a proposal-acceptance step is performed, and consists in (see Metropolis–Hastings algorithm overview):