operations-research

I need an algorithm that can fit n rectangles of any size in a larger one minimizing its area

夙愿已清 提交于 2019-12-24 10:08:10
问题 I need an algorithm that would take n rectangles of any sizes, and calculate a rectangle big enough to fit them all, minimizing its area so the wasted area is minimum, and also returning the position of all the smaller rectangles within. The specific task I need this to implement on is in a sprite sheet compiler that would take individual PNG files and make a large PNG with all the images in it, so individual frames can be blitted from this surface at run time. A nice to have feature would be

scipy minimize SLSQP - 'Singular matrix C in LSQ subproblem'

我的梦境 提交于 2019-12-19 04:15:24
问题 I'm trying to solve a pretty basic optimization problem using SciPy. The problem is constrained and with variable bounds and I'm pretty sure it's linear. When I run the following code the execution fails with the error message 'Singular matrix C in LSQ subproblem'. Does anyone know what the problem might be? Thanks in advance. Edit: I'll add a short description of what the code should do here. I define a 'demand' vector at the beginning of the code. This vector describes the demand of a

Shift planning with Linear Programming

偶尔善良 提交于 2019-12-08 13:32:36
问题 The Modeling and Solving Linear Programming with R book has a nice example on planning shifts in Sec 3.7. I am unable to solve it with R. Also, I am not clear with the solution provided in the book. Problem A company has a emergency center which is working 24 hours a day. In the table below, is detailed the minimal needs of employees for each of the six shifts of four hours in which the day is divided. Shift Employees 00:00 - 04:00 5 04:00 - 08:00 7 08:00 - 12:00 18 12:00 - 16:00 12 16:00 -

Interpretation of GAP in CPLEX

眉间皱痕 提交于 2019-12-05 02:57:30
问题 This is a part of the engine-log output that I get from a small-scale mixed integer linear optimization problem that I solved in CPLEX 12.7.0 Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap 0 0 280.0338 78 280.0338 72 0 0 428.8558 28 Cuts: 89 137 0 0 429.5221 34 Cuts: 2 142 0 0 429.7745 34 MIRcuts: 2 143 * 0+ 0 460.9166 429.7745 6.76% 0 2 429.7745 34 460.9166 429.8666 143 6.74% Elapsed time = 0.49 sec. (31.07 ticks, tree = 0.01 MB, solutions = 1) * 35 8 integral 0 438

Interpretation of GAP in CPLEX

旧巷老猫 提交于 2019-12-03 17:28:10
This is a part of the engine-log output that I get from a small-scale mixed integer linear optimization problem that I solved in CPLEX 12.7.0 Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap 0 0 280.0338 78 280.0338 72 0 0 428.8558 28 Cuts: 89 137 0 0 429.5221 34 Cuts: 2 142 0 0 429.7745 34 MIRcuts: 2 143 * 0+ 0 460.9166 429.7745 6.76% 0 2 429.7745 34 460.9166 429.8666 143 6.74% Elapsed time = 0.49 sec. (31.07 ticks, tree = 0.01 MB, solutions = 1) * 35 8 integral 0 438.1448 435.6381 211 0.57% Cover cuts applied: 17 Implied bound cuts applied: 10 Flow cuts applied: 11

Interpreting Weibull parameters from survreg

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 12:30:06
问题 I am trying to generate an inverse Weibull distribution using parameters estimated from survreg in R. By this I mean I would like to, for a given probability (which will be a random number in a small simulation model implemented in MS Excel), return the expected time to failure using my parameters. I understand the general form for the inverse Weibull distribution to be: X=b[-ln(1-rand())]^(1/a) where a and b are shape and scale parameters respectively and X is the time to failure I want. My

Interpreting Weibull parameters from survreg

冷暖自知 提交于 2019-12-03 03:36:53
I am trying to generate an inverse Weibull distribution using parameters estimated from survreg in R. By this I mean I would like to, for a given probability (which will be a random number in a small simulation model implemented in MS Excel), return the expected time to failure using my parameters. I understand the general form for the inverse Weibull distribution to be: X=b[-ln(1-rand())]^(1/a) where a and b are shape and scale parameters respectively and X is the time to failure I want. My problem is in the interpretation of the intercept and covariate parameters from survreg. I have these