Computer algorithms for automatically determining the shape of knots, based on stress minimization, or similar optimization problem.