Answer

Enter/Click/Tap Show/Complete
Previous
Next
B Bookmark

Computational Tools

Computational tools are used when an LP has too many variables or constraints to solve comfortably by hand.

For this course, the important tools are Excel Solver and MATLAB linprog. The mathematical model is still the main work: the solver only computes from the model you give it.

Map of the Section

When to Use a Solver

Use a solver when:

  • there are more than two decision variables
  • graphical solution is impossible or too slow
  • the problem has many constraints
  • the exercise explicitly asks for Excel Solver or MATLAB linprog
  • you need numerical confirmation of a hand solution

The solver does not replace formulation. If the variables, objective, or constraints are wrong, the computed answer is also wrong.

General Solver Workflow

  1. Define the decision variables.
  2. Write the objective function.
  3. Write every constraint.
  4. Convert the model into the solver’s input format.
  5. Run the solver.
  6. Check feasibility and objective value.
  7. Interpret the solution in the original problem language.

LP Data Needed by Solvers

Most LP solvers need the following information:

\[\min c^Tx\]

subject to:

\[A_{ineq}x\le b_{ineq}\] \[A_{eq}x=b_{eq}\] \[lb\le x\le ub.\]

For a maximization problem, convert it to minimization by multiplying the objective by $-1$.

Common Mistakes

The most common solver mistakes are:

  • putting coefficients in the wrong column
  • forgetting nonnegativity bounds
  • using $\le$ instead of $\ge$
  • forgetting to convert maximization to minimization for linprog
  • reading the minimized negative value as the original maximum
  • trusting the answer without checking constraints

Checklist

Before using a solver, verify:

  • each variable has a clear meaning
  • each row of the constraint matrix corresponds to one real constraint
  • units are consistent
  • all lower and upper bounds are included
  • objective direction is correct
  • the result is interpreted in the original units

See Also

Exam checkpoint

For solver questions, the solver result is not enough. Also report the LP model, variable meanings, objective value, active constraints, and whether the result matches algebraic expectations.