1 of 177

Introduction to Optmization

Lecture 2 Simplex Method & Duality

1

2 of 177

Last time

Question: Is the convex hull of infinite number of points a convex set?

2

3 of 177

Last time

Question: Is the convex hull of infinite number of points a convex set?

Answer: Yes, but one needs a more general definition of convex hull without resorting to the convex combination.

3

4 of 177

Last time

Question: Is the convex hull of infinite number of points a convex set?

Answer: Yes, but one needs a more general definition of convex hull without resorting to the convex combination.

4

5 of 177

Last time: High level overview of simplex method

5

  • How do we represent the current vertex with algebra?

  • How do we initialize the first vertex?

  • How do we move the next vertex?

  • How do we check when to terminate?

6 of 177

Last time: High level overview of simplex method

6

  • How do we represent the current vertex with algebra?

  • How do we initialize the first vertex?

  • How do we move the next vertex?

  • How do we check when to terminate?

7 of 177

Last time: Bases and Vertices

7

Given the standard form representation of a polytope

8 of 177

Last time: Bases and Vertices

8

Given the standard form representation of a polytope

9 of 177

Last time: Bases and Vertices

9

Given the standard form representation of a polytope

What does this mean?

10 of 177

Last time: Bases and Vertices

10

11 of 177

Last time: Bases and Vertices

11

We have m+n constraints, but only need n independent constraints to determine a vertex.

12 of 177

Last time: Bases and Vertices

12

We have m+n constraints, but only need n independent constraints to determine a vertex.

We take m columns from Ax = b and n-m columns from x > 0.

13 of 177

Last time: Bases and Vertices

13

We have m+n constraints, but only need n independent constraints to determine a vertex.

We take m columns from Ax = b and n-m columns from x > 0.

14 of 177

Last time: Bases and Vertices

14

We take m columns from Ax = b and n-m columns from x > 0.

15 of 177

Last time: Bases and Vertices

15

We take m columns from Ax = b and n-m columns from x > 0.

Assuming other constraints are not active, then we get the new linear system from the active constraints.

16 of 177

Last time: Bases and Vertices

16

We take m columns from Ax = b and n-m columns from x > 0.

Assuming other constraints are not active, then we get the new linear system from the active constraints.

17 of 177

Let’s go back to understand the theorem

17

18 of 177

Let’s go back to understand the theorem

18

19 of 177

Let’s go back to understand the theorem

19

20 of 177

This tells us how to construct a vertex.

20

21 of 177

This tells us how to construct a vertex.

21

22 of 177

We make the following observations

  • A basic solution (vertex that is not necessarily feasible) can be compactly described by a subset of indices I = {B(1), B(2),…, B(m)}.

22

23 of 177

We make the following observations

  • A basic solution (vertex that is not necessarily feasible) can be compactly described by a subset of indices I = {B(1), B(2),…, B(m)}.
  • We can then define the basis B as the m x m matrix:

23

24 of 177

We make the following observations

  • A basic solution (vertex that is not necessarily feasible) can be compactly described by a subset of indices I = {B(1), B(2),…, B(m)}.
  • We can then define the basis B as the m x m matrix:

  • We say two basic solutions are adjacent if the bases B is off by only one column.

24

25 of 177

A quick reminder on degeneracy

25

26 of 177

A quick reminder on degeneracy

26

27 of 177

Last time: High level overview of simplex method

27

  • How do we represent the current vertex with algebra?

  • How do we initialize the first vertex?

  • How do we move the next vertex?

  • How do we check when to terminate?

28 of 177

When does a vertex exist?

28

29 of 177

When does a vertex exist?

29

30 of 177

When does a vertex exist?

30

The proof is simple. Please read the textbook.

31 of 177

This has insteresting implication:

31

32 of 177

This has insteresting implication:

32

Why?

33 of 177

This has insteresting implication:

33

Why?

Bounded = Not contain a line.

Standard form = x > 0 (hence independent constraints.)

34 of 177

We know that the basic feasible solution exists. How to find the first one?

34

Recall that the standard LP takes form:

35 of 177

We know that the basic feasible solution exists. How to find the first one?

35

Consider the next problem:

Recall that the standard LP takes form:

36 of 177

We know that the basic feasible solution exists. How to find the first one?

36

Consider the next problem:

Recall that the standard LP takes form:

Claim:

  • The second problem has the opitmal objective 0 if and only if the first problem has a feasible x.
  • y=b, x=0 is a basic feasible solution to the second problem.

37 of 177

How to find the first basic feasible solution in three steps?

37

  • y=b, x=0 is a basic feasible solution to the second problem.

38 of 177

How to find the first basic feasible solution in three steps?

38

  • y=b, x=0 is a basic feasible solution to the second problem.

  • Solve the above problem can give a basic feasible solution to the original problem.

39 of 177

How to find the first basic feasible solution in three steps?

39

  • y=b, x=0 is a basic feasible solution to the second problem.

  • Solve the above problem can give a basic feasible solution to the original problem.

  • Initialize simplex for the original problem with the above solution.

40 of 177

Last time: High level overview of simplex method

40

  • How do we represent the current vertex with algebra?

  • How do we initialize the first vertex?

  • How do we move the next vertex?

  • How do we check when to terminate?

41 of 177

First, we need to define a feasible direction.

41

What does the feasible direction look like at a vertex with basis B?

42 of 177

First, we need to define a feasible direction.

42

What does the feasible direction look like at a vertex with basis B?

Then we denote x with indices in the basis,

And for x with indices outside of the basis,

43 of 177

43

Recall that two vertex are adjacent only if the bases differ by only one column.

44 of 177

44

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

45 of 177

45

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

Therefore, we can simply pick a direction from one of the non-basis coordinates.

46 of 177

46

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

Therefore, we can simply pick a direction from one of the non-basis coordinates.

47 of 177

47

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

To figure out the value of d in the basis indices, we can use feasibility of d.

48 of 177

48

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

To figure out the value of d in the basis indices, we can use feasibility of d.

49 of 177

49

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

50 of 177

50

Recall that two vertex are adjacent only if the bases differ by only one column.

Therefore, we can move at most in n-m directions. (Why? How many zeros in x are there?)

51 of 177

51

Therefore, to move in direction in the coordinate j where j is not in the basis, we can easily compute the corresponding feasible direction as:

52 of 177

Among all the n-m directions, which one should we pick?��

52

53 of 177

Among all the n-m directions, which one should we pick?��We should pick the one that minimizes the objective.��

53

54 of 177

Among all the n-m directions, which one should we pick?��We should pick the one that minimizes the objective.��How do we tell whether the objective decreases?

54

55 of 177

55

56 of 177

56

57 of 177

57

58 of 177

58

59 of 177

59

Only directions out of the basis can lead to descent!!

60 of 177

Last time: High level overview of simplex method

60

  • How do we represent the current vertex with algebra?

  • How do we initialize the first vertex?

  • How do we move the next vertex?

  • How do we check when to terminate?

61 of 177

If we found an optimal solution, then

61

62 of 177

If we found an optimal solution, then

62

63 of 177

If we found an optimal solution, then

63

64 of 177

If we found an optimal solution, then

64

65 of 177

If we found an optimal solution, then

65

66 of 177

66

67 of 177

67

68 of 177

Next question, how far should we move in d, if d is a descent direction?��

68

69 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.������

69

70 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.�����

70

71 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.���We would then run into two cases.���

71

72 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.���We would then run into two cases.���

72

73 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.���We would then run into two cases.���

73

Optimal value is unbounded!

74 of 177

Next question, how far should we move in d, if d is a descent direction?��As much as possible.���We would then run into two cases.���

74

Optimal value is unbounded!

75 of 177

In the second case, we almost completed an iteration, except that we need to update the basis.

75

Then we can construct the new bases by replacing B(𝓁) with j for the updated x.

Why? What constraints are now active?

76 of 177

Why is the new basis valid?

76

77 of 177

Why is the new basis valid?

77

78 of 177

Proof of (a) continued

78

79 of 177

Proof of (a) continued

79

80 of 177

Proof of (b)

80

81 of 177

Simplex method

81

  1. Find an initial feasible solution by solving:

82 of 177

Simplex method

82

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible

83 of 177

Simplex method

83

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible
  • Find a descent direction by computing reduced cost:

84 of 177

Simplex method

84

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible
  • Find a descent direction by computing reduced cost:

    • If all entries are positive: then terminate and output the optimal solution.

85 of 177

Simplex method

85

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible
  • Find a descent direction by computing reduced cost:

    • If all entries are positive: then terminate and output the optimal solution.
    • Otherwise, compute the update:

86 of 177

Simplex method

86

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible
  • Find a descent direction by computing reduced cost:

    • If all entries are positive: then terminate and output the optimal solution.
    • Otherwise, compute the update:

      • If 𝜃 is unbounded:. no optimal solution exists and the problem is unbounded

87 of 177

Simplex method

87

  1. Find an initial feasible solution by solving:

    • If optimal is 0, then found a feasible basic solution.
    • Otherwise, the problem is not feasible
  • Find a descent direction by computing reduced cost:

    • If all entries are positive: then terminate and output the optimal solution.
    • Otherwise, compute the update:

      • If 𝜃 is unbounded:. no optimal solution exists and the problem is unbounded
      • Otherwise, update the basis and the vertex and repeat.

88 of 177

We are left with only two questions:

Does the algorithm terminate in finite time?

Does the algorithm give the valid solution?

88

89 of 177

We are left with only two questions:

Does the algorithm terminate in finite time?

Does the algorithm give the valid solution?

89

90 of 177

Does the algorithm terminate in finite time?�

  • Given that we only have finite vertices, we only need to make sure that the algorithm do not find the same vertex twice.

90

91 of 177

Does the algorithm terminate in finite time?�

  • Given that we only have finite vertices, we only need to make sure that the algorithm do not find the same vertex twice.
  • When would this happen?

91

92 of 177

Does the algorithm terminate in finite time?�

  • Given that we only have finite vertices, we only need to make sure that the algorithm do not find the same vertex twice.
  • When would this happen?
    • If there are multiple choices of coordinates for

92

93 of 177

Does the algorithm terminate in finite time?�

  • Given that we only have finite vertices, we only need to make sure that the algorithm do not find the same vertex twice.
  • When would this happen?
    • If there are multiple choices of coordinates for

  • We impose an order to break the tie:

93

94 of 177

One can check that the following rule avoids cycling.

94

95 of 177

We are left with only two questions:

Does the algorithm terminate in finite time?

Does the algorithm give the valid solution?

95

96 of 177

Finally, why does the algorithm generate valid solution?

96

First, if there is an x that gives the optimal solution, then the algorithm can find it.

97 of 177

The proof of the theorem: 3 steps

97

98 of 177

The proof of the theorem: 3 steps

98

#2 Q doesn't contain a line, has extreme point.

99 of 177

The proof of the theorem: 3 steps

99

#3 Any extreme point of Q is an extreme point of P.

100 of 177

The proof of the theorem: 3 steps

100

#3 Any extreme point of Q is an extreme point of P.

101 of 177

The proof of the theorem: 3 steps

101

#3 Any extreme point of Q is an extreme point of P.

102 of 177

Therefore, we get the following statement.

102

Therefore, we get

  • either the algorithm finds such extreme point (i.e., vertex)
  • or the algorithm finds the optimal cost at infinity (this second case requires some thinking).

103 of 177

We cared about:��The Algorithm can be implemented with elementary math operations.�

103

Simplex method

104 of 177

We cared about:��The Algorithm can be implemented with elementary math operations.��The algorithm is correct and terminate in finite time.�

104

Simplex method

105 of 177

We cared about:��The Algorithm can be implemented with elementary math operations.��The algorithm is correct and terminate in finite time.��We didn’t focus on:

105

Simplex method

106 of 177

We cared about:��The Algorithm can be implemented with elementary math operations.��The algorithm is correct and terminate in finite time.��We didn’t focus on:��Can we solve the problem faster?��Is the problem in P or NP?�

106

Simplex method

107 of 177

We cared about:��The Algorithm can be implemented with elementary math operations.��The algorithm is correct and terminate in finite time.��We didn’t focus on:��Can we solve the problem faster?��Is the problem in P or NP?��But this is the starting point of mathematical programming: implement practical algorithms to solve real problems with the power of computers.�

107

Simplex method

108 of 177

We will talk about how to solve LP faster.��

108

109 of 177

We will talk about how to solve LP faster.��But before that, we need to understand a very important concept in convex problems: Duality

109

110 of 177

Motivating example:

  • How do we solve a nonlinear convex problem?

110

111 of 177

Motivating example:

  • How do we solve a nonlinear convex problem?

  • This would be easy without the constraint ….

111

112 of 177

Motivating example:

  • How do we solve a nonlinear convex problem?

  • This would be easy without the constraint ….
  • Can we penalize constraint violation?

112

113 of 177

Motivating example:

  • How do we solve a nonlinear convex problem?

  • This would be easy without the constraint ….
  • Can we penalize constraint violation?

113

114 of 177

Lagrangian

  • This is called the Lagrangian of the original problem.

114

115 of 177

Lagrangian

  • This is called the Lagrangian of the original problem.

  • For fixed p, we can easily minimize x, y for this quadratic function

115

116 of 177

Lagrangian

  • This is called the Lagrangian of the original problem.

  • For fixed p, we can easily minimize x, y for this quadratic function

  • Then by x+y=1, we get x=y=1/2.

116

117 of 177

Duality

  • One interpretation of duality:
    • Move constraints into objectives by penalizing violations.

117

118 of 177

Duality

  • One interpretation of duality:
    • Move constraints into objectives by penalizing violations.
    • However, this comes at some cost….

118

119 of 177

Duality

  • One interpretation of duality:
    • Move constraints into objectives by penalizing violations.
    • However, this comes at some cost….

  • Let’s see what happens in linear programs.

119

120 of 177

120

121 of 177

121

We do the same trick and penalize constraint violation.

122 of 177

122

We do the same trick and penalize constraint violation.

Can we solve the problem for fixed p?

123 of 177

  • Solving g(p) can be easy. Just compute the sign of the cost.

123

124 of 177

  • Solving g(p) can be easy. Just compute the sign of the cost.

  • Does it tell us anything about the original problem? Let x* be the optimal solution:

124

125 of 177

  • Solving g(p) can be easy. Just compute the sign of the cost.

  • Does it tell us anything about the original problem? Let x* be the optimal solution:

  • Therefore, we would like to maximize p so that g(p) is a best lower bound.

125

126 of 177

126

  • This is hard because g(p) is an implicit function.

127 of 177

127

  • This is hard because g(p) is an implicit function.

  • Let’s try to simplify the problem.

128 of 177

128

  • This is hard because g(p) is an implicit function.

  • Let’s try to simplify the problem.

  • Further,

129 of 177

129

  • This is hard because g(p) is an implicit function.

  • Let’s try to simplify the problem.

  • Further,

  • Together we get

130 of 177

130

Primal Probelm

Dual Probelm

131 of 177

131

Primal Probelm

Dual Probelm

132 of 177

If we follow the above steps for other general LP problems, we can have a recipe for generating dual problems.

132

133 of 177

Key observations

133

# Primal Constraints = # Dual Variables

# Primal Variables = # Dual Constraints

134 of 177

A few more examples:

134

# Primal Constraints = # Dual Variables

# Primal Variables = # Dual Constraints

135 of 177

A key property for Duality:"the dual of the dual is the primal”

135

136 of 177

A key property for Duality:"the dual of the dual is the primal”

136

The proof is nothing beyond following the recipe twice.

137 of 177

A key property for Duality:"the dual of the dual is the primal”

137

The proof is nothing beyond following the recipe twice.

But how would the dual problem help us understand the primal problem itself?

138 of 177

This is known as the duality theorem

  • We start with the easier part.

138

139 of 177

Proof of weak duality

139

Primal Probelm

Dual Probelm

140 of 177

Proof of weak duality

140

Primal Probelm

Dual Probelm

141 of 177

Proof of weak duality

141

Primal Probelm

Dual Probelm

142 of 177

Proof of weak duality

142

Primal Probelm

Dual Probelm

143 of 177

A simple corollary:

143

144 of 177

A simple corollary:

144

Prove by contradiction.

145 of 177

A second simple corollary:

145

146 of 177

A second simple corollary:

146

Why?

147 of 177

The above is simple. �

147

148 of 177

The above is simple. �But we can get a much stronger result.

148

149 of 177

The above is simple. �But we can get a much stronger result.

149

One of the most important theorems in optimization. Developed by von Neumann 1947 in game theory, and Gale, Kuhn, Tucker 1951 in LP.

150 of 177

There are many proofs. We use the standard one via Farkas’ Lemma.

  • Please read the textbook for a second proof.

150

151 of 177

(a) implies not (b)

151

152 of 177

(a) implies not (b)

152

153 of 177

(a) implies not (b)

153

154 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

154

155 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

155

156 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

156

157 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

157

158 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

158

159 of 177

Not (a) implies (b)

Consider a pair of primal-dual problems:

Dual Primal

159

160 of 177

Now we completed this proof

160

161 of 177

Now we completed this proof

161

162 of 177

Now we completed this proof

162

  • Not (a) means b is not in the cone formed by A.

163 of 177

Now we completed this proof

163

  • Not (a) means b is not in the cone formed by A.
  • (b) means one can find a hyperplane to separate b from the cone of A.

164 of 177

If we rephrase Farkas’ Lemma, we get a corollary

164

165 of 177

If we rephrase Farkas’ Lemma, we get a corollary

165

We use the above to prove strong duality.

166 of 177

Strong duality

166

167 of 177

Strong duality

  • We only need to show that for the following primal-dual pair,

there exists a feasible dual variable p, that achieves the same loss as the optimal primal solution.

167

168 of 177

Strong duality

  • We only need to show that for the following primal-dual pair,

there exists a feasible dual variable p, that achieves the same loss as the optimal primal solution. Why?

168

169 of 177

Strong duality

  • We only need to show that for the following primal-dual pair,

there exists a feasible dual variable p, that achieves the same loss as the optimal primal solution. Why? By weak duality

169

170 of 177

170

171 of 177

171

172 of 177

172

173 of 177

173

174 of 177

174

175 of 177

175

176 of 177

176

177 of 177

Strong duality

  • We only need to show that for the following primal-dual pair,

there exists a feasible dual variable p, that achieves the same loss as the optimal primal solution. Proof is done.

177