This can be implemented by computing a sort of "potential" for every hydrophobic atom that is negative, gets more negative the closer you get to the atom, and drifts towards zero as you distance yourself from it (very much like a gravity potential or an electromagnetic potential). In this case, hydrophobic atoms should look to lower their place in the potential as much as possible, as this will cause them to move towards other hydrophobic atoms and thus increasing their chances of forming bonds.
This can be implemented by computing a sort of "potential" for every hydrophobic atom that is negative, gets more negative the closer you get to the atom, and drifts towards zero as you distance yourself from it (very much like a gravity potential or an electromagnetic potential). In this case, hydrophobic atoms should look to lower their place in the potential as much as possible, as this will cause them to move towards other hydrophobic atoms and thus increasing their chances of forming bonds.