This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I was able to take a look at your workflow today, and I think I have a few ideas as to what is happening.
For your "O" input, I think your type needs to be "B" for binary instead of "I". This is because each employee/office combination can only be selected once, making in a yes/no binary variable.
For your "A" input, the matrix needs to be configured so that the Offices are the fields. This is because we are attempting to populated offices with office/employee combinations. Office availability is your constraint.
On the same note, your "B" input needs to reflect those office constraints. In your case, you are expecting full occupancy, dir set to "==" is appropriate. rhs should reflect occupancy.
In this configuration, your variables are in rows. So you will want to set the Select constrain mode for Input Anchor A to Dense matrix, variables in rows.
With this input configuration, I am able to run your optimization problem.
Does this all make sense? Do you have any further questions? Let me know!
To add the Employee constraint, simply add the Employee matrix to the "A" input", as you had done in your original configuration. The difference from your original configuration is that you only want 1's and Nulls in the matrix. The 1's represent a combination meeting a criteria (office 1 or Employee 1).
And add the Employee == 1 constraint to the "B" input. All Employees should be set to ==1, as you want to be sure that each gets assigned once, and only once, again, as you had done in your original configuration.
Please be sure to check that the order of your constrains in the "A" input left to right matches the order of your constraints in the "B" input.
This configuration produces your expected result, where each employee is assigned to only one office.
Do the configurations of the Optimization Tool inputs make sense? Are there any further questions I can help you with? Please let me know!
Your solution looks correct, it seems to me that this is exactly what I did in my workflow (except the type = "I" instead of "B" although in my mind it should not matter because the combination of type, lb and ub should take care of that)
But I still get "solution undefined". I am attaching my workflow again if you can please see where I am messing it up.
In order to have the optimization run correctly, I made two major changes to your original workflow. The first is change from "I" to "B". The second is that in the "A" input, all values must be set equal to 1. A "1" indicates that a combination meets a criteria (e.g., Employee1Office1 has a 1 for Office_1 and a 1 for Employee_1). You want these values to all be 1, even for the offices (like Office 5) that will take two employees. This is because even though some of the offices can have two occupants, each combination (e.g., Employee5Office5) only meets the "Office" criteria once. Having 2's in the matrix with 2 being the maximum value for that office makes the optimization equation unsolvable, because the 2 constraint is met with only one employee assigned to the office.
The double occupancy office constraint is set in the "B" input, where you set an Office needing to be equal to 2, instead of 1.