Ground set X⊆Rn defined by affine equalites and or inequalities.s
Nonlinear Programming (NLP),
Some functions f,gi,i∈I∪E are nonlinear.
Unconstrained Optimization,
I∪E=∅,
X=Rn.
Constrained Optimization,
I∪E=∅, and or,
X⊂Rn.
Integer programming (IP),
X⊆Zn or X⊆{0,1}n.
Convex Programming (CP),
f,gio,i∈I are convex functions,
gi,i∈E are affine functions,
X is a closed convex set.
We will usually pack all our constraints and the ground set into a single set,
S={x∈Rn∣gi(x)≤0,i∈I,gi(x)=0,i∈E,x∈X}.
But, what do we mean by solving the problem to,
x∈Sminf(x)?
Let’s define this mathematical operation.
Let,
f⋆:=x∈Sinff(x),
denote the infimum value of f over the set S. If the value f⋆ is attained at some point x⋆ in S, we can (are allowed) to write,
f⋆:=x∈Sminf(x),
and have f(x⋆)=f⋆. Another well-defined operator defines the set of minimal solutions to the problem,
S⋆:=x∈Sargminf(x),
where S⋆⊆S is nonempty if and only if the infimum value f⋆ is attained at some point x⋆∈S.
Definition 4 (Definition of x∈Sminf(x))
“to x∈Sminf(x)” means to “find f⋆ and an x⋆∈S⋆”.
If we have an optimization problem P,
P:x∈Sminf(x),
A point x is feasible in problem P if x∈S. The point is infeasible in problem P if x∈/S.
The problem P is feasible if there exist a x∈S and the problem P is infeasible if S=∅.
A point x⋆ is an optimal solution to P if x⋆∈x∈Sargminf(x).
f⋆ is an optimal value to P if f⋆=x∈Sminf(x).
Example I
Consider the problem to,
minsubject to(x+1)2,x∈R,
We will learn how to “formally” solve and prove the optimality of the solution later in the course, but we can “intuitively” see that the optimal solution is x⋆=−1 with optimal value f⋆=0.
Important to note here, this is how we “answer” the question, we state the optimal solution and the optimal value (x⋆ and f⋆).
Example II
A more complicated problem is to,
minsubject to(x+1)2,x≥0,
Again, we can “intuitively” see that the optimal solution is x⋆=0 with optimal value f⋆=1.
Example III
If we consider the following problem, is there a minimizer?
infsubject to(x+1)2,x>0,
We can see that the infimum value is f⋆=1, as x grows closer and closer to 0, but there is no feasible point x⋆∈S such that f(x⋆)=1.
Hence, there is no minimizer, we can attain the infimum value, but not at any feasible point.
An Optimization Problem: The Diet Problem
As a first example of an (real) optimization problem, we consider the diet problem 1.
Example 1 (The Diet Problem)
For a moderately active person, how much of each of a number of foods should be eaten on a daily basis so that the person’s intake of nutrients will be at least equal to the recommended dietary allowances (RDAs), with the cost of the diet being minimal?
This will be a good example to show how to model a real optimization problem and why a “realistic” model sometimes can be difficult to achieve.
We will furthert modify the question and only consider food items from McDonald’s.
What we have to our disposal is the following table.
Table 1: Nutritional values and cost of food items at McDonald’s, along with the recommended daily allowances (RDA) for a moderately active person.
Food
Calories (kcal)
Carb (g)
Protein (g)
Vit. A (%)
Vit. C (%)
Calc. (%)
Iron (%)
Cost (SEK)
Big Mac
550
46
25
6
2
25
25
30
Cheeseburger
300
33
15
6
2
20
15
10
McChicken
360
40
14
0
2
10
15
35
McNuggets
280
18
13
0
2
2
4
40
Caesar Salad
350
24
23
160
35
20
10
50
French Fries
380
48
4
0
15
2
6
20
Apple Pie
250
32
2
4
25
2
6
10
Coca-Cola
210
58
0
0
0
0
0
15
Milk
100
12
8
10
4
30
8
15
Orange Juice
150
30
2
0
140
2
0
15
RDA
2000
350
55
100
100
100
100
Let’s formulate the problem.
We will define the following sets,
FoodsNutrients:={Big Mac, Cheeseburger, McChicken, McNuggets, Caesar Salad, French Fries, Apple Pie, Coca-Cola, Milk, Orange Juice},:={Calories, Carb, Protein, Vit. A, Vit. C, Calc., Iron}.
We define the following parameters,
aij=Amount of nutrient i in food j,i∈Nutrients,j∈Foods,bi=Recommended daily amount (RDA) for nutrient i,i∈Nutrients,cj=Cost of food j,j∈Foods.
Thus, we will have the following decision variables,
xj=Amount of food j we shoujld eat each day, j∈Foods.
With these, we can define the optimization problem to,
With a total cost of 118.47 SEK and a total of 3093.51 kcal.
But we can’t really buy 0.27 of a Caesar Salad, so we would have to modify the model to account for this.
If we add the constraint that xj should be an integer, the optimal solution becomes,
with a total cost of 150 SEK and a total of 3200 kcal.
It might look like we just rounded the previous solution, and that can sometimes give an okay answer for integer programming problems, but we can get very different solutions by solving the integer programming problem directly.
Supervised Learning
Let’s also define supervised learning [^2] as an optimization problem.
Supervised learning for classification can be defined as follows.
Given data pairs (xℓ,yℓ)∈Rn×{1,…,M},ℓ=1,…N,
We want to find a mapping G:Rn↦{1,…,M} such that G(xi)=yi.
One way to do it,
Parameterize a neural network Gθ:Rn↦Δ, where Δ={s∈RM∣s≥0,∑i=1Msi=1}.
Let ei∈RM be the i-th unit vector, and E:{1,…,M}↦{ei}i=1M,E:i↦ei.
Let F:Δ×Δ↦R,F:(t,s)↦−∑i=1Mtilog(si) (Cross-Entropy loss function).