4 ms·
Though this is more a recognition rather than an optimization problem, it can be modeled with optimization modeling languages. Here's an example in Mosel (discl
by merraksh 12y ago
Though this is more a recognition rather than an optimization problem, it can be modeled with optimization modeling languages. Here's an example in Mosel (disclaimer: I work for the company that develops Mosel). Here, a and b are the am/pm price, while (x,y), (u,v), and (t,z) are the am/pm chickens sold by each farmer.
model "chicken"
uses "mmxnlp"
declarations
a,b: mpvar;
x,y,u,v,t,z: mpvar;
end-declarations
x is_integer
y is_integer
u is_integer
v is_integer
t is_integer
z is_integer
a*x+b*y=35
a*u+b*v=35
a*t+b*z=35
x+y=10
u+v=16
t+z=26
a>=b
end-model
The solution can be found by a non-convex optimization solver in a fraction of a second.
Spoiler: scroll right for the answer. a = 3.75, b = 1.25, x = 9, y = 1, u = 6, v = 10, t = 1, z = 25
[edit: clarification]