Since there are large differences in the time it takes to find a solution and the kinds of solutions – globally optimal, locally optimal, or simply “good” – that you can expect for different types of problems, it pays to understand the differences between linear, smooth nonlinear, and non-smooth functions, and especially convex and non-convex functions. To begin, let’s clarify what it means to say that the worksheet cells you select for the objective and constraints are “functions of the decision variables.”
The objective function in a Solver problem is a cell calculating a value that depends on the decision variable cells; Solver’s job is to find some combination of values for the decision variables that maximizes or minimizes this cell’s value. During the optimization process, only the decision variable cells are changed; all other “input” cells are held constant. If you analyze the chain of formulas that calculates the objective function value, you will find that parts of those formulas (those which refer to non-decision variable cells) are unchanging in value and could be replaced by a fixed number for the purposes of the optimization.
If you have constant values on the right hand sides of constraints, then the same observation applies to the left hand sides of constraints: Parts of the constraint formulas (those which refer to non-decision variable cells) are unchanging in value, and only the parts that are dependent on the decision variables “count” during the optimization.
When you consider whether your objective and constraints are linear, smooth nonlinear, or non-smooth, or convex or non-convex functions of the variables, always bear in mind that only the parts of formulas that are dependent on the decision variables “count.” In the following topics, we explain that linear functions are most desirable, and non-smooth and non-convex functions are least desirable in a Solver model (if you want the fastest and most reliable solutions). A formula such as =IF(C1>=10,D1,2*D1) is non-smooth if C1 depends on the decision variables; but if C1 doesn’t depend on the variables, then only D1 or 2*D1 – not both – can be selected during the solution process. Hence if D1 is a linear function of the variables, then the IF expression is also a linear function of the variables.
You may also find that a function that is “bad” (non-smooth or non-convex) over its full domain (any possible values for the decision variables) can still be “good” (smooth and/or convex) over the domain of interest to you, determined by other constraints including bounds on the variables. For example, if C1 depends on the variables, then =IF(C1>=10,D1,2*D1) is non-smooth over its full domain, but smooth – in fact linear – if C1 is constrained to be 10 or more. =SIN(C1) is non-convex over its full domain, but is convex from –pi to 0, or from pi to 2*pi.