Docsity

Notes on Mathematical Programming | CSCI 1410, Study notes of Computer Science

Toggle sidebar
bg1
CS 141 Introduction to AI Greenwald
Lecture 08: Mathematical Programming
TBA
Contents
1 Overview 1
2 Sample Linear Programs 1
3 Sample Integer Linear Programs 2
3.1 Sample Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Modelling Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1 Overview
Amathematical program is an optimization problem of the form:
min
x∈Rnf(x)
subject to
Ax ≤b
where
•A= (aij)1≤i≤m,1≤j≤nis a matrix of real-valued constants
•b= (bj)1≤j≤mis a vector of real-valued constants
•x= (xi)1≤i≤nis a vector of variables
•fis a function
If fis linear, then the program is called a linear program (LP). If fis linear, and for all i,xi∈Z,
then the program is called an integer linear program (ILP). If fis linear, and for some i,xi∈R,
while for other i,xi∈Z, then the program is called a mixed integer linear program. If fis linear,
and for all i,xi∈ {0,1}, then the program is called a binary integer linear program.
2 Sample Linear Programs
The Diet Problem Consider a set of mvitamins contained in a set of nfoods. The minimum
daily requirement of vitamin iis bi, for all 1 ≤i≤m. The cost (in dollars or calories) per unit of
food jis cj, for all 1 ≤j≤n. The number of units of vitamin icontained in each unit of food jis
aij. How much of each food should be consumed so as to minimize cost without failing to satisfy
the minimum daily requirements?
pf3
pf4

Partial preview of the text

Download Notes on Mathematical Programming | CSCI 1410 and more Study notes Computer Science in PDF only on Docsity!

CS 141 Introduction to AI Greenwald

Lecture 08: Mathematical Programming

TBA

Contents

1 Overview 1

2 Sample Linear Programs 1

3 Sample Integer Linear Programs 2

3.1 Sample Constraints..................................... 3 3.2 Modelling Practice..................................... 4

1 Overview

A mathematical program is an optimization problem of the form:

min x∈Rn^ f (x)

subject to Ax ≤ b

where

  • A = (aij ) 1 ≤i≤m, 1 ≤j≤n is a matrix of real-valued constants
  • b = (bj ) 1 ≤j≤m is a vector of real-valued constants
  • x = (xi) 1 ≤i≤n is a vector of variables
  • f is a function

If f is linear, then the program is called a linear program (LP). If f is linear, and for all i, xi ∈ Z, then the program is called an integer linear program (ILP). If f is linear, and for some i, xi ∈ R, while for other i, xi ∈ Z, then the program is called a mixed integer linear program. If f is linear, and for all i, xi ∈ { 0 , 1 }, then the program is called a binary integer linear program.

2 Sample Linear Programs

The Diet Problem Consider a set of m vitamins contained in a set of n foods. The minimum daily requirement of vitamin i is bi, for all 1 ≤ i ≤ m. The cost (in dollars or calories) per unit of food j is cj , for all 1 ≤ j ≤ n. The number of units of vitamin i contained in each unit of food j is aij. How much of each food should be consumed so as to minimize cost without failing to satisfy the minimum daily requirements?

LP If xj is the number of units of food j that one consumes daily, then the objective is to minimize cT^ x. But at the same time, one must satisfy the minimum daily requirement. The term aij xj denotes the number of units of vitamin i that are consumed in xj units of food j. Summing over all foods j yields the constraint Aix ≥ bi, for all vitamins i. The linear program that solves the diet problem can be stated as follows:

min x j

∑^ n

j=

cj xj

s.t.

∑^ n

j=

aij xj ≥ bi, ∀i

xj ≥ 0 , ∀j

The Production Problem A company manufactures n products using m resources. The com- pany has in its inventory bi units of resource i, for all 1 ≤ i ≤ m, and it earns cj profits by producing one unit of product j, for all 1 ≤ j ≤ n. The number of units of resource i required to produce one unit of product j is aij. How much of each product should be manufactured so as to maximize total profits, given the stated resource constraints?

LP If xj is the number of units of product j that is produced, then the objective is to maximize cT^ x. But the company’s resources are limited. The term aij xj denotes the number of units of resource i that is necessary to manufacture xj units of product j Summing over all products j yields the constraint Aix ≤ bi, for all resources i. The linear program that solves the production problem can be stated as follows:

max x j

∑^ n

j=

cj xj

s.t.

∑^ n j=

aij xj ≤ bi, ∀i

xj ≥ 0 , ∀j

3 Sample Integer Linear Programs

The capital budgeting problem is the binary version of the production problem: that is, xj ∈ { 0 , 1 } indicates whether or not product j is produced (or the jth investment opportunity is selected). The knapsack problem is the special case of capital budgeting where m = 1.

Knapsack Problem Given n objects s.t. object i has value vi but weighs wi. Find an optimal set of objects to pack in a knapsack of capacity k.

LP Let xi ∈ R denote the quantity of object i that is packed in the knapsack.

max x i

∑

i

vixi

Set Partitioning Constraints (^) ∑

j

xj = 1

3.2 Modelling Practice

Assume: xi ∈ { 0 , 1 }.

We can carry at most k items: (^) ∑

i

xi ≤ k

A → B If we take item i, we must also take item j:

xi ≤ xj

¬(A ∧ B) We can take at most one of item i and item j:

xi + xj ≤ 1

A ∨ B We must take at least one of item i and item j:

xi + xj ≥ 1

A “exclusive or” B We must take exactly one of item i and item j:

xi + xj = 1