Construct two vectors, one for the left-upper bound of the protein, and one for the right-lower bound of the protein. Then, compute the length, squared (Vec3D.len_sq()). This amount should be minimised, as it is one of the earliest benchmarks the algorithm will deal with, and improves long before the order quality increases.
Why this corner-to-corner length squared and not just the volume/area?
Because when the protein starts in a straight line, we want it to start bending itself into a compact shape. However, imagine the 2D case N = 10 -> area = height width = 1 10 = 10. Now, we want it to bend, but the area would increase to 2 * 9 = 18. This is unfavourable for the algorithm, and the protein will be stuck in a straight line.
Calculating the corner-to-corner length squared solves this problem. For the same case:
penalty = height^2 + width^2 = 1^2 + 10^2 = 101
However, bending once reduces the penalty to 2^2 + 9^2 = 85.
This is a clear improvement over a straight line, and thus pushes the protein into a favourable shape.
Construct two vectors, one for the left-upper bound of the protein, and one for the right-lower bound of the protein. Then, compute the length, squared (Vec3D.len_sq()). This amount should be minimised, as it is one of the earliest benchmarks the algorithm will deal with, and improves long before the order quality increases.
Why this corner-to-corner length squared and not just the volume/area?
Because when the protein starts in a straight line, we want it to start bending itself into a compact shape. However, imagine the 2D case N = 10 -> area = height width = 1 10 = 10. Now, we want it to bend, but the area would increase to 2 * 9 = 18. This is unfavourable for the algorithm, and the protein will be stuck in a straight line.
Calculating the corner-to-corner length squared solves this problem. For the same case: penalty = height^2 + width^2 = 1^2 + 10^2 = 101 However, bending once reduces the penalty to 2^2 + 9^2 = 85. This is a clear improvement over a straight line, and thus pushes the protein into a favourable shape.