简体   繁体   English

我可以在这种情况下使用线性编程吗? 如何使用scipy.optimize.linprog进行设置?

[英]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.

相关问题 使用scipy.optimize.linprog的线性编程返回次优解决方案 - Linear programming using scipy.optimize.linprog returns suboptimal solution 使用scipy.optimize.linprog进行线性编程 - Linear programming with scipy.optimize.linprog 如何使用 scipy.optimize.linprog 获得 integer 解决方案? - How can I get integer solutions with scipy.optimize.linprog? 如何将`scipy.optimize.linprog` 用于更复杂的目标函数? - How to use `scipy.optimize.linprog` for a more complicated objective function? 在旅行商问题 (TSP) 中为 scipy.optimize.linprog Python function 定义线性规划约束 - Defining the linear programming constraints in the Traveling Salesman Problem (TSP) for the scipy.optimize.linprog Python function 使用scipy.optimize.linprog的权重中间范围(Simplex算法) - Weight Middle Range for use of scipy.optimize.linprog (Simplex algorithm) 为什么scipy.optimize.linprog无法解决一个简单的问题 - Why scipy.optimize.linprog can't solve a simple problem 如何获得 scipy.optimize.linprog 的结果数组? - How to get the result array of scipy.optimize.linprog? 带有 scipy.optimize.linprog 的拉格朗日乘法器 - Lagrange multipliers with scipy.optimize.linprog scipy.optimize.linprog-难以理解参数 - scipy.optimize.linprog - difficulty understanding the parameters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM