I used the matlab toolboxes Yalmip and SeDuMi to solve the quadratic problems.
The Results:
----------------------------------------- Spin Glass Chain min energy: -12.203561 sdp min energy: -12.203561 anneal min energy: -0.045621 ----------------------------------------- Spin Glass Grid min energy: -37.146475 sdp min energy: -15.471664 anneal min energy: -7.007199 -----------------------------------------