[英]Can I use linear programming for this scenario? How to set up using scipy.optimize.linprog?
Let's say I have to come up with a solution to fill each role needed to run an office, and maximize productivity. 假设我必须想出一种解决方案来填补运营办公室所需的每个角色,并最大限度地提高生产力。 There are several roles (office manager, front desk person, manager, etc). 有几个角色(办公室经理,前台人员,经理等)。 Each role has several candidates. 每个角色都有几个候选人。 Each candidate has a salary, and some number to represent their work productivity. 每个候选人都有薪水,还有一些数字代表他们的工作效率。 Now if I have 20,000 a month budget, I need to maximize the work productivity while staying under budget. 现在,如果我有每月20,000的预算,则需要在保持预算的同时最大化工作效率。 To me this seems like a pretty basic example of a linear programming problem, however I am getting stuck on the fact that I have multiple candidates for each position. 对我来说,这似乎是线性编程问题的一个非常基本的示例,但是我一直陷于一个事实,即每个职位都有多个候选人。 The examples I found are usually static options, such as having an apple, orange, and banana and maximizing production of food under some constraints. 我发现的示例通常是静态选项,例如拥有苹果,橙子和香蕉,并在某些限制下使食物的产量最大化。 My scenario would be more like choosing a green fruit, red fruit, and yellow fruit where there are many of each. 我的场景更像是选择绿色水果,红色水果和黄色水果(每种水果很多)。
If I have 3 positions total for the office, I believe the basics of my problem would be something like this: 如果我总共有3个职位,那么我认为问题的基础将是这样的:
maximize: x[prod] + y[prod] + z[prod] 最大化:x [prod] + y [prod] + z [prod]
x[sal] + y[sal] + z[sal] <= 20,000 x [sal] + y [sal] + z [sal] <= 20,000
x, y, and z positions must all be filled. x,y和z位置必须全部填写。
Where do I go from here? 我从这里去哪里? I'm new to linear programming so please correct me if anything doesn't make sense. 我是线性编程的新手,所以如果没有任何意义,请纠正我。
This is not a linear programming problem. 这不是线性编程问题。 Since you can't hire half a worker, this is an integer programming problem, making it much harder. 由于您不能雇用一半工人,所以这是一个整数编程问题,这使它变得更加困难。 scipy.optimize.linprog
doesn't handle integer programming. scipy.optimize.linprog
不处理整数编程。 You'd have to get a different solver. 您将不得不使用其他求解器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.