For starters, the "solution" here doesn't ensure that the ending piece meets the starting piece in the right direction. :p
a metric for tension = [ norm(sum(piece_vectors)) + abs(angle_displacement) ] / n
where
angle_displacement = sum(angles) - 360
and the angles are signed accordingly.