Second best choice with Solver

Solver is usually used to find the "best" solution. We aim to maximize value in a knapsack problem, or maybe minimize the scheduling time required for a set of jobs to be completed on some machines, and so on.

But what if we would like to know the second, or third best choice? Maybe we can gain some insights into our problem exploring suboptimal solutions. There are some caveats, but with a bit of VBA this is a feasible problem (pun intended).

Choose the right gear

We are given a set of gears, one equation to be satisfied (see picture below) and a number of constraints.


Terms on the left (work and cutter) are given, while A, B, C and PG must be chosen from a set of 29 elements (it is a set in common among unknowns, so we are not allowed to use the same gear twice for two different variables, even though there are duplicates).

How do we find the right gears?

Switching from Solver to OpenSolver

I was solving a very simple model found in a forum: given a total cost in € (or $\$$, if you are reading from across the ocean) for a set of projects, and the hourly cost of 3 technician involved, find the integer number of hours each one should spend on it. The aim is minimizing the wasted time, that is, solve the following

$$
 \min \left| TC - \sum_{i=1}^{3} c_{i} k_{i} \right| \; \; s.t. k_{i} \in \mathbb{N}
$$

The problem was to be solved for a number of rows, with different costs.