I am trying to find a way to solve the following problem of mine by using Solver but I get stuck right at the end of it.
I have a table of 14 companies each of which want to work on a project. I will be providing them with the workers that are required. In a table I have the workers that each company needs and the amount of time in weeks that their project will take. Once the workers are assigned they can't leave their post. Based on all this information (and the table) I have to calculate the least amount of workers that my company needs to hire for all projects to be completed within 6 months.
Now, for the sake of space and time, I'll reduce this problem to 4 companies to give you my POV:
Company Workers required Weeks required
A 3 3
B 1 3
C 5 2
D 4 3
Suppose that there's no obvious answer to this and that we have 2 months in our disposal, or something like that. 2 months have approx 8 weeks and so the above projects need to be completed in 8 weeks.
My mathematical modeling is as follows: Let $x_i $ be the week that project $i$ starts. Also, $t_i$ shall be the weeks required for project $i$ and $c_i$ will be the workers required.
Furthermore, I'll have $Y_{ij}$ be a binary variable that is equal to 1 if project $i$ is taking place during week $j$ and 0 if not. Thus, $W_j=\sum_{i=1}^{4}Y_{ij}\cdot c_i$ is the amount of workers that are working during week $j$.
Therefore, we are looking to minimize $W=max_{1\leq j\leq 8}W_j$.
The only constraint I believe there is the following: $1\leq x_i \leq 8-t_i+1$ meaning that a project can start on the 1st week at least and be completed by the end of the 8th week at most.
Now,I have taken this to Excel and have created 2 tables. One that has the companies column and the values $t_i$, $x_i$ and $x_i+t_i$ for each one. On another column I have the restraint that $x_i\leq 8-t_i+1$ that I would use for solver. On the second table I have the companies, $t_i$, $c_i$, and 8 columns one for each week.The variables on the inside represent $y_{ij}$ and at the end of each column I have calculated the sumproduct of $c_i$ with column $j$ meaning the $W_j$'s. Finally, my target cell is the maximum of the $W_j$'s.
When I try to run Solver with the $x_i$'s as the changing variable cells it returns an error that the problem is not linear (my $Y_{ij}$'s are set to either 1 or 0 with an IF function depending on $x_i$'s values), but when I go use $Y_j$'s as the changing variable cells, other than the fact that I don't know how to include the constraint, it just keeps every variable at 0 without giving me a solution. Mind you, my table has more companies and weeks (14com $\times$ 24w) which exceeds the 200 variables that Solver can handle.
How am I approaching this wrong? What steps should I take/change in my process to find the solution to my problem?
Edit: I’ve decided to accept every answer as correct, because they were all so well presented and helped me learn something new and see the solution to this from different perspectives. Thank you all for your precious time and help!