Petr Shypila - 1 month ago 22

Python Question

I need to solve an optimization task with Python.

The task is following:

Fabric produces desks, chairs, bureau and cupboards. For producing this stuff two types of boards could be used. Fabric has 1500m. of first type and 1000m. of second. Fabric has 800 Employees. What should produce fabric and how much to receive a maximum profit?

The input values are following:

`| | Products |`

| | Desk | Chair | Bureau | Cupboard |

|--------------|------|-------|--------|----------|

| Board 1 type | 5 | 1 | 9 | 12 |

| Board 2 type | 2 | 3 | 4 | 1 |

| Employees | 3 | 2 | 5 | 10 |

| Profit | 12 | 5 | 15 | 10 |

Unfortunately I don't have an experience in solving optimization tasks so I don't even know where to start. What I did:

- I found sciPy optimization package which suppose to solve such type of problems.
- I have some vision about input and output for my function. The input should amount of each type of product and the output supposed to be the profit. But the choice of resources(boards, employees) might also be different. And this affects algorithm implementation.

Could you please give me at least any direction where to go? Thank you!

EDIT:

Basically @Balzola is right. It's a simplex algorithm. The task might be solved by using SciPy.optimize.linprog solution which uses simplex under the hood.

Answer

Source (Stackoverflow)

Comments