Book Image

Mastering Scientific Computing with R

Book Image

Mastering Scientific Computing with R

Overview of this book

Table of Contents (17 chapters)
Mastering Scientific Computing with R
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Linear programming


Linear programming is used to minimize or maximize a function subject to constraints when both the objective function and the constraints can be expressed as linear equations or inequalities. More generally, these optimization problems can be expressed as follows:

The preceding formula is subject to the following constraints:

It is also subject to the non-negativity constraint , , …, . In other words, we are interested in finding the values for the decision variables , which minimize the objective function L(x) subject to the constraints and non-negative conditions. The opposite of this is also true to maximize a linear program, as follows:

The preceding formula is subject to the following constraints:

It is also subject to the non-negativity constraint , , …, .

R has a few packages and functions available to help solve linear programming problems. We will go over a few examples to show you how to use these functions to set up and solve linear programs. Let's start by solving...