# Function rgeometry::algorithms::two_opt_moves[−][src]

pub fn two_opt_moves<T, R: ?Sized>(    pts: Vec<Point<T, 2>>,     rng: &mut R) -> Result<Polygon<T>, Error> where    T: PolygonScalar + Debug,    R: Rng,
Expand description

Generate a valid polygon by connecting a set of points in such a way that there are no self-intersections.

# Time complexity

$O(n^4)$

# Space complexity

$O(n^2)$