When the endpoints of an edge have the same “group” attribute, the edge is assigned a large value for an attribute that penalizes edge crossings and a large "weight" attribute. The latter tries to vertically align the vertices and reduce the number of twists in the spline. Both attributes are heuristics, in that there may still be edge crossings, though fewer, and the edge can still be a non-trivial spline.