Last Modified: January 12, 2018

Solves a linear programming problem. This node uses formulas to represent the linear function to optimize and the constraints.

To solve the optimization problem, an optimal vector must exist. This node returns an error if an optimal vector does not exist.

Formula that defines the objective function.

The formula can contain any number of valid variables, but can only be a homogenous linear function of the variables.

Constraints under which you want to optimize the objective function. The formula can contain any number of valid variables.

You must enter inequalities in **subject to constraints**. The inequalities can only contain >= or <=. For example, enter the combination of x + 2y >= 3 and x + 2y <= 3 instead of x + 2y = 3. The left side of the inequalities can only be a homogenous linear function of variables, and the right side of the inequalities can only contain constants.

Optimization problem this node solves.

Name | Description |
---|---|

Maximize | Solves a maximization problem. |

Minimize | Solves a minimization problem. |

**Default: **Maximize

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

Maximum or minimum value, if it exists, of the solution vector under the constraints.

Solution vector. The *n*^{th} element in **solution** returns the optimal solution of the *n*^{th} element in **objective function**.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

The solution to a linear programming problem is a two-step process. This node completes the following steps to solve a linear programming problem.

- Transforms the original problem into a problem in restricted normal form, essentially without inequalities in the formulation.
- Solves the restricted normal form problem.

This node solves the optimization problem with the constraint that all variables should be nonnegative, and the constraint you specify in **subject to constraints**.

To find the minimum value of *f*(*x*, *y*) = *x* + *y* under the constraint *x* ≥ 0 and *y* ≥ 2, enter the following values on the panel:

objective function |
x + y |

subject to constraints |
(x >= 0, y >= 2) |

This node returns 2 as **optimization cost** and (0, 2) as **solution**, where the *n*^{th} element in **solution** is the optimal solution of the *n*^{th} variable in **objective function**.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application