The following Matlab project contains the source code and Matlab examples used for non self intersecting polyline.
% NON self-INTersecting maximum area POLYLINE
% It arranges points in plane the coordinates of which are given by
% matrix #A#, so that the line connecting the 1st point with the 2nd,
% the 2nd with the 3rd, the 3rd with the 4th, etc.