## ams_version=1.0 Model Main_LargestSmallPolygon { Comment: { "Largest small polygon Problem type: NLP (small) Description: Find the polygon with maximal area, among polygons with n sides and diameter d <= 1. This problem has many local minima and therefore general nonlinear solvers are usually expected to find only local solutions. References: Dolan, E.D., J.J. More, Benchmarking Optimization Software with COPS, 2000." } Parameter NumberOfSides { Range: integer; InitialData: 10; Comment: "Number of sides and points"; } Set Points { SubsetOf: Integers; Index: i, j; Definition: { {1..NumberOfSides} } } Parameter pi { Definition: 4 * arctan(1); } Variable PolarRadius { IndexDomain: (i); Range: nonnegative; Comment: "r: Polar radius (distance to fixed vertex)"; } Variable PolarAngle { IndexDomain: (i); Range: [0, pi]; Comment: "theta: Polar angle (measured from fixed direction)."; } Variable PolygonArea { Range: free; Definition: 0.5 * sum(i | i<>NumberOfSides, PolarRadius(i+1) * PolarRadius(i) * sin(PolarAngle(i+1) - PolarAngle(i))); } Constraint Distance { IndexDomain: (i,j) | i < j; Definition: { PolarRadius(i)^2 + PolarRadius(j)^2 - 2 * PolarRadius(i) * PolarRadius(j) * cos(PolarAngle(i) - PolarAngle(j)) <= 1 } } Constraint OrderConstraint { IndexDomain: i | i