Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf ·...

74
C ONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc Mobility Research Centre, Complexity Research Adastral Park Martlesham Heath Suffolk IP5 3RE United Kingdom University of York Department of Mathematics, Heslington York, YO10 5DD United Kingdom Supervisors: Dr. K. M. Briggs Dr. J. Levesley Dissertation submitted for the MSc in Mathematics with Modern Applications, Department of Mathematics, University of York, UK on August 22, 2008

Transcript of Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf ·...

Page 1: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

CONVEX OPTIMIZATIONtheory and practice

Constantinos Skarakis

BT Group plcMobility Research Centre,

Complexity ResearchAdastral ParkMartlesham HeathSuffolk IP5 3REUnited Kingdom

University of YorkDepartment of Mathematics,HeslingtonYork, YO10 5DDUnited Kingdom

Supervisors: Dr. K. M. BriggsDr. J. Levesley

Dissertation submitted for the MSc in Mathematics with Modern Applications,Department of Mathematics, University of York, UK on August 22, 2008

Page 2: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2

Page 3: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Contents

1 Introduction 5

2 Theoretical Background 92.1 Convex sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Definiteness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.3 Cones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.4 Generalised inequalities . . . . . . . . . . . . . . . . . . . . . 182.5 Convex functions . . . . . . . . . . . . . . . . . . . . . . . . . 19

3 Convex optimization 233.1 Quasiconvex optimization . . . . . . . . . . . . . . . . . . . . 25

3.1.1 Golden section search . . . . . . . . . . . . . . . . . . 273.2 Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.3 Linear programming . . . . . . . . . . . . . . . . . . . . . . . 30

3.3.1 Linear-fractional programming . . . . . . . . . . . . . 313.4 Quadratic programming . . . . . . . . . . . . . . . . . . . . . 32

3.4.1 Second-order cone programming . . . . . . . . . . . . 333.5 Semidefinite programming . . . . . . . . . . . . . . . . . . . 33

4 Applications 354.1 The Virtual Data Center problem . . . . . . . . . . . . . . . . 35

4.1.1 Scalability . . . . . . . . . . . . . . . . . . . . . . . . . 394.2 The Lovasz ϑ function . . . . . . . . . . . . . . . . . . . . . . 41

4.2.1 Graph theory basics . . . . . . . . . . . . . . . . . . . 414.2.2 Two NP-complete problems . . . . . . . . . . . . . . . 424.2.3 The sandwich theorem . . . . . . . . . . . . . . . . . . 434.2.4 Wireless Networks . . . . . . . . . . . . . . . . . . . . 464.2.5 Statistical results . . . . . . . . . . . . . . . . . . . . . 474.2.6 Further study . . . . . . . . . . . . . . . . . . . . . . . 48

4.3 Optimal truss design . . . . . . . . . . . . . . . . . . . . . . . 514.3.1 Physical laws of the system . . . . . . . . . . . . . . . 51

Page 4: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4 CONTENTS

4.3.2 The truss design optimization problem . . . . . . . . 524.3.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

4.4 Proposed research . . . . . . . . . . . . . . . . . . . . . . . . . 594.4.1 Power allocation in wireless networks . . . . . . . . . 59

Page 5: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Chapter 1

Introduction

The purpose of this paper is to bring closer the mathematical and the com-puter science, in the field where it makes the most sense to do so: Mathe-matical optimization. More specifically Convex optimization. The reasonis simply because most real problems in engineering, information tech-nology, or many other industrial sectors involve optimizing some kind ofvariable. That can either be minimizing cost, emissions, energy usage ormaximizing profit, radio coverage, productivity. And most of the times, ifnot always, these problems are either difficult, or very inefficient to solveby hand. Thus the use of technology is required.

The advantages of convex optimization, is that first of all, it includes alarge number of problem classes. In other words, many of the most com-monly addressed optimization problems are convex. Or even if they arenot convex, some times [sections 3.1, 3.3.1], there is a way to reformulatethem into convex form. What’s even more important than that, is thatdue to the convex nature of the feasible set of the problem, any local opti-mum is also the global optimum. Algorithms written to solve convex op-timization problems take advantage of such particularities, and are faster,more efficient and very reliable. Especially in specific classes of convexprogramming, such as linear or geometric programing, algorithms havebeen written to deal with these particular cases even more efficiently. Asa result, very large problems, with even thousands of variables and con-straints, are solvable in sufficiently little time.

The event that inspired this project, was the relatively recent releaseof CVXMOD; a programming tool for solving convex optimization prob-lems, written in the programming language python. The release of an op-timization software is not something new. Similar tasks can be performedusing Matlab solvers, like cvx, but it normally takes an above mediumlevel of expertise and many lines of code and maybe also include signifi-

Page 6: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

6 Introduction

CVXOPT solvers

DSDP GLPK GSL

CVXMOD python

Lapack & BLAS Atlas Programming language C

solvers

Figure 1.1: CVXMOD, CVXOPT and their dependencies.

cant cost from the purchase of the program. What’s really exciting aboutthis new piece of software, is that it is free, open-source, and it makes itpossible to solve a large complex convex optimization problem using just15 or 20 lines of code. It works as a modeling layer for CVXOPT, a pythonmodule using the same principles with cvx.

CVXOPT comes with its own solvers written completely in python.However, the user has the option to use in some cases C solvers, translatedinto python. These are the same solvers used by cvx in Matlab, and relyon the same C libraries [Frigo and Johnson, 2003, Makhorin, 2003, Bensonand Ye, 2008, Galassi et al., 2003, Whaley and Petitet, 2005]. These librarieshave been used for many years and as a result they have been well testedand constitute to a very reliable set of optimization tools. Among otherthings, we hope to test the efficiency of CVXMOD and CVXOPT in ourexamples. If the results are satisfactory, that means that we will have in ourhands tools that are very high-level, as the programming language theyare written in themselves, as well as a good mathematical tool. Then theonly difficulty will lie in formulating the problem mathematically. Here isa list of applications we present as example problems that can be efficientlysolved using CVXOPT [Boyd and Vandenberghe, 2004]

· Optimal trade-off curve for a regularized least-squares problem.· Optimal risk-return trade-off for portfolio optimization problems.· Robust regression.· Stochastic and worst-case robust approximation.

Page 7: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

7

from cvxmod import *c=matrix((−1,1),(2,1))A=matrix((−1.5,0.25,3.0,0.0,−0.5,1.0,1.0,−1.0,−1.0,−1.0),(5,2))b=matrix((2.0,9.0,17.0,−4.0,−6.0),(5,1))x=optvar(’x’,2)p=problem(minimize(tp(c)*x),[A*x<=b])p.solve()

Program 1.1: lpsimple.py

· Polynomial and spline fitting.· Least-squares fit of a convex function.· Logistic regression.· Maximum entropy distribution with constraints.· Chebyshev and Chernoff bounds on probability of correct detection.· Ellipsoidal approximations of a polyhedron.· Centers of a polyhedron.· Linear discrimination.· Linear, quadratic and fourth-order placement.· Floor planning.· Optimal hybrid vehicle operation.· Truss design [Freund, 2004].

At this point, we present a very simple example. We will use CVX-MOD to solve the following linear program:

minimize y − x,subject to y 6 1.5x+ 2,

y 6 −0.25x+ 9,y > 3.0x− 17,y > 4,y > −0.5x+ 6.

We arrange the coefficient of the objective and constraints appropri-ately

c =

[−1

1

], A =

−1.5 10.25 1

3 −10 −1

−0.5 −1

, b =

29

17−4−6

,

Page 8: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

8 Introduction

(ε)3

(ε)2

(ε)1

(ε)0 (ε)4

Figure 1.2: (ε)0 : y = 3x/2 + 2, (ε)1 : y = −x/4 + 9, (ε)2 : y = 3x − 17,(ε)3 : y = 4, (ε)4 : y = −x/2 + 6

so we can rewrite the problem using a more efficient description. Nowthe objective can be written as cTx and all five constraints are included inAx 4 b.

Program 1.1 will provide the optimal solution, which is -3. In Fig-ure 1.2, one can get a better visualization of problem. The shaded areais the feasible region of the problem, determined by the constraints. Weseek the line y = x + α, that intersects the feasible set for the minimumvalue of α. The dashed line, is the optimal solution we are looking for.Since the program gave output -3, the dashed line will be

y = x− 3.

Page 9: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Chapter 2

Theoretical Background

The definition and results given below are mostly based on and in accor-dance with Boyd and Vandenberghe [2004].

For the sake of a better visual result, and also to maintain consistencybetween the mathematical formulation and the code implementation ofapplications, we will be using notation somewhat outside the pure math-ematical formalism. First of all, we will enumerate starting from zero,which means that all vector and matrix indices will start from zero andso will summations and products. Also, we will use the symbol ’’ for”probability” quantities, to denote complement with respect to 1. In otherwords, if λ∈ [0, 1] then λ = 1− λ.

2.1 Convex sets

A (geometrical) set C is convex, when for every two points that lie in C,every point on the line segment that connects them, also lies in C.

Definition 1. Let C ⊆ Rn. Then C is convex, if and only if for any x0, x1∈Cand any λ∈ [0, 1]

λx0 + λx1 ∈ C. (2.1)

The above definitions can be generalised inductively for more than twopoints in the set. So we can say that a set is convex, if and only if it containsall possible weighted averages of its points, which means all linear combina-tions of its points, with coefficients that sum up to 1. Such combinationsare also called convex combinations. The set

λ0x0 + · · ·+ λk−1xk−1 | xi ∈ S, i = 0 . . . k − 1, λi > 0,∑

06i<k

λi = 1, (2.2)

Page 10: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

10 Theoretical Background

is the set of all possible convex combinations of points of a set S and iscalled the convex hull of S. The convex hull is the smallest convex set thatincludes S. It could also be described as the intersection of all convexsets that include S. Convex sets are very common in geometry and veryimportant in numerous mathematical disciplines.

Affine sets

These are the most immediate, or even trivial example of convex sets.

Definition 2. A set A ⊆ Rn is affine, if for any x0, x1∈A and λ∈R

λx0 + λx1 ∈ A. (2.3)

What the definition formally states is that a set A is affine, if for anytwo points that lie in A, every point on the line through these two points,also lies in A. The simple example of an affine set, is of course the straightline. Affine sets are convex. However the converse is not true. Convexsets are not (in general) affine.

Hyperplanes

Definition 3. A hyperplane is a set of the form

x | aTx = b, (2.4)

where x, a∈Rn, b∈R and a 6= 0.

Geometrically speaking, a hyperplane is a translation of a subspace ofRn of dimension n − 1. Most importantly, its elements, as elements of Rn,are linearly dependent. For example, the hyperplanes of R2 will be thestraight lines. In R4, the hyperplanes will be 3-dimensional spaces. In R3

hyperplanes will be nothing more than normal planes. For that reason,from now forth we will use the term plane instead of hyperplane.

Definition 4. A (closed) halfspace, is a set of the form

x | aTx 6 b, (2.5)

where x, a∈Rn, b∈R and a 6= 0. If the inequality is strict, then we have anopen halfspace.

Page 11: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.1 Convex sets 11

PE

Figure 2.1: Left: A polyhedron in two dimensions, represented as the in-tersection of 5 halfspaces. Right: A three dimensional ellipsoid.

A plane divides the space in two halfspaces. For example the plane

x | aTx = b,

will divide Rn into the halfspaces x | aTx < b and x | − aTx < −b.Since planes are collections of linearly dependent points, they are affine

and consequently, they are convex. On the other hand, halfspaces are con-vex sets, but they are not affine, because they only include lines that areparallel to the boundary-plane.

Polyhedra

An intersection of halfspaces and hyperplanes is called a polyhedron. If apolyhedron is bounded, it can be called a polytope.

Definition 5. A polyhedron is a set of the form

P = x | aTi x 6 bi, i = 0, . . . ,m− 1, cjx = dj, j = 0, . . . , p− 1. (2.6)

The most immediate nontrivial example of a polyhedron in two dimen-sions, would a polygon, or just the interior of the polygon, if we demandstrict inequalities in the definition. Needless to say, that if the system ofequalities and inequalities in (2.6) have no solution, then the P will be theempty set.

Polyhedra are convex sets. A proof of this statement, would be a spe-cial case to the proof that intersections of convex sets are convex:

Page 12: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

12 Theoretical Background

Lemma 1. Any countable intersection of convex sets, is a convex set.

Proof. We will prove the statement for the intersection of two sets. Therest of the proof is simple induction. Let C,D be convex subsets of Rn. Letx0, x1∈C ∩D and let λ∈ [0, 1]

C ∩D ⊆ C ⇒ x0, x1 ∈ C ⇒

λx0 + λx1 ∈ C, (2.7)

C ∩D ⊆ D ⇒ x0, x1 ∈ D ⇒λx0 + λx1 ∈ D. (2.8)

(2.7) and (2.8)⇒λx0 + λx1 ∈ C ∩D.

A very important polyhedron in the field of mathematical optimizationis the simplex.

Definition 6. Let v0, v1, . . . vk∈Rn, k 6 n such that v1−v0, v2−v0, . . . vk−v0

are linearly independent. A simplex, is a set of the form

θ0v0 + · · ·+ θkvk | θj > 0, j = 0, . . . , k − 1,∑

06j<k

θj = 1. (2.9)

In two dimension, an example of a simplex can be any triangle and inthree dimensions any tetrahedron.

Norm Balls

A norm ball - or just ball, if the norm we are referring to is the Euclidean -is well known to be a set of the form

x ∈ Rn | ‖x− xc‖ 6 r. (2.10)

Point xc is the center of the norm ball, r ∈ R is its radius and ‖ ·‖ is anynorm on Rn.

It is easy to prove convexity of norm balls.

Proof. Let B be a norm ball, in other words, a set of the form (2.10). Letλ∈ [0, 1].

x0, x1 ∈ B ⇒ ‖x0 − xc‖ 6 r, ‖x1 − xc‖ 6 r

‖λx0 + λx1 − xc‖ = ‖λx0 + λx1 − λxc − λxc‖ 6

λ‖x0 − xc‖+ λ‖x1 − xc‖ 6 λr + λr = r.

Page 13: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.1 Convex sets 13

Ellipsoids

A generalization of the 2 dimensional conic section, the ellipse, is the ellip-soid. In 3 dimensions, it’s what one might describe as a melon-shaped set.A rigorous definition would be

Definition 7. An ellipsoid is a set of the form

xc + Au | ‖u‖2 6 1, (2.11)

where xc∈Rn is the center of the ellipsoid, A∈Rn×n is a square matrix and‖·‖2 is the Euclidean norm. If A is singular, the set is called a degenerateellipsoid.

A more practical definition of an ellipsoid will be given after definite-ness has been defined. If A was replaced by a real number r, then (2.11)would be an alternative representation of the Euclidean ball. Ellipsoidsare also convex:

Proof. Let E be a set of the form (2.11). Let λ ∈ [0, 1] and u0, u1 ∈ Rn with‖u0‖2, ‖u1‖2 6 1.

xc + Au0, xc + Au1 ∈ E ⇒

λxc + λAu0 + λxc + λAu1 = xc + A(λu0 + λu1

)∈ E ,

because‖λu0 + λu1‖2 6 λ‖u0‖2 + λ‖u1‖2 = 1.

Set convexity is preserved under intersection. It is also preserved un-der affine transformation, which is application of a function of the form

f : Rn → Rm : f(x) = Ax+ b.

In other words, if C is a convex subset of Rn, then the set

f(C) := f(x) | x ∈ C,

is a convex subset of Rm. What’s more, the inverse image of C under f :

f−1(C) := x | f(x) ∈ C,

is also a convex subset of Rn. Convexity is not however preserved underunion, or any other usual operation between sets.

Page 14: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

14 Theoretical Background

2.2 Definiteness

Let Sn be the set of square n× n symmetric matrices:

A ∈ Sn ⇔ AT = A.

Definition 8. A symmetric matrix A ∈ Sn is called positive semidefinite ornonnegative definite if for all its eigenvalues λi

λi > 0, i = 0, . . . , n− 1.

If the above inequality is strict, then A is called positive definite. If −A ispositive definite, A is called negative definite. If−A is positive semidefinite,then A is called negative semidefinite, or nonpositive definite.

The set of symmetric positive semidefinite matrices we will denote asSn+. The set of positive definite symmetric matrices, we will write as Sn++

(Also, we will note R+ for the non-negative real numbers and R++ for thepositive real numbers).

Lemma 2.

A ∈ Sn+ ⇔ ∀ x ∈ Rn, xTAx > 0, (2.12)A ∈ Sn++ ⇔ ∀ x ∈ Rn, xTAx > 0. (2.13)

Proof. Let λmin be the minimum eigenvalue of A. We use the property[Boyd and Vandenberghe, 2004, page 647] that for every x∈Rn

λminxTx 6 xTAx.

Then if λmin is positive, so will xTAx for all x∈Rn.

Definition 9. The Gram matrix associated with v0, . . . , vm−1, vi ∈ Rn, i =0, . . . ,m− 1 is the matrix

G = V TV, V = [v1 · · · vm−1],

so that Gij = vTi vj .

Theorem 1. Every Gram matrix G is positive semidefinite and for every positivesemidefinite matrix A, there is a set of vectors v0, . . . , vn−1 such that A is theGram matrix associated with those vectors.

Proof. (⇒)Let x∈Rn:

xTGx = xT (V TV )x = (xTV T )(V x) = (V x)T (V x) > 0.

(⇐) For this direction we use the fact that every positive semidefinite ma-trix A has a positive semidefinite ”square root” matrix B such that A = B2

[Horn and Johnson, 1985, pages 405,408]. Then A will be the Gram matrixof the columns of B.

Page 15: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.2 Definiteness 15

Solution set of a quadratic inequality

This example gives us good reason to present the following

Theorem 2. A closed set C is convex if and only if it is midpoint convex, whichmeans that it satisfies (2.1) for λ = 1/2.

Proof. One direction is obvious. If C is convex, then it will be midpointconvex. For the other direction, suppose C is closed and midpoint convex.Then, for every point in C, the midpoint also belongs in C. Now take twopoints in a, b∈C and let [a, b] be the closed interval from a to b, taken onthe line that connects the two points, with positive direction from a to b.We want to prove that x ∈ C ∀x ∈ [a, b]. Take the following sequence ofpartitions of [a, b]

Pn =

2n−1⋃k=0

[k

2na+

k

2nb,k + 1

2na+

k + 1

2nb

].

All lower and upper bounds of the closed intervals in Pn belong to C,from midpoint convexity. Take any point x∈ [a, b]. So x = λa+λb for someλ∈ [0, 1]. Then there is a closed interval in Pn, of length 1/2n that containsx. Now take the sequence of points in C,

xn = k

2na+

k

2nb∣∣x ∈ [

k

2na+

k

2nb,k + 1

2na+

k + 1

2nb].

If we let n → ∞, then xn → x. Since C is closed, then it must contain itslimit points. Thus x∈C.

We shall use this to prove that the set

C = x ∈ Rn | xTAx+ bTx+ c 6 0,

where b∈Rn and∈Sn, is convex for positive semidefinite A.

Proof. Since C is closed, we will prove that it is midpoint convex and thenuse Theorem 2, to show that it is convex. Let f(x) = xTAx + bTx + c. Letx0, x1 ∈ C ⇒ f(x0), f(x1) 6 0. All we need to show is that the midpoint

Page 16: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

16 Theoretical Background

(x0 + x1)/2∈C, or f((x0 + x1)/2)) 6 0.

f((x0 + x1)/2) =1

4(x0 + x1)TA(x0 + x1) +

1

2bT (x0 + x1) + c

=1

4xT0Ax0 +

1

4xT1Ax1 + c+

1

2xT0Ax1

=1

2(f(x0) + f(x1)) +

1

2xT0Ax1 −

1

4xT0Ax0 −

1

4xT1Ax1

=1

2(f(x0) + f(x1))− 1

4(x0 − x1)TA(x0 − x1)

6 0,

if A∈Sn+

2.3 Cones

Definition 10. A set Ω is called a cone, if

∀x ∈ Ω, λ > 0 λx ∈ Ω. (2.14)

If in addition, Ω is a convex set, then it is called a convex cone.

Lemma 3. A set Ω is a convex cone if and only if

∀x0, x1 ∈ Ω, λ0, λ1 > 0 λ0x0 + λ1x1 ∈ Ω, (2.15)

Proof. (⇒)Define

y :=λ0

λ0 + λ1

x0 +λ0

λ0 + λ1

x1 =λ0

λ0 + λ1

x0 +λ1

λ0 + λ1

x1.

Ω is convex, thus y∈Ω. Also, Ω is a cone, thus

(λ0 + λ1)y = λ0x0 + λ1x1 ∈ Ω

(⇐) If (2.15) is true, then if we choose λ1 = 0 we have shown that Ω satisiesthe cone property. And if we choose any λ0 ∈ [0, 1] and λ1 := λ0, we seethat Ω also satisfies the convex property.

Similarly, we can show that every combination with non-negative co-efficients of points of a cone, also lies in the cone. Such combinations arecalled conic or non-negative linear combinations. The set of all possible coniccombinations of points in a set S, is called the conic hull of S. And similarly

Page 17: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.3 Cones 17

with the convex hull of S, it is smallest convex cone that contains S. Forexample, in R2, the conic hull of the circle with centre (1,1) and radius 1, isthe first quadrant.

A very important example of a convex cone is the quadratic or second-order cone

C = (x, t) ∈ Rn+1 | ‖x‖2 6 t. (2.16)The proof follows a simple application of the triangular inequality. An-other important example of a convex cone, is the set Sn+: the set of sym-metric positive semidefinite matrices.

Proof. Let λ0, λ1∈R+ and A0, A1∈Sn+.

xT (λ0A0 + λ1A1)x = λ0xTA0x+ λ1x

TA1x > 0⇒λ0A0 + λ1A1 ∈ Sn+.

Definition 11. Let Ω be a convex cone that also satisfies the followingproperties:

1. Ω is closed.

2. Ω is solid, in other words, it has non-empty interior.

3. If x∈Ω and −x∈Ω then x = 0. (Ω is pointed).

Then we say that Ω is a proper cone.

Proper cones are very important to the definition of a partial orderingon Rn, or even on Sn. That is a non-trivial problem without a unique op-timal solution. There is also another type of cone we will be interested infurther on.

Definition 12. Let Ω be a cone. The set

Ω∗ = y | xTy > 0 for all x ∈ Ω, (2.17)

is called the dual cone of Ω.

The dual cone is very useful, as it has many desirable properties [Boydand Vandenberghe, 2004]:

1. Ω∗ is closed and convex.

2. Ω0 ⊆ Ω1 ⇒ Ω∗0 ⊇ Ω∗1.

3. If Ω has nonempty interior, then Ω∗ is pointed.

4. If the closure of Ω is pointed, then Ω∗ has nonempty interior.

5. Ω∗ is the closure of the convex hull of Ω.

Page 18: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

18 Theoretical Background

2.4 Generalised inequalities

As already mentioned, the purpose for introducing the notion of cones,was to be able to define a partial ordering for vectors and matrices. Thisway, we will be able to give meaning to expressions like matrix A is less thanmatrix B. The problem of defining a partial ordering in such spaces doesnot have a unique or even best solution. Here, we will give the partialordering that serves our needs, that is the needs of convex optimization.

Definition 13. Let Ω ⊆ Rn be a proper cone. Then the generalized inequalityassociated with Ω will be defined as

x 4Ω y ⇔ y − x ∈ Ω. (2.18)

We will manipulate the above ordering, as we do with ordering on realnumbers. We will write

• x <Ω y ⇔ x− y∈Ω.

• x ≺Ω y ⇔ y − x ∈ Ω, where Ω is the interior of the set Ω. In otherwords, Ω without the boundary.

We shall call the last relation, the strict generalized inequality.If Ω := R+, then we get the normal ordering of the real numbers. That

means that the generalized inequality we have defined, is indeed a gener-alization of the usual inequality in real number. That means that the usualordering in R can be considered as a special case of 4Ω. A very signifi-cant detail, however, is that the generalized ordering is a partial ordering,which means that not all elements of Rn will be necessarily comparable.In order to make use of the ordering we have just defined, we have todefine Ω to be the appropriate set for each case. To compare vectors, letΩ := Rn

+(the nonnegative orthant). Then the generalized inequality willbe equivalent to componentwise usual inequality of real numbers.

x 4Rn+y ⇔ xi 6 yi, i = 0, . . . , n− 1.

For symmetric matrices, let Ω := Sn+; the positive semidefinite cone. In thiscase

A 4Sn+B ⇔ B − A ∈ Sn+.

In the last two cases, we will drop the subscript, and imply in each casethe appropriate proper cone. This has the immediate advantage, that itequips us with a very compact notation for positive semidefinite matrices.

A < 0⇔ xTAx > 0 ∀x ∈ Rn. (2.19)

Page 19: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.5 Convex functions 19

2.5 Convex functions

Definition 14. Let D ⊆ Rn. A function f : D → R is convex if and only ifD is convex and for all x0, x1∈D and λ∈ [0, 1]

f(λx0 + λx1) 6 λf(x0) + λf(x1). (2.20)

We say f is strictly convex, if and only if, the above inequality, with x0 6= x1

and λ∈ (0, 1), is strict. If −f is (strictly) convex, then we say f is (strictly)concave. The above inequality is also called Jensen’s inequality.

Visually, a function is convex if the chord between any two points ofits graph is completely above the graph. There are cases of course, that thegraph of the function is a line, or a plane, or a multidimensional analogue.In this case, (2.20) holds trivially as an equation. What’s more, it holds for−f as well. These functions are called affine functions and have the form

f : Rn → Rm : f(x) = Ax+ b, (2.21)

where A∈Rm×n, x∈Rn and b∈Rm, and for the reason we just explained,are both convex and concave.

In order to give an immediate relation between convex sets and convexfuncitons, we need the following:

Definition 15. The epigraph of a function f : Rn ⊇ D → R, is the setdefined as

epi f = (x, t) | x ∈ D, f(x) 6 t ⊆ Rn+1.

The set Rn+1 \ epi f , in other words the set

hypo f = (x, t) | x ∈ D, f(x) > t ⊆ Rn+1.

is called the hypograph of f .

Sometimes, nonstrict inequality can be allowed in the definition of thehypograph of f . What’s important, is that the epigraph is the set of allpoints that lie ”above” the graph of f and the hypograph is the set of allpoints that lie ”below” the graph of f . A function f is convex, if and onlyif its epigraph is a convex set. And f is concave, if and only if its hypograph is aconvex set.

To determine convexity of functions, it is more efficient to use calculus,than the definition of convexity (under the hypothesis of course, that thefunction is differentiable). We can use the simple observation, that if afunction is convex, then the graph will always be above the tangent line,taken at any point of the domain of the function. To put it rigorously

Page 20: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

20 Theoretical Background

epi f

hypo f

f(x)

h(x)

g(x)

Figure 2.2: Left: Epigraph and hypograph of a function. Right: The graphof a convex (h) and a concave (g) function

Theorem 3. A differentiable function f : Rn ⊇ D → R is convex, if and only ifD is a convex set and

f(y) > f(x) +∇f(x)T (y − x), (2.22)

for all x, y∈D.

Equation (2.22) is also called the first order condition. In case that f isalso twice differentiable, the second order condition can also be used.

Theorem 4. LetH = ∇2f(x), be the Hessian of the twice differentiable functionf : Rn ⊇ D : R. Then f is convex if and only if D is a convex set, and

H < 0. (2.23)

In one dimension, the first and second order conditions, become

f(y) > f(x) + f ′(x)(y − x), (2.24)f ′′(x) > 0. (2.25)

Operations that preserve convexity

Here we present briefly a list of the most important operations that pre-serve convexity. Some are obvious, for the rest the proof can be found inBoyd and Vandenberghe [2004].

Page 21: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

2.5 Convex functions 21

• Nonnegative weighted sums: Let fi be convex functions and wi > 0 fori = 0, . . . ,m− 1. Then g is a convex function where

g = w0f0 + · · ·+ wm−1fm−1.

• Pointwise maximum and supremum: . Let fi be convex functions, i =0, . . . ,m− 1. Then g is a convex function, where

g = maxf0, . . . , fm−1.

• Scalar composition rules: (For all the results below, we suppose thatg(x) ∈ dom f .) Let f(x) be a convex function. Then f(g(x)) is aconvex function if

– g(x) is an affine function. That is a function of the form Ax+ b.

– g is convex and f is nondecreasing.

– g is concave and f is nonincreasing.

The rules for vector composition can be constructed if we apply theabove to every argument of f . Also we can find the rules that pre-serve concavity by just taking the dual (in the mathematical logicsense) propositions of the above (minimum instead of maximum, de-creasing instead of increasing, concave instead of convex, etc.).

Page 22: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

22 Theoretical Background

Page 23: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Chapter 3

Convex optimization

First of all, we introduce the basic concept behind mathematical optimiza-tion. An optimization problem, or program is a mathematical problem of theform

minimize f0(x)subject to fi(x) 6 bi, i = 1, . . .m.

(3.1)

We call f0(x) the objective function, fi(x) the constraint functions and x theoptimization variable. bi are normally called the limits or bounds for theconstraints. Normally, fi : Di → R, where Di ⊆ Rn, for i = 0, . . .m∈N. Ifthe domains Di are not the same set for all i, then we look for a solution inthe set D = ∪n−1

i=0 Di, under the condition of course that this is a nonemptyset. If D is nonempty, any x ∈ D that satisfies the constraints is calleda feasible point. If there is at least one such x, then (3.1) is called feasible.Otherwise, it is called infeasible. In case D0 = Rn and ∀x ∈D0, f0(x) = c,c∈R, then any x minimizes f0 trivially, as long as (3.1) is feasible. In thatcase, we only have to check that the constraints are consistent. In otherwords, verify that D is non-empty and then solve the following:

find xsubject to fi(x) 6 bi i = 1, . . . ,m.

(3.2)

This is called a feasibility problem. And any solution to (3.2), will be a feasi-ble point and vice versa. If we denote S, the solution set to (3.2), then theset F = S ∩D0 is called the feasible set of (3.1).

In the case that the constraint functions are omitted, then the problemis called an unconstrained optimization problem. Also, for some i > 0,there is the possibility that instead of the inequality, we have the equalityfi(x) = bi. If we incorporate the constraint bounds into the constraint

Page 24: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

24 Convex optimization

function and also rename appropriately, we can rewrite (3.1) in what iscalled standard form:

minimize f(x)subject to gi(x) 6 0 i = 0, . . . , p− 1

hi(x) = 0 i = 0, . . .m− 1.(3.3)

Now that we have the problem in standard form, we can express its solu-tion, or optimal value f ∗ as

f ∗ = inff(x) | gi(x) 6 0, i = 0, . . . , p− 1, hi(x) = 0, i = 0, . . . ,m− 1.

We call the x∗, such that f(x∗) = f ∗ the optimal point, or the global optimum.Of course, in this general case, there is a possibility that we also have localoptimal points. Which means that there is ε > 0 such that

f(x) = inff(z) | gi(z) 6 0, i = 0, . . . , p− 1, hi(z) = 0, i = 0, . . . ,m− 1,

‖z − x‖ 6 ε. (3.4)

Definition 16. Consider the optimization problem in standard form (3.3).Suppose that the following conditions are satisfied:

• The objective function is convex; in other words, f satisfies Jensen’sinequality (2.20).

• The inequality constraints gi, i = 0 . . .m−1 are also convex functions.

• The equality constraints are affine functions; that is functions of theform hi(x) = Aix+ bi, i = 0 . . . p− 1, A∈Rs×n, b∈Rs.

Then (3.3) is called a convex optimization problem (in standard form) or COP.

Theorem 5. Consider any convex optimization problem and suppose that thisproblem has a local optimal point. Then that point is also the global optimum.

Proof. [Boyd and Vandenberghe, 2004] Let x be a feasible and local optimalpoint for the COP (3.3). Then it satisfies (3.4). If it is not global optimum,then there is feasible y 6= x, and f(y) < f(x). That means that ‖y − x‖ > ε,otherwise, we would have f(x) 6 f(y). Consider the point

z = λx+ λy, λ =ε

2‖y − x‖.

Since the objectives and the constraints are convex functions, they haveconvex domains. By Lemma 1, the feasible set F of (3.3) is a convex set.Thus, z is also feasible. And by definition,

‖z − x‖ = ε/2 < ε,

Page 25: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

3.1 Quasiconvex optimization 25

so f(x) 6 f(z). But Jensen’s inequality for f gives

f(z) 6 λf(x) + λf(y) < f(x)

(because f(y) < f(x)). By contradiction, x is the global optimum.

This fact makes algorithms for solving convex problems much moresimple, effective and fast. The reason is that we have very simple optimal-ity conditions, especially in the differentiable case.

Theorem 6. Consider the COP (3.3). Then x is optimal, if and only if x is feasibleand

∇f(x)T (y − x) > 0, (3.5)

for all feasible y.

Proof. (⇒) Suppose x satisfies (3.5). Then if y is feasible, by (2.22) we havethat f(y) > f(x).(⇐) Suppose that x is optimal, but there is feasible y such that

∇f(x)T (y − x) < 0.

Then consider the point z = λ + λy, λ ∈ [0, 1]. Since the feasible set isconvex, then z is feasible. Furthermore

d

dλf(z)

∣∣∣∣λ=0

= ∇f(x)T (y − x) < 0,

which means that for small enough, positive λ, f(z) < f(x). That is acontradiction to the assumption that x was optimal.

For all the reasons mentioned above, it is only natural to try to ex-tend the use of convex optimization techniques. To succeed that, we usemathematical ‘tricks’ to transform some non-convex problems, into con-vex, whenever that is possible.

3.1 Quasiconvex optimization

Definition 17. Let f : Rn ⊇ D → R such that D is convex and for all α∈R,Sα := x∈D | f(x) 6 α are also convex sets. Then f is called quasiconvex.The sets Sα are called the α−sublevel, or just sublevel sets of f . If −f isquasiconvex, then f is called quasiconcave. If f is both quasiconvex andquasiconcave, then it is called quasilinear.

Page 26: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

26 Convex optimization

α

β

γ

SαSβ Sγ -

--

f(x)

Figure 3.1: A quasiconvex function f .

Quasiconvex functions could be loosely described as ”almost” convexfunctions. However they are not convex, which means that it is possiblefor a quasiconvex function to have non-global local optima. As a result,we can’t solve (3.3), for f quasiconvex, using convex problem algorithms.However, there is a method to approach these problems making use of theadvantages of convex optimization, and that is through convex feasibilityproblems.

Let φt(x) : Rn → R, t ∈R such that φt(x) 6 0 ⇔ f(x) 6 t and also φtis a nonincreasing function of t. We can easily find such an φt. Here is anoutline of how one might construct one:

φt(x) =

linear decreasing non-negative, x 6 inf St,0, x ∈ St,linear increasing non-negative, x > supSt.

If we also adjust the linear components of φt, such that it is continuousand nonincreasing in t, then it is easy to see that this is a convex functionsuch as the one we are looking for. Now consider the following feasibilityproblem

find xsubject to φt(x) 6 0

gi(x) 6 0 i = 0, . . . , p− 1hi(x) = 0 i = 0 . . .m− 1.

(3.6)

We still denote f ∗ as the optimal value of (3.3). But now we suppose thatf is quasiconvex and the restraints are as in the COP. Now, if (3.6) is fea-sible, then f ∗ 6 t. As a matter of fact f ∗ 6 f(x) 6 t. If it is not feasible,

Page 27: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

3.1 Quasiconvex optimization 27

def quasib(dn,up,eps,feas):’Bisection method for quasiconvex optimization’while up−dn>eps: # eps is the tolerance level

t=(dn+up)/2.0b=feas(t) # function feas solves the feasibility problem at the midpointif b==’optimal’:

up=telse:

dn=treturn t

Program 3.1: quasibis.py

then f ∗ > t. We can then construct a bisection method, such that startingwith a large interval that contains f ∗, we can find it (within given toler-ance boundaries) by solving a convex feasibility problem and bisectingthe initial interval.

Program 3.1 realizes that. After each step in the loop, the interval isbisected. Thus after k steps, it has length 2−k(up − dn). The operationends when that number gets smaller than ε. So the algorithm terminateswhen k > log2((up− dn)/ε).

3.1.1 Golden section search

Bisection is what we need for this operation we describe above. But wecan’t discuss optimization and not mention the golden section search. It is avery efficient technique for finding the extremum of a quasiconvex or qua-siconcave function in one dimension. In contrast to the bisection method,at each step the golden section search algorithm involves the evaluationof the function at three steps, and then an additional fourth one. After thecontrol, three points of these four are selected, and the procedure contin-ues.

The algorithm starts with input a closed interval [dn,up], which weknow contains the minimum and an internal point g0. Then find which oneof the intervals [dn, g0],[g0,up] is the largest and evaluate the function at aninternal point g1 of that interval. Then compare the value of the functionin the two points, g0 and g1 and repeat the step, with one of the triplets(dn, g1, g0) or (g0,up, g1). To ensure the fastest possible mean convergencetime, we choose g0 as the golden mean of up and dn (g0 = θdn+θup, whereθ = 2/(3 +

√5)). Hence the name of the method. For the same reasons g1

Page 28: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

28 Convex optimization

dn upg0 g1

f(x)

Figure 3.2: Golden section search

will be chosen to be dn− g0 + up, thus ensuring that up− g0 = g1 − dn.To be more precise take an example where we seek the minimum of a

quasiconvex function f (Figure 3.2). We begin with the interval [dn,up],which we know contains the minimum and the internal point g0. Fromthe choice of g0, [g0,up] will be the largest subinterval. Next we find g1

and compare f(g0) to f(g1). If the former is greater than the latter, repeatthe step with [g0,up] and g1. Otherwise repeat with [dn, g1] and g0. Thealgorithm is an extremely efficient one-dimensional localization methodand is closely related to Fibonacci search.

3.2 Duality

It is necessary, before introducing the notion of the dual problem, to givesome basic definitions.

Definition 18. Consider the optimization problem in standard form (3.3).Define the Lagrange dual function g : Rp × Rm → R as

g(λ, ν) = infx∈D

(f(x) +

p−1∑i=0

λigi(x) +m−1∑i=0

νihi(x)

), (3.7)

where D = dom(f) ∪p−1i=0 dom(gi) ∪m−1

i=0 dom(hi). The quantity whose infi-mum is taken, L(x, λ, ν) :=

(f(x) +

∑p−1i=0 λigi(x) +

∑m−1i=0 νihi(x)

), is called

the Lagrangian of the problem. The variables λ and ν are called the dualvariables and λi, νi the Lagrange multipliers associated with the ith inequal-ity and equality constraint accordingly.

Page 29: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

3.2 Duality 29

The reason to present the dual function is that it can be used to providea lower bound for the optimal value f ∗ of (3.3), for all λ < 0 and for all ν.

Proof. Consider a feasible point x for (3.3). Then gi(x) 6 0 for all i =0 . . . p− 1 and hi(x) = 0 for all i = 0 . . .m− 1. Take λ < 0. Then

p−1∑i=0

λigi(x) +m−1∑i=0

νihi(x) 6 0⇒ L(x, λ, ν) 6 f(x)⇒

g(λ, ν) = inf L(x, λ, ν) 6 L(x, λ, ν) 6 f(x).

What’s more, since g is the pointwise infimum of a family of affinefunctions of (λ, ν), it is always concave, even though (3.3) might not beconvex. This makes the search for a best lower bound a convex objective.

Definition 19. Consider (3.3), the optimization problem in standard form.Then the problem

maximize g(λ, ν)subject to λ < 0,

(3.8)

is called the Lagrange dual problem associated with (3.3). In that context, thelatter will also be referred to as the primal problem.

We can see, that for the reasons already mentioned, the dual problem isalways convex, even if the primal is not. Thus we can always get a lowerbound for the optimal value of any problem of the form (3.3), by solving aconvex optimisation problem.

Lemma 4 (Weak Duality). Let f ∗ be the optimal solution to the primal problem(3.3), and d∗ the optimal solution to the dual problem (3.8). Then, d∗ is always alower bound for f ∗ : f∗ > d∗.

We have already proven this property for all values of g. Thus it triv-ially holds for the maximum value of g. Even more useful is the propertythat holds when the primal is a convex problem. Then, under mild condi-tions, we have guaranteed equality and the dual problem is equivalent tothe primal. A simple sufficient such condition is Slater’s condition. That isthe existence of a feasible point x, such that gi(x) < 0 for all i such that giis not affine. The proof of the next theorem is given in Boyd and Vanden-berghe [2004].

Theorem 7 (Strong Duality). Let (3.3) be a convex optimization problem. Let(3.8) be its dual. If (3.3) also satisfies Slater’s condition, then f ∗ = d∗, where f ∗

and d∗ are the optimal values of the primal and the dual problem accordingly.

Page 30: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

30 Convex optimization

Many solvers in optimization software, rely on iterative techniquesbased on Theorem 7. They compute the value of the dual and the pri-mal objective on an initial point, find the difference between the two andif it is greater than some tolerance level, they continue and evaluate onthe next point, which is chosen based on the value of the gradient and theHessian. The operation terminates when the tolerance level is reached.

3.3 Linear programming

An important class of optimization problems is linear programming. In thisclass of problems, the objective function and the constraints are affine.Thus we have the general form:

minimize cTx+ dsubject to Gx 4 h

Ax = b,(3.9)

where G∈Rp×n, A∈Rm×n, c∈Rn, b∈Rp, h∈Rm and d∈R. The above is thegeneral form of a linear program, and will be referred to as LP. Since affinefunctions are convex, linear programming can be considered as a specialcase of convex optimization. However, it has been developed separately,and nowadays we have very efficient ways and algorithms to solve thegeneral LP. Note that the feasible set of an LP is a polyhedron.

Although (3.9) is in standard form as a COP, it is not in LP standardform. The standard form LP would be

minimize cTxsubject to Ax = b

x < 0.(LP)

There is also the inequality form LP which very often occurs.

minimize cTxsubject to Ax 4 b.

(3.10)

Now, given the standard form LP (LP), we can find its dual:

minimize bTysubject to ATy + z = c

z < 0.(3.11)

Page 31: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

3.3 Linear programming 31

x

f0(x)

f1(x)

f2(x)f3(x)

fi(x)

Figure 3.3: The objective function fi(x) = cix+di

eix+fifor a one dimensional

generalised linear fractional problem. For every value of x, the maximumis taken over all dashed curves. The result is a quasiconvex curve shownin bold.

3.3.1 Linear-fractional programming

If we replace the linear objective in (3.9) with a ratio of linear functions,then the problem is called a linear-fractional program.

minimizecTx+ d

eTx+ fsubject to eTx+ f > 0

Gx 4 hAx = b.

(LFP)

This problem is not convex any more, but quasiconvex. In this case how-ever, there is a more effective approach than the quasiconvex optimizationapproach. This problem can be transformed to an equivalent LP, with thecost of adding one more extra optimization variable and under the condi-tion that the feasible set of (LFP) is nonempty. Consider the LP

minimize cTy + dzsubject to Gy − hz 4 0

Ay − bz = 0eTy + fz = 1z < 0.

(3.12)

This problem is equivalent to (LFP) [Boyd and Vandenberghe, 2004]. Also,if we let x∗ and y∗, z∗ be the optimal points of these two problems, then

Page 32: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

32 Convex optimization

x∗F

f(x)

x∗

F

f(x)

Figure 3.4: Left: Quadratic Program. Right: Quadratically ConstraintQuadratic Program. The shaded region is the feasible set F , the thin curvesare the contour lines of the objective function f and x∗ is the optimal point.

x∗ = y∗ + z∗ and y∗ = x∗/(eTx∗ + f) and z∗ = 1/(eTx∗ + f).If we make one small alteration however, this problem becomes much

more difficult and no longer equivalent to LP. We can change the objective,into

max06i<ρ

cTi x+ dieTi x+ fi

,

which means that we have ρ linear fractional functions, whose maximumwe want to minimize. This problem is the generalised linear-fractional pro-gram and is also quasiconvex. We couldn’t however apply the transforma-tion to LP here, as it is possible that for different values of x, we get themaximum for different i (Figure 3.3). Thus, this problem is significantlyharder.

3.4 Quadratic programming

If the objective in (3.3) is a convex quadratic function and also the equal-ity constraint functions are affine, then we have a quadratic program (QP).If also the equality constraint functions gi are convex quadratic, then wehave a quadratically constrained quadratic program (QCQP). A QP and a QCQP

Page 33: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

3.5 Semidefinite programming 33

can have the forms

minimize 12xTPx+ qTx+ r

subject to Gx 4 hAx = b,

(QP)

minimize 12xTPx+ qTx+ r

subject to 12xTPix+ qTi x+ ri, i = 0, . . . , p− 1Ax = b,

(QCQP)

accordingly, where x∈Rn, P, P0, . . . , Pp−1∈Sn+, G∈Rp×n, A∈Rm×n, h∈Rp,b∈Rm, q∈Rn, r∈R.

A very well-known example of QP is the least-squares problem or regres-sion analysis, where the objective function is ‖Ax − b‖2

2. However, this un-constrained minimization problem does have an analytic solution. That isx = Cb, where

C = V Σ−1UT

andUΣV T is the singular value decomposition ofA [Boyd and Vandenberghe,2004, A.5.4].

3.4.1 Second-order cone programming

A generalization of the QCQP is the problem

minimize cTxsubject to ‖Aix+ bi‖2 6 eTi + di, i = 0, . . . , p− 1

Fx = g,(SOCP)

where x ∈ Rn, Ai ∈ Rni×n, bi ∈ Rni , c, ei ∈ Rn, di ∈ R, F ∈ Rm×n and g ∈ Rm.Problem (SOCP) is called a second-order cone program. The name is due tothe fact that we require (Aix + bi, e

Ti x + di) to lie in the second order cone

(2.16) for i = 0, . . . , p− 1.

3.5 Semidefinite programming

We can also allow generalised matrix inequalities for our constraints. Anoptimization problem with linear objective and affine constraints includ-ing equalities, inequalities and generalised inequalities, is called a conic

Page 34: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

34 Convex optimization

form problem or a cone program. We can easily include all inequality con-straints into one generalised matrix inequality constraint using simple lin-ear algebra. So we can write the general cone program as

minimize cTxsubject to Fx+ g 4Ω 0

Ax = b,(3.13)

where c, g, b are the vector parameters of the problem and F,A are matricesand Ω is a proper cone. Since proper cones are convex sets, this problemremains a convex optimization problem.

In the case that Ω = Sn+, the positive semidefinite cone, then (3.13) iscalled a semidefinite program or just SDP. In semidefinite programming,the inequality constraint can be interpreted as requiring for a symmetricmatrix to be positive semidefinite. The standard form for the SDP is

minimize cTxsubject to x0F0 + x1F1 + · · ·+ xn−1Fn−1 +G 4 0

Ax = b,(SDP)

where F0, F1, Fn−1, G∈Sn, A∈Rm×n and b, c∈Rn. We could see the SDP asa generalisation of the LP. As a matter of fact, if F0, . . . , Fn−1, G are alldiagonal, then (SDP) is a LP with n linear inequality and m linear equalityconstraints.

There has been much software developed for solving SDP. Due to thenature of the problem, these solvers very efficient and reliable [Bensonet al., 2000, Benson and Ye, 2008, Vandenberghe et al., 1998].

There are other types of convex optimization problems, like geometricprogramming, which we do not mention as we are not considering any ap-plications of these types in this report.

Page 35: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Chapter 4

Applications

In this chapter, we are presenting a set of real optimization problems thatwe try to understand better and if possible solve with our python tools. Weare attempting a new perspective on these problems, which will hopefullylead to better ways of solving them.

4.1 The Virtual Data Center problem

This problem was suggested to us by members of the BT ICT Researchteam as a yet unsolved problem related to a service which is still in theplanning process: Infrastracture as a Service. We consider M servers, pro-viding services via a network to N users. These servers could be Data Cen-ters equipped with powerful hardware and the users can be customers,who can use part of that equipment for their own business, for a lowercost than buying the equipment on their own. Information is being trans-ferred through a network. There is a cost for every user to connect to anyserver, which could be latency, or any other performance measure. The ob-jective is to assign users to servers, in a way that maximizes performanceby minimizing the connection cost. There are capacity constraints on theservers. For simplicity, we assume that all users take up the same amountof resources, so the constraint will be on the maximum amount of users aserver can be connected to. Another constraint, is that only one server canbe connected to each user. We don’t allow for a user to be connected tomore than one server.

In case that M = N , this is the Assignment problem, where N peoplehave to be assigned to do N jobs with cost αij for person i to do job j.If we were to allow any number of users to be connected to any numberof servers, this would be the general case of the Transportation Problem

Page 36: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

36 Applications

[Garvin, 1960].But let’s formulate this problem rigorously. Let C be the cost matrix we

described above. C will be M × N and cij will be the cost for user j to beconnected to server i. Our optimization variable X , will be also an M ×Nmatrix with elements 0, or 1. If element ij is 1, that will imply a connectionbetween server i and user j. There is also an M -dimensional vector a,whose ith element is the capacity of server i. Our objective then will be tominimize the sum over all rows of CTX , which is the total connection cost,under the condition that server i is connected to ai users at most.

In order to be consistent with the LP format and also to implement theproblem more easily, instead of the matrices C and X , we will use c, xwhich are both MN × 1 and are the same as the original problem parame-ters, only ”flattened”. To be more precise, the ijth element of C will be the(i mod M + j(N − 1))th element of c, and the same for X and x.

C =

c00 c01 · · ·c10

. . .... cMN

, X =

x00 x01 · · ·x10

. . .... xMN

−→ c =

c00

c10...

cM0

c01...

cM1...

, x =

x00

x10...

xM0

x01...

xM1...

.

This formulation is common in literature and the notation used is

c = vec(C), x = vec(X). (4.1)

We will use this notation to describe the above transformation from hereforth. After that formulation, the objective will just be cTx and we can nowgive the problem in standard LP form. To keep things as simple as possiblewe will denote k(i, j) = i mod M + j(N − 1):

minimize cTx

subject to∑

06i<M

xk(i,j) = 1, j = 0, . . . , N − 1∑06j<N

xk(i,j) 6 ai, i = 0, . . . ,M − 1

x > 0

(4.2)

The first constraint simply says that exactly one element of every columnof X must be non-zero, which means that exactly one connection is al-lowed per user. The second is just the capacity constraint on the data

Page 37: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.1 The Virtual Data Center problem 37

from cvxopt.base import matrix,spmatrixfrom cvxopt.solvers import lp

def VDCopt(n DC,n users,cost,capacity):ln,p,dict=len(capacity),n DC*n users,rindx=[0]*p+[[i+1]*n DC for i in xrange(n users−1)]rindx[p:]=[rindx[p:][i][j] for i in xrange(n users−1) for j in xrange(n DC)]cindx=range(p)+[range(n DC*(i+1))[i*n DC:(i+1)*n DC] for i in xrange(n users)]cindx[p:]=[cindx[p:][i][j] for i in xrange(n users−1) for j in xrange(n DC)]A=spmatrix(1.0,rindx,cindx)b=matrix(1.0,(n users,1))b[0]=n userscapr=[[p+i]*n users for i in xrange(ln)]caprindx=[capr[i][j] for i in xrange(ln) for j in xrange(n users)]capc=[range(p)[i::n DC] for i in range(ln)]capcindx=[capc[i][j] for i in xrange(ln) for j in xrange(n users)]G=spmatrix([−1.0]*p+[1.0]*(ln*n users),range(p)+caprindx,range(p)+capcindx)h=matrix([0.0]*p+capacity,(p+ln,1))a=lp(cost,G,h,A,b,solver=’glpk’)[’x’]dict[’Optimal value’]=(cost.T*a)[0]for i in xrange(p):

if a[i]>0.9: # give solution in the form “u j:(DC i,cost ij)”dict[’u_%d’%(i/n DC,)]=(’DC_%d’%(i%n DC,),cost[i])

return dict

if name ==’__main__’:cost=matrix([10.0, 22.0, 12.0, 21.0, 15.0, 25.0]) # [c00,c10,c01,c11,c02,c12]capacity=[2,2]print VDCopt(2,3,cost,capacity)

Program 4.1: VDCopt.py: A simplified function VDCopt which solves theVDC problem. Its arguments are the number of users and data centers,a matrix ”cost” which is as vec(C) in (4.1) and a list of integers, for thecapacity of each data center. In this example we have 3 users and 2 datacenters with capacity 2 for each. Although it would be cheaper for allthe users to be connected to the first data center (with corresponding costs10,12 and 15), the capacity constraint forces the solution: ’Optimal value’:46.0, ’u 2’: (’DC 0’, 15.0), ’u 1’: (’DC 1’, 21.0), ’u 0’: (’DC 0’, 10.0)

Page 38: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

38 Applications

Virtual Data Center optimal assignment (optimal value : 46)

DC_0(2)

u_2

15

u_0

10

DC_1(2)

u_1

21

Virtual Data Center optimal assignment (optimal value : 334)

DC_4(3)

u_1710

u_16

12

u_14

12

DC_9(5)

u_15

13

u_21

10

u_27 10

u_28

10

u_29

10

DC_7(7)

u_1313

u_10

10

u_2

12

DC_3(6)

u_1215

u_20

10

u_26

10

DC_0(4)

u_1111

u_25

10

u_4

11

DC_5(2)

u_19

13

u_3

10

DC_1(6)

u_18

11

u_22

12

u_2410

u_1

10

u_6

13

u_9

10

DC_2(5)

u_2316

u_0

10

u_8

10

DC_6(1) u_7

10

DC_8(1) u_5

10

Figure 4.1: The solution for the virtual data center problem. Left: the smallexample of Program 4.1. Right: a bigger example with 10 data centers and30 users. The numbers in brackets denote the capacity of every data center.The labels on the edges denote the cost of connection between data centeri and customer j.

centers. We don’t need to add any additional constraints to make x a 0,1vector, as the integer right hand sides of the constraints will force an inte-ger optimal solution (proof in [Garvin, 1960] pages 92,116) given that weuse the simplex method to calculate the solution. That is ensured by usingthe ’glpk’ optional solver in CVXOPT [Makhorin, 2003]. Then, the positiveconstraint, and the constraint of all elements in one column adding up to1, will allow any element to be either 0 or 1.

Program 4.1 gives a simple function VDCopt which solves (4.2) fora small example and returns a dictionary with the assignments and thevalue of the minimal cost. In our examples, we are using connection costvalues to be integers in the range of 10 and 25, which is realistic enoughif the cost is latency measured in hops (the number of intermediate routers, orpoints between the source and the target of transmission) and the internet, orany other extended network is used to provide the connections.

Page 39: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.1 The Virtual Data Center problem 39

4.1.1 Scalability

An important question to ask about such a network is: how does it scale,as the number of users grow? In other words, we would like to know forhow big a number of users, can our optimum configuration be consideredsatisfactory? That depends first of all on the characteristics of the networkitself.

We have considered two cases. First, we consider the case where thecapacities of the data centers came from a uniform-like distribution. Inthe second, we took the extreme case of having one big data center withlarge capacity and all the others were very small in comparison and practi-cally equivalent to each other. In both cases we range the number of usersfrom the same number as the data centers to the maximum capacity of thenetwork. The results are shown in Figure 4.2.

What we can conclude from the results, is that in the first case, the net-work corresponds extremely well to the increasing load of users. In plainterms, that means that the provider can guarantee performance to the cus-tomer. No matter how many users are added, even when the capacity ofthe network is reached, the user will never understand the difference.

In the second case, we see a completely different picture. For a smallnumber of users, the picture is similar to the previous case. However,there seems to be a critical number and when exceeded, the average cost,or cost per user increases dramatically. How soon that critical numberwill be reached, depends of course on the number of data centers. In thebottom right example in Figure 4.2, it may not even be reached even whenthe number of users exceeds 3000, although eventually it will.

What the above describe could be two different situations. We canimagine a company providing the data center service, trying to decidehow to set up their network. One choice would be to decide beforehandhow big the capacity of the network will ever have to be and distributethat almost evenly among their data centers. The other choice, would beto build one data centers in a place with high demand, at that present time,like an industrial city and small ones spread out on a wider area. The largedata center could be possibly upgraded in the future to cope with an in-crease in the number of customers. At that time, that might be the cheapestsolution, but as the number of customers grew, the first set-up would bethe most reliable and efficient.

Page 40: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

40 Applications

0 200 400 600 800 100010

11

12

13

14

15

16

17

number of users

cost

per

use

r

0 200 400 600 800 100010

11

12

13

14

15

16

17

number of users

cost

per

use

r

0 500 1000 1500 2000 2500 300010

11

12

13

14

15

16

17

number of users

cost

per

use

r

0 500 1000 1500 2000 2500 300010

11

12

13

14

15

16

17

number of users

cost

per

use

r

0 1000 2000 3000 4000 500010

11

12

13

14

15

16

17

number of users

cost

per

use

r

0 1000 2000 3000 4000 500010

11

12

13

14

15

16

17

number of users

cost

per

use

r

Figure 4.2: Scalability of the virtual data center problem. Top: 10 datacenters and users ranging from 10 to 1000. Middle: 30 data centers andusers ranging from 30 to 3000. Bottom: 50 data centers and users rangingfrom 50 to 5000. Left: Size of data centers uniformly distributed. Right :Most of the total network capacity is concentrated on one data center andthe rest is evenly distributed among the rest.

Page 41: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.2 The Lovasz ϑ function 41

4.2 The Lovasz ϑ function

We are interested in calculating the clique and the chromatic number of agiven graph. Finding the chromatic number of a graph is the same prob-lem as finding the minimum number of colours to be used in a map, so thatno two countries that share borders will have the same colour. Hence thename ”chromatic”. Another problem related with the chromatic number,would be the least number of channels to be used in a wireless communi-cations network, so that there will be no interference in the network.

4.2.1 Graph theory basics

First of all, let’s introduce some basic concepts about graphs. Intuitively, agraph is a set of nodes, some pairs of which are connected. Images cometo mind, varying from two connected dots, to complex representations ofnetworks (see Figure 4.3).

Definition 20. Let V be a set. Let E ⊆ V , where V is the set of all possiblepairs of elements of V . The ordered pair (V,E), is called the graph (orundirected graph) with vertices (or nodes) V and edges E. If the elementsof V are ordered pairs, then (V,E) is called a directed graph. We denoteG for the set of all graphs. (Note: Here, we will only discuss undirectedgraphs and for a finite set of vertices. So we will drop the characterization”undirected” and imply it whenever we write ”graph”.)

Definition 21. An induced subgraph of (V,E) is an ordered pair (U,D),where U ⊆ V , D ⊆ E ∩ U and U is the set of all possible pairs of elementsof U . (Note: Again, we are only going to consider induced subgraphs, sowe will drop the characterisation ”induced”, and just write ”subgraph”.We will also write F ⊆ G if and only if F is an induced subgraph of G.)

We have

‖V‖ =

(n

2

)=n(n− 1)

2,

where n = ‖V ‖. It is convenient notation to use an uppercase letter torepresent a graph. So we can define a graph asG = (V,E) or evenG(V,E),and for later reference we might just write graph G.

Let’s take an example. Let V = 0, 1, 2, 3, 4. Then

V = 0, 1, 0, 2, 0, 3, 0, 4, 1, 2, 1, 3, 1, 4, 2, 3, 2, 4, 3, 4.

Page 42: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

42 Applications

01

3

4

2

2 031

4

Figure 4.3: Left: a simple graph with 5 nodes and 7 edges. Right: itscomplement.

Let E = 0, 1, 0, 3, 0, 4, 1, 2, 1, 4, 2, 4, 3, 4. Now we can de-fine the graph G(V,E), whose graphic representation is shown in Figure4.3.

The labels of the nodes, are not important, in the sense that the sameexact graph, or ”shape” can be drawn using another set of edges. What isimportant however is the topology of the graph. Nor is it important thatwe chose natural numbers for the labels. As in the definition, V can be anyset, even not a subset of the real numbers. Here are some more definitionsthat will be useful further on.

Definition 22. Let G = (V,E) ∈ G. Define the graph G = (V, E), whereE = V \ E. Then G is called the complement of G.

Definition 23. Let G(V,E)∈G. If ω(F ) = χ(F ) for every F ⊆ G, then wesay G is perfect.

4.2.2 Two NP-complete problems

There are two problems related with graphs that we are interested in. Bothof them are NP-complete, which means that they cannot be solved in poly-nomial time. Following the notation given above we give the following.

Definition 24. A graph G(V,E) is complete, if E = V . A subgraph F of Gis called a clique if it is complete. The number of vertices in a largest cliqueof G is called the clique number of G. The minimum number of differentlabels that can be assigned to each node ofG, such that every label appearsin each clique at most once, is called the chromatic number of G.

Page 43: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.2 The Lovasz ϑ function 43

We will denote the clique number of a graph G by ω(G) and its chro-matic number by χ(G). As we’ve already mentioned, calculating ω and χfor an arbitrary graph, are two very complex problems. However, in spe-cial cases, there is a way to compute both those numbers in polynomialtime.

4.2.3 The sandwich theorem

In 1981, Grotschel, Lovasz, and Schrijver [Knuth, 1994] proved that for anygraph G, there is a real number that lies between ω(G) and χ(G), whichcan be calculated in polynomial time. The computation involves solving asemidefinite program for the complement of the graph and that makes ita convex optimization problem.

Definition 25 (The Lovasz ϑ function). Let G(V,E)∈G. Consider the fol-lowing optimization problem.

maximize trace1n1TnX

subject to xij = 0 for i, j∈EtraceX = 1X < 0,

(4.3)

where X = [xij]∈Rn×n, 1n is the n-dimensional column vector of all onesand n = ‖V ‖. Define ϑ : G → R such that ϑ(G) = f ∗, where f ∗ is theoptimal value of (4.3).

As given, (4.3) is not an SDP. But we can construct an equivalent SDP instandard form. First we note that trace1n1

TnX is just another way of writ-

ing∑

i,j xij . We can now force the traceX = 1 constraint, by demanding

xn−1,n−1 = 1−∑

06i<n−1

xii.

We can also enforce the xij = 0 for i, j∈E constraint a priori. Then ourobjective is simplified, as all elements of the diagonal will add to 1 and theresult will be ∑

i,j

xij = 1 + 2∑

i,j|i,j6∈E and i 6=j

xij.

And this is exactly the quantity we want to maximize. The factor of twowill appear, due to symmetry(i, j ∈E ⇔ j, i ∈E). Our problem now,would be maximizing the above quantity, under the condition that theoriginal matrix stays positive semidefinite. Let m = ‖E‖ and d = ‖V‖ −

Page 44: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

44 Applications

’’’Calculation of theta(G), forG=(0,1,2,3,4 , 0,1,0,3,0,4,1,2,1,4,2,4,3,4)’’’from cvxopt.solvers import sdpfrom cvxopt.base import matrix,spmatrix

def thetasmpl(n,m,ce):’Given the edges of the complement of G, returns theta(G)’d=n*(n−1)/2−m+nc=−matrix([0.0]*(n−1)+[2.0]*(d−n))Xrow=[i*(1+n) for i in xrange(n−1)]+[a[1]+a[0]*n for a in ce]Xcol=range(n−1)+range(d−1)[n−1:]X=spmatrix(1.0,Xrow,Xcol,(n*n,d−1))for i in xrange(n−1): X[n*n−1,i]=−1.0sol=sdp(c,Gs=[−X],hs=[−matrix([0.0]*(n*n−1)+[−1.0],(n,n))])return 1.0+matrix(−c,(1,d−1))*sol[’x’]

if name ==’__main__’:M,N=7,5 # the number of edges and nodes in Gcedges=[(0,2),(1,3),(2,3)] # list of the edges of the complement of Gprint thetasmpl(n=N,m=M,ce=cedges)

Program 4.2: graphex0opt.py. The program returns 2, which is the cliquenumber and the chromatic number of the complement of G.

m+n. This is the number of non-zero elements in X in the lower triangular(which is exactly ‖E‖) plus the elements of the diagonal. If we subtract onemore element, which will be xn−1n−1, since we made that redundant, wehave the dimension of our problem. That means that if our optimizationvariable is x, then x = [xk−1(0), xk−1(1), . . . , xk−1(d−1)]

T ∈Rd−1, where k is anyisomorphism

k : E ∪ 0, 0, 1, 1, . . . , n− 2.n− 2 → 0, 1, 2, . . . , d− 1.

Now let c be a (d− 1)-dimensional vector. That will be our multiplicationvector in our objective. To make cTx give the result we want, we put zerosin n − 1 places in c and twos in the rest. The positions of the zeros willcorrespond to the positions of the diagonal elements of X in x. We haveto leave the constant outside for now, but we can add it in the end. Thelast thing to do, is to construct the constraint X < 0. What is left nowis to place the elements of x back in their original place in X . Of course,in order to retain the standard form, we will have the constraint −X 4 0

Page 45: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.2 The Lovasz ϑ function 45

instead. So now we have the following problem

maximize cTx

subject to −∑

06i<d−1

xk−1(i)Hi −Hd−1 4 0, (4.4)

where Hi ∈ Rn×n, 0 6 i < d − 1 are matrices of all zeros except for theelement in position (k−1(i)) which will be 1. Also, if ci = 0 then the matrixHi will have a −1 in the last position (n − 1, n − 1). Finally, Hd−1 ∈ Rn×n

will be a matrix of all zeros, except for the element in the last position(n − 1, n − 1), which will be 1. Here’s an illustration of the problem’sparameters, where we place the diagonal elements of X in the first n − 1positions of x.

X =

x00 x01 · · ·x10

. . .... 1−

∑06i,j<n−1

xij

,c = [0, . . . , 0, 2, . . . , 2]T ∈ Rd−1, ci = 0⇔ i ∈ 0, 1, . . . , n− 1,

x = [x00, x11, . . . , xn−2n−2, . . . , xk(i), . . .]T , i ∈ n, n+ 1, . . . , d− 1,

Hs =

0 · · · 0... 1

...0 . . . −1

, Hr =

0 · · · 0... 1

...0 . . . 0

, Hd−1 =

0 · · · 0... . . . ...0 . . . 1

.where 0 6 s < n, n 6 r < d − 1 and the 1 in Hs and Hs goes in the k(s)th

and the k(r)th position accordingly. It can be seen that (4.4), is a SDPinstandard form, without the equality constraints. And if f ∗ is its optimalvalue, then ϑ(G) = f ∗ + 1. Program 4.2 gives a function to solves (4.4)for this example in a very simple but adequate way for now. (A betterfunction has been constructed to solve the problem and extract the datafor the results furtherdown.)

Theorem 8 (The sandwich theorem). Let G(V,E)∈G and let G(V, E) be itscomplement. Then

ω(G) 6 ϑ(G) 6 χ(G). (4.5)

(Proof in Lovasz [1979].) An immediate result of this theorem, is thatfor perfect graphs, χ and ω can be calculated in polynomial time, as the ϑfunction of the complement graph. But even for the general case, having alower bound for the chromatic number and an upper bound for the cliquenumber for any graph, is a big advantage. For historical reasons, here isthe original definition of ϑ as given in Lovasz [1979].

Page 46: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

46 Applications

Figure 4.4: A geometric random graph with 100 nodes.[.pdf picture gener-ated with generate grg graph.py, written by Dr. Keith M. Briggs.]

Definition 26. Let G(V,E)∈G. Also let

A := A∈Sn | aij = 0 if i, j ∈ E.

Denote λ0(A) > λ1(A) > . . . λn−1(A), the eigenvalues of A. Then

ϑ(G) = maxA∈A

∣∣∣∣1− λ0(A)

λn−1(A)

∣∣∣∣,where n = ‖V ‖.

4.2.4 Wireless Networks

We consider a wireless network with n transmitter-receiver devices in fixedarbitrary positions. We are not interested in all the technical details of themodel, except for the fact that every device receives or transmits informa-tion over a fixed radio frequency, or channel. For simplicity, we assumethat all devices have the same radius of transmission. This model can berepresented as a graph G(V,E), where V = 0, 1, . . . , n− 1 and i, j∈Eif and only if device i is within the transmission radius of device j (andvice versa of course). If we place n devices randomly on the plane andchoose the edges as described, what we have is a geometric random graph(Figure 4.4). Every clique in the graph represents a set of devices that canintercommunicate. That means, that every transmission of a device withinthe clique, will be detected by any other device in the clique, that receivesfrom the same channel.

Page 47: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.2 The Lovasz ϑ function 47

In most cases, this detection is undesired and considered interference.Then we must assign a different transmission channel to every device inthe same clique, to avoid interference. Even in cases when this detectionis desired, we still may have to assign channels in such a way that everydevice in the same clique transmits to a different channel.

Under the above constraints, the problem of finding the least numberof channels to be used in a wireless communications network is exactlythe problem of defining the chromatic number χ of the graph G, that rep-resents the network as described earlier. Then finding the ϑ number of thecomplement of G, will give us a lower bound on χ in polynomial time,as well as an upper bound on ω, the maximum number of devices in thesame transmission radius.

4.2.5 Statistical results

We were interested in investigating the distribution of the ϑ function overa random sample of graphs with roughly the same number of edges. Wechoose the geometric random graph model, because it is a realistic modelfor wireless communications applications.

We took a sample of M geometric random graphs of n nodes and ra-dius r. For every graph, the nodes where randomly placed in the unitsquare and we varied r from 0 to 1 with step 0.1. That meant that whenr = 0, no nodes would be connected, and the result would always be anempty graph. When r = 1, for every pair of nodes there was a probabilityp that they would be connected with an edge, with π/4 6 p 6 1. To takeone sample, we fixed n, r, generated the geometric random graph withthose attributes, computed its ϑ and repeated the operation M times. Wethen plotted the result in a histogram. We varied r as described and thusgenerated 10 histograms, which we plotted on the same graph. The resultsfor M = 500, n = 30 and M = 100, n = 80 are shown in Figure 4.5.

To interpret the result we take into consideration Theorem 8. In thecase of zero radius, the sample is consistent of M empty graphs. The com-plement of the empty graph, is a complete graph. The χ and ω numbers ofa complete graph are both equal to n, the number of nodes in the graph.This is simple to understand, as in a complete graph, the whole graph isa clique. Thus, the largest clique of the graph is the graph itself and thenumber of its nodes is ω = n. And it is straightforward to see how χ = nas well. On the other hand, when r = 1 most of the graphs in the samplewill be complete, or almost complete. That results in empty graph com-plements, which trivially have ω = χ = 1 or complements that only have

Page 48: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

48 Applications

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1

3

6

9

12

15182124273033363942

r

θ

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1

5

10

15

202530354045505560657075808590

Figure 4.5: Distribution of the ϑ function over 10 samples of geometricrandom graphs of 30 (left) and 80 (right) nodes on a logarithmic scale.

one edge, or a few but isolated edges, in which case ω = χ = 2. For all thecases in between, the best information we can acquire for ω and χ is theLovasz ϑ function, whose distribution we have illustrated in Figure 4.5.

4.2.6 Further study

Except for geometric random graphs and the apparent immediate applica-tions of that model, it is also very interesting to investigate the distributionof the ϑ function in a more theoretical level. For that purpose we will usea different random graph model, the Erdos-Renyi random graph. In short,G(n, p). As implied by the notation, in this model every edge appearsin the graph with probability p. For example, to generate a G(n, 0.5), wewould go through all possible pairs of the n nodes and every time wouldconnect them with an edge, depending on the outcome of a coin toss.

We computed the distributions of G(n = 50, 0 6 p 6 1) and plottedthem as shown in Figure 4.6. First of all we must stress the fact that al-though ω and χ take integer values, there is nothing in the definition to im-ply that for ϑ, except for perfect graphs. However, as shown in Figure 4.6,the distribution of ϑ is strongly concentrated on integer values, with non-integer values occurring less often but almost certainly. For example, weknow [Lovasz, 1979] that for cycle graphs with m nodes and m odd, thereis a closed formula. A cycle graph intuitively, is a graph that looks like aclosed chain. More formally, if Cm = G(V,E), where V = 0, . . . ,m− 1 is

Page 49: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.2 The Lovasz ϑ function 49

Figure 4.6: The distribution of ϑ over 1000 samples of 100 G(n, p) graphseach of n = 50 and 0 6 p 6 1. The horizontal axis is p and the verticalis the logarithm of ϑ(G). For every observed point a dot is drawn on thepicture. At first, the dot is blue. Whenever a dot has to be drawn on top ofan existing dot, the colour of the dot moves up the spectrum and closer tored. Thus, blue areas in the graph indicate the lowest frequency and redindicate the highest frequency.[Data and .png picture acquired in collaborationwith Dr. Keith M. Briggs]

Page 50: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

50 Applications

a cycle graph, then E = 0, 1, 1, 2, . . . , m− 2,m− 1, 0,m− 1. Forthese graphs then, if m is odd

ϑ(Cm) =m cos(π/m)

1 + cos(π/m). (4.6)

One hypothesis then would be that one case when non-integer ϑ occurs, iswhen the graph contains an m-cycle with m odd.

We could make more very interesting hypotheses. For instance, if oneobserves at the ϑ of small graphs in Figures 4.16 and 4.17, it seems thatwhenever a graph is consistent of smaller isolated subgraphs, the ϑ of thegraph is equal to the sum of the ϑ of its isolated subgraphs. The investiga-tion of these conjectures would make a very interesting research subject onits own and would much likely contribute to an even more efficient wayof computing the ϑ function.

Page 51: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.3 Optimal truss design 51

0.80

0.80

0.80 0.800.80

0.80

0.800.80

0.80

0.800.80

0.80

0.80

Figure 4.7: A very simple truss.

4.3 Optimal truss design

This example was inspired by ”Truss Design and Convex Optimization” [Fre-und, 2004]. A truss is a structure mathematically similar to a graph. Tobe precise, the set of trusses, could be considered as a subset of the setof graphs. Bridges are trusses and so are cranes, the roofs on big struc-tures, like train stations and football fields, and the Eiffel Tower. Sincethey are real constructions and not theoretical objects, they are either 2-dimensional or 3-dimensional. In this section, we are considering only 2-dimensional (rectangular) trusses. These examples are applicable mostlyto the design of bridges, but other applications can be found as well.

4.3.1 Physical laws of the system

A truss, as a graph object, consists of nodes and edges. The positions of thenodes are significant, as are the dimensions of the edges. We will refer tothe edges of a truss as bars, as it is consistent with the structural characterof the model. We will enumerate the nodes and the bars and denote thelength of bar k by Lk. Another important feature of the truss is the materialwe will use to construct it. To keep our model simpler and maybe morerealistic, we suppose that all bars are made of the same material. Thematerial the bars are made of determines the stiffness of the model. Ameasure of stiffness is Young’s modulus, denoted E or Y and measured inunits of pressure (pascal). Here is Young’s modulus for different material,in GPa (Gigapascal) [data taken from Wikipedia [2008c]:

Rubber 0.01-0.1Oak wood 11Bronze 103-124Titanium 105-120Steel 190

Page 52: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

52 Applications

Most nodes of the truss will be free to move, but naturally, some will befixed in place, or static. When an external force F is applied on a free node,the truss will deform elastically and some free nodes will displace. Thatcauses the bars to stretch or compress, which results on internal forces fkfrom the bars to be applied on the nodes they are connecting. These forcescounteract the external force. The equilibrium condition can be written as

Af = −F, (4.7)

where f is the vector of all internal forces fk and A is the projection matrix.The kth column of A corresponds to bar k. The rows of A correspond tothe horizontal, or vertical axis, taken once for every free node. Instead ofenumerating the rows of A it would be easier to label them. So if our trusshas 4 nodes and nodes 1, 3 are static, then the rows of A will be labeledas 0x, 0y, 2x, 2y, 4x, 4y. Now the jxi element of A will be the projectionof bar i onto the horizontal axis, with j taken as the origin, if j is one ofthe nodes that bar i connects. Otherwise it will be zero. Likewise for thejyi element. If we denote u the vector of displacements of the free nodes,given projected on the x and y axis, and t the vector of the volumes of thebars, then the internal force fk on bar k is given by

fk = − EL2k

tk(ak)Tu, (4.8)

where ak is the kth column of A. We note that −(ak)Tu is the first order

Taylor approximation of the distortion of bar k, which is acceptable forsuch small displacements of the nodes. The elastic energy stored in thetruss when under stress, which is the same as the work performed by theexternal force F that causes the stress on the truss is given by

1

2F Tu.

This quantity is also called the compliance of the truss.

4.3.2 The truss design optimization problem

Our objective is to construct the truss to be as stiff as possible. In otherwords make it resistant to external forces. Our problem then will be tofind which vector of volumes t will minimize the compliance. We alsohave to impose an upper bound on the total volume of bars, otherwise thesolution would be infinite volume for all bars. Such a constraint would

Page 53: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.3 Optimal truss design 53

express the fact that there is either finite resources to construct the truss,or even that the cost of the construction must not exceed a certain amount.We can now write the problem as:

minimize1

2F Tu

subject to[ m∑k=1

tkEkL2k

(ak)(ak)T

]u = F

Mt 4 dt < 0.

(4.9)

The first constraint is a result of the equilibrium conditions (4.7) and (4.8).The second is a linear equality constraint on the volumes of the bars, whichcan be the upper bound on the total volume as well as upper bounds onspecific bars. The last constraint only dictates that volumes are positivequantities. This is equivalent (proof in Freund [2004] pages 37-40) withthe following:

minimize θ

subject to

θ F T

F

[ m∑k=1

tkEkL2k

(ak)(ak)T

] < 0

Mt 4 dt < 0,

(4.10)

which is an SDP. There is also a SOCP equivalent of the problem, but weprefer the SDP for the reasons described in the end of Chapter 3. To illus-trate the SDP form of the problem above better and to be consistent withour definitions, we rewrite the problem as

minimize cTxsubject to diag(Mt− d,−t,−Q) 4 0,

(4.11)

where

Q =

θ F T

F

[ m∑k=1

tkEkL2k

(ak)(ak)T

] ,c = [1, 0, . . . , 0]T , x = [θ, t0, . . . , tm]T and diag(A0, . . . , As) is the block diag-onal matrix with blocks A0, . . . , As.

Page 54: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

54 Applications

4.3.3 Results

We have developed a python module (given in the Appendix) for CVX-OPT to solve this problem. Some interesting results are shown in Figures4.9-4.14. Of course our results are weak, in the sense that we don’t considervariables like construction difficulties, nor do we have the actual data toknow what material would be used or if we should take other factors intoaccount like seismic resistance, not to mention that the problems we solvedwere planar. The models below, show the solutions to the problem from amathematical point of view. However, such a theoretical model can proveuseful, as it can produce ideal designs, that may not be constructible, butinto which additional constraints and realistic parameters can be put, re-sulting to constructible solutions that are as close to the theoretical optimalsolution as possible.

The simplest Figure (4.9), resembles the kingpost design. The designwas used in Medieval, Queen Anne and Gothic Revival Architecture asroof support and has also been used in early aviation on wire-based air-crafts.

In Figure 4.13, we have the model for the Tyne bridge in Newcastle-Upon-Tyne. The bridge is supported on the ground, but the road is higher,close to the middle of the bridge. The actual bridge has a double archon top, whereas our model suggests that the optimal design should havethree or four arches. While experimenting with truss examples, the samepattern seemed to arise every time. Instead of the triangulation we areused to see in most trusses, like the Eiffel tower, or all cranes (Figure 4.11),the model tends to add extra thin layers next to layers that sustain most ofthe stress. A characteristic example is displayed in Figure 4.14.

Another interesting pattern, is the shape of the arch that seems to occurnaturally in the design of bridges. We took the bridge model shown inFigure 4.14 and tried to fit the points on the main arch in different models.The data seemed to fit almost perfectly to the catenary. That is a curve ofthe form α+β cosh γx and represents the shape of a hanging chain, or rope,when supported at its ends.

Page 55: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.3 Optimal truss design 55

min volmax vol min volmax vol

Figure 4.8: The legend for the figures below (left: in color, right: in gray-scale). Although line thickness is proportional to the actual thickness ofthe bars, color labeling is also used for the scaling volumes. A shade closerto red (black in gray-scale), means larger volume than a shade closer toblue (white). These figures are zoomable pdf pictures. In quadruple zoomlevel or above, one can see the actual volumes on the bars (in arbitraryunits). Nodes are drawn as small gray disks. Bigger black disks denotestatic nodes. Forces are drawn with black arrows.

8.29

2.76

2.76

2.76

2.76

2.76

8.29

Figure 4.9: The king post design. Photo taken from Wikipedia [2008a]

Page 56: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

56 Applications

3.50

0.780.78

3.50

2.72

0.780.78

2.72

1.94

0.780.78

1.94

1.17

0.780.78

1.17

0.39

0.780.78

0.39

4.86

8.10

4.86

8.10

4.86

4.86

4.86

3.24

3.24

4.86

8.10

8.10

Figure 4.10: Optimal hanging sign designs.

17.1

8

3.82

17.1

821

.00

3.82

3.82

21.0

024

.81

3.82

3.82

24.8

122

.27

2.54

2.54

22.2

7

25.45

12.7

215.91

19.0

922

.90

22.9

026

.72

26.7

217

.81

31.8

1

17.8

1

38.17

12.72

12.72

3.18

9.54

19.09

9.54

19.09

0.76

17.76

5.75 0.911.52

18.33

0.39

15.85

2.304.64

12.80

0.840.31

11.35

3.68 0.863.28

9.64

0.30

7.26

4.222.72

6.09

0.890.34

4.89

2.035.25

1.02

1.02

Figure 4.11: Optimal design for a simple crane.

Page 57: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.3 Optimal truss design 57

14.6182

6.81

38

9.7555

14.6182

31.6678

6.3336

11.3563

4.5425

14.6

182

14.6

182

1.95

11

6.3336

8.4447

13.8

617

44.9

402

31.6

678

10.6

149

31.3212

13.8

617

1.19

46

6.3336

6.0556

5.9729

44.9

402

2.7498

9.047912

.077

8

31.6678

6.03

89

3.6088

6.0389

12.6

671

3.6088

6.0389

31.6678

6.03

89

9.0479

31.3212

12.0778

44.9402

2.74

98

5.9729

44.9402

31.6678

6.3336

10.6149

6.0556

13.8

617

13.8

617

1.19

46

6.3336

8.4447

14.6

182

14.6

182

31.6

678

11.3

563

14.6

182

1.95

11

6.3336

4.5425

9.7555

14.6

182

6.8138

Figure 4.12: Optimal design for a train bridge.

4.36 67

.40

52.1

5

4.36

4.36

4.36

64.6

1

2.33

2.33

4.36

0.93

12.4

7

25.6

5

4.36

40.2

9

21.8

2

17.15

12.4

7

2.33

11.2

8

1.28

2.33

40.2

9

21.2

00.47

12.6

8

0.47

4.22 4.76

6.24

24.2

319.49

21.2

0

6.34

19.02

4.66

2.810.79

21.8

53.95

7.54

2.04

32.81

7.31 3.31

6.00

9.35

3.15 28.06

19.02

3.65

14.92

1.064.21

13.7933.78

2.12

0.56

0.15

1.003.09

5.61

39.28

2.72

27.17

2.68

2.68

0.99

1.26

19.89

1.97

19.69

4.36

4.36

3.58

0.86

3.38

0.40

10.13

4.36

4.36

4.36

0.86

4.06

1.32

0.13

21.92

8.63

9.01

4.36

4.36

1.78

2.62

2.81

1.61

1.30

2.24

28.11

2.22

15.14

2.68

2.81

1.33

2.24

2.22

1.61

28.11

15.14

4.36

4.36

1.78

0.86

8.63

2.62

1.32

1.30

21.92

19.89

9.01

19.69

4.36

4.36

4.36

0.86

4.06

0.40

3.09

0.13

10.13

39.28

27.17

4.36

4.36

3.58

1.26

1.97

3.38

1.00

33.78

2.68

0.56

5.61

2.68

0.99

2.72

6.00

14.92

13.79

2.12

3.65

1.06

4.66

0.15

4.21

2.81

3.31

28.06

19.02

9.35

6.24

7.31

3.95

3.15

32.81

0.79

7.54

4.76

2.04

19.49

21.85

19.02

0.47

2.33

4.22

6.34

24.23

21.20

17.15

1.2840.29

0.4721.20

12.68

2.33

40.29

21.82

12.47

2.33

11.28

64.61

0.932.33

12.47

25.65

67.40

4.36

52.15

4.36

4.36

4.36

4.36

4.36

Figure 4.13: The Tyne bridge model. Photo taken from Wikipedia [2008b]

Page 58: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

58 Applications

8.24

99

10.9

998

13.7497

8.24

99

10.9999

13.7497

10.5922

5.0923

6.3151

5.0923

7.51

61

4.7259

20.5

373

22.7

221

4.25

88

16.2599

257.

1419

10.8575

17.7244

3.4960

7.51

611.

6743

6.1837

7.5003

1.7035

2.0564

8.24

99

4.7259

1.95

65

26.8600

10.8182

15.9

452

2.5552

8.24

99

4.7259

0.69292.7257

3.6346

1.6083

0.81

82

12.2654

12.4209

96.4

476

6.79

61

3.9990

19.9948

4.6969

0.81

79

0.9242

91.8

264

12.0151

2.4531

15.9447

0.25

200.

0462

0.8225

0.9237

4.1126

11.44616.6014

4.08859.3937

61.7

663

73.2713

8.24

996.

6048

4.69

69

30.8831

92.6495

8.24

998.

2499

8.24

988.

2497

27.16912.7722

10.1668

3.67650.0022

13.4922

1.85

72

1.5982

1.85

711.

8571

0.93

31

3.5281

1.8202

0.004133.3106

18.2156

82.5004140.2476

7.41

97

1.8057

7.41

907.

4190

5.45

95

19.59440.0221

2.36

60

3.7666

2.36

602.

3660

2.36

592.

3659

2.36

592.

3659

1.34

92

3.0501

4.0477

8.24

99

3.7666

8.24

998.

2499

8.25

008.

2500

8.25

008.

2500

8.25

00

3.0501

28.7978

8.24

98

3.7666

8.24

988.

2498

8.24

988.

2499

8.24

998.

2499

8.24

99

3.0501

61.7973

8.24

98

3.7666

8.24

988.

2498

8.24

988.

2499

8.24

998.

2499

8.24

99

3.0501

28.7978

140.2476

8.24

99

3.7666

8.24

998.

2499

8.25

008.

2500

8.25

008.

2500

8.25

00

3.0501

4.0477

82.5004

2.36

60

1.8057

19.5

944

0.02

21

2.36

602.

3660

2.36

592.

3659

2.36

592.

3659

1.34

92

10.1668

13.4922

7.41

97

1.5982

3.52

81

7.41

90

0.00

41

7.41

905.

4595

33.3

106

1.8202

18.2

156

1.85

72

27.1

691

1.85

711.

8571

0.93

31

2.77

22

0.9237

3.67

65

6.6014

0.00

22

92.6495

73.2713

8.24

998.

2499

8.24

988.

2497

30.8

831

11.4461

12.0151

15.9447

8.24

996.

6048

0.8225

4.11

26

4.69

69

4.08

85

2.7257

9.39

37

4.6969

61.7663

0.25

20

3.9990

19.9

948

0.04

62

3.4960

0.6929

0.92

42

26.8600

0.8179

2.45

31

91.8264

6.79

60

4.7259

3.63

47

1.60

83

12.2

654

10.8574

12.4

209

17.7244

0.8182

96.4476

15.9452

8.24

99

4.7259

10.8

182

16.2599

1.9565

2.55

51

2.0565

257.1419

8.24

99

4.7259

20.5373

6.18

37

22.7221

7.5003

4.2587

1.7034

7.51

627.

5161

1.67

43

5.0923

13.7497

6.3151

10.9

999

10.5

922

13.7497

5.0923

8.24

99

10.9998

8.24

99

Figure 4.14: Optimal design for a road bridge.

−12 −11 −10 −9 −8 −7 −6 −5 −4 −3 −2 −1 0 1 2 3 4 5 6 7 8 9 10 11 12−8

−7

−6

−5

−4

−3

−2

−1

0

1

x

f(x)

Figure 4.15: Fitting of the arch of the model in Figure 4.14. The blue linerepresents the arch and the red line is the graph of f(x) = α − β cosh(γx).For this drawing the parameter values α = 4.2, β = 4.1, γ = 0.15 wereused. However in the fitting process, the standard errors came out around1, 1, 0.01 accordingly, which means that the data could be fitted by a widerange of catenary curves.

Page 59: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

4.4 Proposed research 59

4.4 Proposed research

4.4.1 Power allocation in wireless networks

We consider a problem taken from the field of wireless telecommunica-tions [Boyd and Vandenberghe, 2004, page 196]. Consider n pairs of trans-mitters (T x) and receivers (Rx), located in different positions in a closedarea. To be realistic, we must think that every transmitter is closer to itspair receiver, than to any other receiver. Every transmitter T xi is suppliedwith power pi. The signal power at Rx

j from T xi will be proportional to piand inversely proportional to some power of the distance Rx

j and T xi . Ofcourse at Rx

i , the only desirable signal is from T xi . The sum of all signalpowers from all T xj , j 6= i is considered interference.

Let G ∈ Rn×n be the matrix of all path gains from every transmitter toevery receiver. In short, that means thatGijpi will be the signal power fromT xi atRx

j . Let C be the matrix whose non-zero elements are on the diagonaland equal to the diagonal elements of G. Let also R = G − C. Obviously,I will differ with G only on the diagonal, the elements of which will beall zeros for R. Now let S = Cp and I = Rp, where p = [p0, . . . , pn−1]T

and S, I ∈ Rn. Then the (desired) signal power at Rxi will be Si and the

interference at Rxi will be Ii.

The objective here will be to have the best possible signal power withthe least possible interference at every receiver. Since we take the positionof the devices to be fixed, we can only vary p, which will be the optimiza-tion variable. If we also add noise σ to our model, the objective will be tomaximize

min06i<n

SiIi + σi

which is the minimum signal to interference plus noise ratio (SINR) over allreceivers. There will be upper bounds pmax ∈ Rn on the maximum powerto be allocated to every receiver (either due to legal restrictions or electri-cal capacity of the device), and also upper bounds pR ∈ Rn on the totalreceived power at every receiver. Now we can write the problem as

minimize max06i<n

−SiIi + σi

subject to p 4 pmax

Gp 4 pR

(4.12)

where we have used the obvious equivalence of minimizing over the max-imum of −SINR to maximizing over the minimum of SINR for the sake of

Page 60: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

60 Applications

consistency. Both inequalities are componentwise, as already discussed insection 2.4.

This problem is an example of generalised LFP and as such, it is quasi-convex. We have tried solving it as described in section 3.1, but the solverswe used seem to fail. We also tried different approaches than our pythontools, but we were unable to find a complete package designed to copewith this kind of problems. The difficulty is that the objective is not asmooth function. Discontinuities in the gradient, make the solvers weused produce irrelevant results, due to the fact that they rely on the gradi-ent methods which as it seems require a certain degree of smoothness.

Page 61: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Appendix

truss optimize 05.py A truss optimal design module for CVXOPT.

#!/usr/bin/python# optimize a truss design using semi-definite programming# Costas Skarakis 2008-07-23# theory from “Truss Design and Convex Optimization” by Robert M. Freund

from sys import argv,exitfrom math import pi,cos,sin,hypot,atan2from time import timefrom array import arrayimport randomimport cPickle

try:from cvxopt.base import matrix,spmatrix,spdiag,sparsefrom cvxopt.solvers import sdp

except:print ’cvxopt not found - please install from http://abel.ee.ucla.edu/cvxopt’exit(1)

try:from reportlab.pdfgen import canvasfrom reportlab.lib.colors import gray,blackgot reportlab=True

except:print ’ReportLab not found - please install from http://www.reportlab.org/’got reportlab=False

try:from hue import h2tuple

except:print ’No module hue - using grayscale’def h2tuple(h):

return (h,)*3

pictscale=33costpervolunit=1.0

class Graph:’A graph class’def init (s,E=[ ],n=1):

s.d=NoneE=flat(E)assert False not in [type(i)==int for i in E]assert len(E)%2==0assert True not in [E[i]==E[i+1] for i in range(len(E))[::2]]

Page 62: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

if not E:s.V=range(n)

else:s.V=range(max(E+[0])+1)

s.E=(array(’i’,list(E[::2])),array(’i’,list(E[1::2])))s.m=len(s.E[0])s.n=len(s.V)

def neg (s): # complement(graph)if not s.d:

s.d=dict([(i,[ ]) for i in s.V])#range(s.n)])for i,j in zip(s.E[0],s.E[1]):

s.d[i].append(j)s.d[j].append(i)

c=Graph(n=s.n)l=(s.n*(s.n−1))/2−s.ma0=array(’i’,[0]*l)a1=array(’i’,[0]*l)count=0for i in s.V:#range(s.n):

for j in s.V[i+1:]:#range(i+1,s.n): # i<j<nif not j in s.d[i]:

a0[count]=ja1[count]=icount+=1

c.E=(a0,a1)c.m=lc.n=s.nc.d=Nonereturn c

def str (s):r=’’if s.V==[0]: return rfor i in zip(s.E[0],s.E[1]):

r+=repr(i[0])+’--’+repr(i[1])+’ ’for i in s.V:

if i not in s.E[0] and i not in s.E[1]: r+=repr(i)+’ ’r+=’\n’return r[:−1]

def repr (s):r=’Graph([’for k,l in zip(s.E[0],s.E[1]):

r+=’(’+repr(k)+’,’+repr(l)+’)’+’,’if r[−1]==’,’:

r=r[:−1]r+=’])\n’return r[:−1]

def add (s,o):o=flat(o)assert False not in [type(i)==int for i in o]assert len(o)%2==0assert True not in [o[i]==o[i+1] for i in range(len(o))[::2]]s.m+=len(o)/2d=len(o)/2c=0for a in o:

if a not in s.V: c+=1s.V+=[0]*cc=0

Page 63: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

for a in o:if a not in s.V:

c+=1s.V[s.n+c−1]=a

s.V.sort()s.n=len(s.V)for r in o[::2]:

s.E[0].append(r)for r in o[1::2]:

s.E[1].append(r)return s

def iter (s):return iter(zip(s.E[0],s.E[1]))

def len (s):return len(s.E)/2

def add node(s,b): # b is redundants.n+=1s.V=range(n)s.d=None

def add nodes from(s,nbunch):b=flat(nbunch)s.n+=len(b)−1s.V=range(s.n)s.d=None

def add edges from(s,ebunch):b=flat(ebunch)s. add (b)

def add path(s,nlist):k=len(nlist)−1l=[(−1,−1)]*kfor i in range(k): l[i]=(nlist[i],nlist[i+1])l.sort()s.add edges from(l)

def delete node(s,n):if n in s.V:

s.n=s.n−1s.V=range(s.n)

def order(s):return s.n

def size(s):return s.m

def edges(s):l=[(s.E[0][i],s.E[1][i])for i in range(s.m)]return l

def nodes(s):return s.V

### end of class Graph ###

class Truss(Graph):’ A truss class ’

Page 64: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

def init (s,youngs modulus=2e6,Fd=,lnth=0,hght=0,dist=1,st=[ ],maxuv=0.8):Graph. init (s)s.dist=dists.bunch=[ ] # bunch of bars with volumes with upper boundss.bd=[ ] # the upper boundsif lnth and hght: # make rectangular truss

if not dist<=max(lnth,hght):print ’\nWarning: dist too large.\n’

def barlength(x,y):return hypot(x/hght−y/hght,x%hght−y%hght)

def allow(x,y):xj,yj=x%hght,y%hghtxi,yi=x/hght,y/hghta=(xj!=yj)b=(xi!=yi)c=((xj−yj)!=(xi−yi)) and ((xj−yj)!=(yi−xi))d=(min(lnth,hght)>2) or ce=(barlength(x,y)<=hypot(1,dist))f=abs(barlength(x,y)−hypot(1,1))<1e−14return a and b and c and e or f

h=hght+1l=lnth+1s.st=sts.lnth=lnths.hght=hghts.add nodes from(range(lnth*hght))nd=s.nodes()nd.sort()s.fr=[i for i in nd if i not in s.st]s.fr.sort()for k in range(lnth): s.add path(range(hght*k,hght*(k+1)))for k in range(hght): s.add path(nd[k::hght])s.add edges from([(x,y) for x in nd for y in nd[x:] if allow(x,y)])s.ls=s.edges()[:]s.ls.sort()s.L=dict([((i,j),barlength(i,j)) for i,j in s.ls])s.A=dict([(e,dict([((i,t),0.0) for i in s.fr for t in (’x’,’y’)])) for e in s.ls])for i,j in s.A: # create the projection matrix

sintheta=(j%hght−i%hght)/s.L[(i,j)]costheta=(j/hght−i/hght)/s.L[(i,j)]if i in s.fr:

s.A[(i,j)][i,’y’]=sinthetas.A[(i,j)][i,’x’]=costheta

if j in s.fr:s.A[(i,j)][j,’y’]=−sinthetas.A[(i,j)][j,’x’]=−costheta

keys,keysdeep=s.A.keys(),s.A[(0,1)].keys()keys.sort()keysdeep.sort()s.A=[[s.A[e][i] for i in keysdeep] for e in keys]

else:s.lnth=lnths.hght=hghts.st=st # the static nodes of the trusss.fr=[ ] # the free nodes of the trusss.ls=[ ] # the list of bars lexicographically sorteds.A=matrix([ ])s.L=

s.Y=[youngs modulus]*s.size() # stiffness of the barss.maxunitvol=maxuv # maximum volume of a bars.cost=maxuv*costpervolunit*s.size() # maximum costs.Fd=dict([((i,t),0.0) for i in s.fr for t in (’x’,’y’)])

Page 65: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

for i in Fd:s.Fd[i]=Fd[i]

s.optd=[maxuv]*s.size() # optimal design for bar volumes

def repr (s):r=’Truss(youngs_modulus=’if s.Y:

r+=s.Y[0]else:

r+=’2e6’r+=’,Fd=’+repr(s.Fd)+’,lnth=’+repr(s.lnth)+’,hght=’+repr(s.hght)+’,dist=’r+=repr(s.dist)+’,st=’+repr(s.st)+’,maxuv=’+repr(s.maxunitvol)+’)\n’return r[:−1]

def add forces(s,Fd):for i in Fd:

s.Fd[i]=Fd[i]

def bars(s):l=s.edges()return l

def add overall cost constraint(s,cost):s.cost=cost

def add edge constraints(s,ebunch,upbd):if not len(ebunch)==len(upbd):

print ’Constraint vectors of different sizes ignored.’s.bunch+=ebunchs.bd+=upbd

def clear constraints(s):s.bunch=[ ]s.bd=[ ]s.cost=s.maxunitvol*costpervolunit*s.size()

def solve(s):s.optd=minimum compliance sdp(s,s.Y,s.Fd,s.bunch,s.bd,s.cost)

def draw(s,pdf fn=’truss.pdf’):bridgeview(s,s.optd,s.Fd,pdf fn=pdf fn)

### end of class Truss ###

class Easytruss(Truss):def init (s,youngs modulus=2e6,Fd=,lnth=0,hght=0,dist=1,st=[ ],maxuv=0.8):

s.cFd=Fds.cst=stF,sta=,[ ]for k in st:

if type(k)==tuple:sta.append(drooc(k[0],k[1],hght))

else:sta.append(k)

for k in Fd.keys():if type(k[0])==tuple:

F[(drooc(k[0][0],k[0][1],hght),k[1])]=Fd[k]else:

F[k]=Fd[k]Truss. init (s,youngs modulus,F,lnth,hght,dist,sta,maxuv)if s.edges():

s.cnodes=dict([(coord(a,s.hght),a) for a in s.nodes()])

Page 66: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

s.cedges=dict([((coord(a,s.hght),coord(b,s.hght)),(a,b))for a,b in s.edges()])

def add forces(s,Fd):F=for k in Fd.keys():

if type(k[0])==tuple:F[(drooc(k[0][0],k[0][1],s.hght),k[1])]=Fd[k]

else:F[k]=Fd[k]

Truss.add forces(s,F)

def cbars(s):l=s.cedgesreturn l

def add edge constraints(s,cebunch,upbd):s.cbunch=cebunchebunch=[(−1,−1)]*len(cebunch)for i in range(len(cebunch)):

t=[−1,−1]for j in (0,1):

if type(cebunch[i][j])==tuple:t[j]=drooc(cebunch[i][j][0],cebunch[i][j][1],s.hght)

else:t[j]=cebunch[i][j]

ebunch[i]=(t[0],t[1])Truss.add edge constraints(s,ebunch,upbd)

def solve(s):s.optd=minimum compliance sdp(s,s.Y,s.Fd,s.bunch,s.bd,s.cost)

def draw(s,pdf fn=’truss.pdf’):bridgeview(s,s.optd,s.Fd,pdf fn=pdf fn)

### end of class Easytruss ###

def flat(seq,first=1):’ Removes depth levels from a sequence ’l=[ ]for t in seq:

try:t[0]l+=flat(t,0)

except:l.append(t)

return l

def minimum compliance sdp(T,Y,F,bunch=[ ],bd=[ ],cost=0.8):’’’Takes a truss object T, a material stiffness list Y, a forcelist F and solves the optimal truss design semidefiniteproblem. The maximum cost contraint is cost.Upper bounds on the volumes of certain bars listed in bunchcan be added in bd.’’’k=F.keys()k.sort()F=[F[i] for i in k]t0=time()m,n=T.size(),2*len(T.fr)print ’Number of variables: %g’%(m+1,)L=[T.L[i] for i in T.ls]

Page 67: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

pt,ro,co,pr,rw,cl=[ ],[ ],[ ],[ ],[ ],[ ]for i in range(2*len(T.fr)):

for j in range(m):if T.A[j][i]:

ro.append(i)co.append(j)pt.append(T.A[j][i])

A=spmatrix(pt,ro,co)Q=[(Y[k]/L[k]**2)*(A[:,k]*A[:,k].trans()) for k in range(m)]c=matrix([1.0]+[0.0]*m)if bunch and len(bunch)==len(bd):

pr=[1.0]*len(bunch)rw,cl=range(m+2,m+2+len(bunch)),[1+edgeno(T,i,j) for i,j in bunch]

else:bunch,bd=[ ],[ ]

Gl=spmatrix([−1.0]*m+[1.0]*m+pr,range(1,m+1)+[m+1]*m+rw,2*range(1,m+1)+cl,(m+2+len(rw),m+1))hl=matrix([0.0]+[0.0]*m+[cost]+bd)forth=spmatrix(−1.0,[0],[0],((n+1)*(n+1),1))fort=[−spdiag([0,q]) for q in Q]roc,cor=[0]*n,range(1,n+1)forF=−spmatrix(F+F,roc+cor,cor+roc)Gs=[sparse([[forth]]+[[f[::]] for f in fort])]hs=[matrix(forF)]print ’setup time: %f’%(time()−t0,)t0=time()try:

sol=sdp(c=c,Gl=Gl,hl=hl,Gs=Gs,hs=hs,solver=’dsdp’)except:

sol=sdp(c=c,Gl=Gl,hl=hl,Gs=Gs,hs=hs)print ’solve time: %f’%(time()−t0,)return sol[’x’][1::]

def edgeno(B,i,j):’’’Given a truss B and an edge (i,j), finds the numberof the edge, or prints an error message.’’’r,t=−1,−1for k in range(B.size()):

if B.ls[k]==(i,j):t=kr+=1

if t<0: print i,j,’not an edge’if r>0: print i,j,’multiple edge’return t

def bridgeview(B,v,Fd,eps=9e−4,save=True,filename=’_truss_optimize_last.data’,pdf fn=’truss.pdf’):’’’Takes a bridge object and a vector of weights and createsa pdf picture of the bridge with the thickness of thelines representing the bars, proportional to the thickness of the bars.The bars are coloured from blue to red, from the bar with theminimum volume up to the bar with the maximum volume.If save=True, the data from the last pictureare saved in filename and the picture can be redrawn usingdrawlast(filename).’’’if not got reportlab: returnpsc=pictscaleht,ln=B.hght,B.lnthif save:

f=open(filename,’w’)

Page 68: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

cPickle.dump((B.bars(),v,Fd,B.L,ln,ht,B.st,B.fr),f)f.write(’\n’)f.close()

u=v[:]v=[v[edgeno(B,i,j)]/B.L[(i,j)] for i,j in B.ls]re,gr,bl=h2tuple(0);re,gr,bl=h2tuple(1);c=canvas.Canvas(pdf fn,(psc*ln,psc*ht))coo=[(i/ht,i%ht,j/ht,j%ht,v[edgeno(B,i,j)],u[edgeno(B,i,j)],i,j) for i,j in B.ls]m,M=min(v),max(v)mc,Mc=min(u),max(u)n,N=min([abs(Fd[i]) for i in Fd]),max([abs(Fd[i]) for i in Fd])scale=1.0/(M−m)if Mc==mc:

scalec=1.0else:

scalec=1.0/(Mc−mc)if N==n:

elacs=1.0else:

elacs=1.0/(N−n)def pict(c):

c.setFont(’Helvetica’,10*psc/500.0)drawnode=[ ]for a,b,e,d,f,g,i,j in coo:

if g<eps:continue

drawnode+=[i,j]str=unicode(’%.2f’%g)c.setLineWidth(30*scale*(f−m)*psc/500.0)re,gr,bl=h2tuple(1−scalec*(g−mc))c.setStrokeColorRGB(re,gr,bl)c.line(psc*a+(psc/2.0),psc*b+(psc/2.0),psc*e+(psc/2.0),psc*d+(psc/2.0))c.translate((psc/2.0)*(a+e)+(psc/2.0),(psc/2.0)*(b+d)+(psc/2.0))c.rotate(abs(atan2(a−e,b−d))*180.0/pi−90)c.drawString(0,psc/100.0,str)c.rotate(−abs(atan2(a−e,b−d))*180.0/pi+90)c.translate(−(psc/2.0)*(a+e)−(psc/2.0),−(psc/2.0)*(b+d)−(psc/2.0))

c.setStrokeColorRGB(1,1,1)c.setLineWidth(2*psc/500.0)for i in B.st:

c.circle(psc*(i/ht)+(psc/2.0),psc*(i%ht)+(psc/2.0),psc/12.0,1,1)c.setFillGray(0.7)for i in B.nodes():

if i in drawnode:c.circle(psc*(i/ht)+(psc/2.0),psc*(i%ht)+(psc/2.0),psc/25.0,1,1)

for n in B.fr:if not [Fd[(n,s)] for s in (’x’,’y’)]==[0.0,0.0]:

arrow(c,n,Fd[(n,’x’)],Fd[(n,’y’)])def arrow(c,x,xh,xv):

c.setStrokeColor(black)c.setFillColor(black)h,v=elacs*(xh−n),elacs*(xv−n)c.setLineWidth(psc/100.0)sc=hypot(h,v)*psc/2.5i=x/htj=x%htc.translate(psc*i+(psc/2.0),psc*j+(psc/2.0))c.rotate(atan2(v,h)*180.0/pi)p=c.beginPath()p.moveTo(0,0)p.lineTo(sc,0)

Page 69: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

p.lineTo(sc−20*psc/500.0,20*psc/500.0)p.lineTo(sc−20*psc/500.0,−20*psc/500.0)p.lineTo(sc,0)c.drawPath(p,1,1)c.rotate(−atan2(v,h)*180.0/pi)c.translate(−psc*i−(psc/2.0),−psc*j−(psc/2.0))

pict(c)c.showPage()c.save()print ’acroread %s’%pdf fnprint ’evince %s’%pdf fn

def drawlast(filename=’_truss_optimize_last.data’):’ Draws picture recovered from data file. ’f=open(filename,’r’)T=Truss()barlist,T.optd,T.Fd,T.L,T.lnth,T.hght,T.st,T.fr=cPickle.load(f)f.close()T.add edges from(barlist)barlist.sort()T.ls=barlistT.draw()

def coord(i,h):if (type(i),type(h))!=(int,int):

print ’Taking integer part’i,h=int(i),int(h)

return i/h,i%h

def drooc(x,y,h):if y>h:

print ’y must be less than the height’return −1

slash=[i/h for i in range((x+1)*h+y*h)]modulus=[i%h for i in range((x+1)*h+y*h)]re=[i for i in range((x+1)*h+y*h) if slash[i]==x and modulus[i]==y]if len(re)!=1:

print ’Error’return re[0]

def example(no=0,fname=’truss_example_’):numberofexamples=7if no>=numberofexamples:

print ’List of examples available: ’,range(numberofexamples)elif no==0: ## 3X2 ##

st=[0,4]y=1e6Fd=Fd[(3,’y’)]=−1000.0T=Truss(youngs modulus=y,Fd=Fd,lnth=3,hght=2,dist=3,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==1: ## 2X5 ##st=[0,4]y=1000.0Fd=Fd[(2,’x’)]=−100.0T=Truss(youngs modulus=y,Fd=Fd,lnth=2,hght=5,dist=3,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==2: ## 5X2 ##st=[0,8]

Page 70: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

y=1000.0Fd=Fd[(3,’y’)]= 50.0Fd[(3,’x’)]=−100.0Fd[(7,’y’)]= 50.0Fd[(7,’x’)]= 100.0T=Truss(youngs modulus=y,Fd=Fd,lnth=5,hght=2,dist=3,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==3: ## 3X5 ##st=[0,10]y=1000.0Fd=Fd[(4,’y’)]=−1.0Fd[(4,’x’)]= 1.3T=Truss(youngs modulus=y,Fd=Fd,lnth=3,hght=5,dist=2,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==4: ## 9X4 ##st=[0,32]Fd=for i in range(4,32,4): Fd[(i,’y’)]=−1000.0T=Truss(Fd=Fd,lnth=9,hght=4,dist=3,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==5: ## 15X6 ##st=[12,18,66,72]Fd=for i in range(90)[2::6]: Fd[(i,’y’)]=−200.0T=Truss(Fd=Fd,lnth=15,hght=6,dist=4,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

elif no==6: ## 30X10 ##print ’This may take a few minutes...’st=[20,30,260,270]Fd=for i in range(300)[::10]:

if i not in st: Fd[(i,’y’)]=−1000.0T=Truss(Fd=Fd,lnth=30,hght=10,dist=4,st=st)T.solve()T.draw(pdf fn=fname+’%i.pdf’%no)

if name ==’__main__’:if len(argv)==1:

st=[(0,0),(2,0)]Fd=Fd[((1,1),’y’)]=−100B=Easytruss(Fd=Fd,lnth=3,hght=2,st=st)B.solve()B.draw()

else:job=int(argv[1])example(job)

The Lovasz number index of small graphs

[.pdf pictures provided by Dr. Keith M. Briggs.]

Page 71: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

1θ=2

2θ=1

3θ=3

4θ=2

5θ=2

6θ=1

7θ=4

8θ=3

9θ=3

10θ=3

11θ=2

12θ=2

13θ=2

14θ=2

15θ=2

16θ=2

17θ=1

18θ=5

19θ=4

20θ=4

21θ=4

22θ=4

23θ=3

24θ=3

25θ=3

26θ=3

27θ=3

28θ=3

29θ=3

30θ=3

31θ=3

32θ=3

33θ=3

34θ=3

35θ=3

36θ=3

37θ=3

38θ=2

39θ=2

40θ=2

41θ=2.236

42θ=2

43θ=2

44θ=2

45θ=2

46θ=2

47θ=2

48θ=2

49θ=2

50θ=2

51θ=1

52θ=6

53θ=5.001

54θ=5

55θ=5

56θ=5

57θ=5

58θ=4

59θ=4

60θ=4

61θ=4

62θ=4

63θ=4

64θ=4

65θ=4

66θ=4

67θ=4

68θ=4

69θ=4

70θ=4

71θ=4

72θ=4

73θ=4

74θ=4

75θ=4

76θ=4

77θ=4

78θ=4

79θ=4

80θ=4

81θ=4

82θ=4

83θ=4

84θ=4

85θ=4

86θ=4

87θ=3

88θ=4

89θ=3

90θ=3

91θ=3

92θ=3

93θ=3

94θ=3

95θ=3

96θ=3

97θ=3.236

98θ=3

99θ=3

100θ=3

101θ=3

102θ=3

103θ=3

104θ=3

105θ=3

106θ=3

107θ=3

108θ=3

109θ=3

110θ=3

111θ=3

112θ=3

113θ=3

114θ=3

115θ=3

116θ=3

117θ=3

118θ=3

119θ=3

120θ=3

121θ=3

122θ=3

123θ=3

124θ=3

125θ=3

126θ=3

127θ=3

128θ=3

129θ=3

130θ=3

131θ=3

132θ=3

133θ=3

134θ=3

135θ=3

136θ=3

137θ=3

138θ=3

139θ=3

140θ=3

141θ=3

142θ=3

143θ=3

144θ=3

145θ=3

146θ=3

147θ=3

148θ=3

149θ=3

150θ=3

151θ=3

152θ=3

153θ=3

154θ=3

155θ=3

156θ=3

157θ=3

158θ=3

159θ=3

160θ=3

161θ=3

162θ=3

163θ=3

164θ=3

165θ=3

166θ=3

167θ=3

168θ=2

169θ=3

170θ=2

171θ=2

172θ=2

173θ=2

174θ=2

175θ=2

176θ=2

177θ=2

178θ=2

179θ=2

180θ=2

181θ=2

182θ=2

183θ=3

184θ=2.236

185θ=2.236

186θ=2.236

187θ=2

188θ=2

189θ=2

190θ=2

191θ=2

192θ=2

193θ=2

194θ=2

195θ=2

196θ=2

197θ=2

198θ=2

199θ=2

200θ=2

201θ=2

202θ=2

203θ=2

204θ=2

205θ=2

206θ=2

207θ=1

Figure 4.16: The ϑ number of all small graphs of up to 7 nodes.

Page 72: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

1θ=7

2θ=6

3θ=6

4θ=6

5θ=6

6θ=6

7θ=6

8θ=5

9θ=5

10θ=5

11θ=5

12θ=5

13θ=5

14θ=5

15θ=5

16θ=5

17θ=5

18θ=5

19θ=5

20θ=5

21θ=5

22θ=5

23θ=5

24θ=5

25θ=5

26θ=5

27θ=5

28θ=5

29θ=5

30θ=5

31θ=5

32θ=5

33θ=5

34θ=5

35θ=5

36θ=5

37θ=5

38θ=5

39θ=5

40θ=5

41θ=5

42θ=5

43θ=5

44θ=5

45θ=5

46θ=5

47θ=5

48θ=5

49θ=5

50θ=5

51θ=5

52θ=5

53θ=5

54θ=5

55θ=5

56θ=5

57θ=5

58θ=4

59θ=5

60θ=4

61θ=4

62θ=4

63θ=4

64θ=4

65θ=4

66θ=4

67θ=4

68θ=4

69θ=4

70θ=4

71θ=4

72θ=4

73θ=4

74θ=4.236

75θ=4

76θ=4

77θ=4

78θ=4

79θ=4

80θ=4

81θ=4

82θ=4

83θ=4

84θ=4

85θ=4

86θ=4

87θ=4

88θ=4.001

89θ=4

90θ=4

91θ=4

92θ=4

93θ=4

94θ=4

95θ=4

96θ=4

97θ=4

98θ=4

99θ=4

100θ=4

101θ=4

102θ=4

103θ=4

104θ=4

105θ=4

106θ=4

107θ=4

108θ=4

109θ=4

110θ=4

111θ=4

112θ=4

113θ=4

114θ=4

115θ=4

116θ=4

117θ=4

118θ=4

119θ=4

120θ=4

121θ=4

122θ=4

123θ=4

124θ=4

125θ=4

126θ=4

127θ=4

128θ=4

129θ=4

130θ=4

131θ=4

132θ=4

133θ=4

134θ=4

135θ=4

136θ=4

137θ=4

138θ=4

139θ=4

140θ=4

141θ=4

142θ=4

143θ=4

144θ=4

145θ=4

146θ=4

147θ=4

148θ=4

149θ=4

150θ=4

151θ=4

152θ=4

153θ=4

154θ=4

155θ=4

156θ=4

157θ=4

158θ=4

159θ=4

160θ=4

161θ=4

162θ=4

163θ=4

164θ=4

165θ=4

166θ=4

167θ=4

168θ=4

169θ=4

170θ=4

171θ=4

172θ=4

173θ=4

174θ=4

175θ=4

176θ=4

177θ=4

178θ=4

179θ=4

180θ=4

181θ=4

182θ=4

183θ=4

184θ=4

185θ=4

186θ=4

187θ=4

188θ=4

189θ=4

190θ=4

191θ=4

192θ=4

193θ=4

194θ=4

195θ=4

196θ=4

197θ=4

198θ=4

199θ=4

200θ=4

201θ=4

202θ=4

203θ=4

204θ=4

205θ=4

206θ=4

207θ=4

208θ=4

209θ=4

210θ=4

211θ=4

212θ=4

213θ=4

214θ=4

215θ=4

216θ=4

217θ=4

218θ=4

219θ=4

220θ=4

221θ=4

222θ=4

223θ=4

224θ=4

225θ=4

226θ=4

227θ=4

228θ=4

229θ=4

230θ=4

231θ=4

232θ=4

233θ=4

234θ=4

235θ=4

236θ=4

237θ=4

238θ=4

239θ=4

240θ=4

241θ=4

242θ=4

243θ=4

244θ=4

245θ=4

246θ=4

247θ=4

248θ=4

249θ=4

250θ=4

251θ=4

252θ=4

253θ=4

254θ=4

255θ=4

256θ=4

257θ=4

258θ=4

259θ=4

260θ=4

261θ=4

262θ=4

263θ=4

264θ=4

265θ=4

266θ=4

267θ=4

268θ=4

269θ=4

270θ=4

271θ=4

272θ=4

273θ=4

274θ=4

275θ=4

276θ=4

277θ=4

278θ=4

279θ=4

280θ=4

281θ=4

282θ=4

283θ=4

284θ=4

285θ=4

286θ=4

287θ=4

288θ=4

289θ=4

290θ=4

291θ=4

292θ=4

293θ=4

294θ=4

295θ=4

296θ=4

297θ=4

298θ=4

299θ=4

300θ=4

301θ=4

302θ=4

303θ=4

304θ=4

305θ=4

306θ=4

307θ=4

308θ=4

309θ=4

310θ=4

311θ=4

312θ=4

313θ=4

314θ=4

315θ=4

316θ=4

317θ=4

318θ=4

319θ=4

320θ=4

321θ=4

322θ=4

323θ=4

324θ=4

325θ=4

326θ=4

327θ=4

328θ=4

329θ=4

330θ=4

331θ=4

332θ=4

333θ=4

334θ=4

335θ=4

336θ=4

337θ=4

338θ=4

339θ=4

340θ=4

341θ=4

342θ=4

343θ=4

344θ=4

345θ=4

346θ=4

347θ=4

348θ=3

349θ=4

350θ=3

351θ=3

352θ=3

353θ=3

354θ=3

355θ=4

356θ=3.236

357θ=3

358θ=4

359θ=3

360θ=3

361θ=3.236

362θ=3

363θ=3

364θ=4

365θ=3

366θ=3

367θ=3

368θ=3

369θ=3

370θ=3

371θ=3

372θ=3

373θ=3

374θ=3

375θ=3

376θ=3

377θ=4

378θ=3.002

379θ=3

380θ=3

381θ=3

382θ=3

383θ=3

384θ=3

385θ=3

386θ=3

387θ=3

388θ=3

389θ=3

390θ=3

391θ=3.196

392θ=3

393θ=3

394θ=3

395θ=3

396θ=3

397θ=3

398θ=3

399θ=3

400θ=3

401θ=3

402θ=3

403θ=3

404θ=3

405θ=3

406θ=3

407θ=3

408θ=3

409θ=3

410θ=3

411θ=3

412θ=3

413θ=3

414θ=3

415θ=3

416θ=3

417θ=3

418θ=3

419θ=3

420θ=3

421θ=3

422θ=3

423θ=3

424θ=3

425θ=3

426θ=3

427θ=3

428θ=3

429θ=3

430θ=3

431θ=3

432θ=3

433θ=3

434θ=3

435θ=3

436θ=3

437θ=3

438θ=3

439θ=3

440θ=3

441θ=3

442θ=3

443θ=3

444θ=3

445θ=3

446θ=3

447θ=3

448θ=3

449θ=3

450θ=3.317

451θ=4

452θ=3

453θ=3

454θ=3.236

455θ=3

456θ=3.236

457θ=3

458θ=4

459θ=3

460θ=3

461θ=3

462θ=3

463θ=3

464θ=3

465θ=3

466θ=3

467θ=3

468θ=3

469θ=3

470θ=3

471θ=3

472θ=3

473θ=3.236

474θ=4

475θ=3.236

476θ=3.236

477θ=3.236

478θ=3.236

479θ=3.236

480θ=3.236

481θ=3.236

482θ=3

483θ=3

484θ=3

485θ=3

486θ=3

487θ=3

488θ=3

489θ=3

490θ=3

491θ=3

492θ=3

493θ=3

494θ=3

495θ=3

496θ=3

497θ=3

498θ=3

499θ=3

500θ=3

501θ=3

502θ=3.196

503θ=3.064

504θ=3

505θ=3

506θ=3

507θ=3

508θ=3

509θ=3

510θ=3

511θ=3

512θ=3

513θ=3

514θ=3

515θ=3

516θ=3

517θ=3

518θ=3

519θ=3

520θ=3

521θ=3

522θ=3

523θ=3

524θ=3

525θ=3

526θ=3

527θ=3

528θ=3

529θ=3

530θ=3

531θ=3

532θ=3

533θ=3

534θ=3

535θ=3

536θ=3

537θ=3

538θ=3

539θ=3

540θ=3

541θ=3

542θ=3

543θ=3

544θ=3

545θ=3

546θ=3

547θ=3

548θ=4

549θ=3

550θ=3

551θ=3

552θ=3

553θ=3

554θ=3

555θ=3

556θ=3

557θ=3

558θ=4

559θ=3.236

560θ=3

561θ=3

562θ=3

563θ=3

564θ=3

565θ=3

566θ=3

567θ=3

568θ=3

569θ=3

570θ=3

571θ=3

572θ=3

573θ=3

574θ=3

575θ=3

576θ=3

577θ=3

578θ=3

579θ=3

580θ=3

581θ=3

582θ=3

583θ=3

584θ=3

585θ=3

586θ=3

587θ=3

588θ=3

589θ=3

590θ=3

591θ=3

592θ=3

593θ=3

594θ=3

595θ=3

596θ=3

597θ=3

598θ=3

599θ=3

600θ=3

601θ=3

602θ=3

603θ=3

604θ=3

605θ=3

606θ=3

607θ=3

608θ=3

609θ=3

610θ=3

611θ=3

612θ=3

613θ=3

614θ=3

615θ=3

616θ=3

617θ=3

618θ=3

619θ=3

620θ=3

621θ=3

622θ=3

623θ=3

624θ=3

625θ=3

626θ=3

627θ=3

628θ=3

629θ=3

630θ=3

631θ=3

632θ=3

633θ=3

634θ=3

635θ=3

636θ=3

637θ=3

638θ=3

639θ=3

640θ=3

641θ=3

642θ=3

643θ=3

644θ=3

645θ=3

646θ=3

647θ=3

648θ=3

649θ=3

650θ=3

651θ=3

652θ=3

653θ=3

654θ=3

655θ=3

656θ=3

657θ=4

658θ=3

659θ=3

660θ=3

661θ=3

662θ=3

663θ=3

664θ=3

665θ=3

666θ=3

667θ=3

668θ=3

669θ=3

670θ=3

671θ=3

672θ=3

673θ=3

674θ=3

675θ=3

676θ=3

677θ=3

678θ=3

679θ=3

680θ=3

681θ=3

682θ=3

683θ=3

684θ=3

685θ=3

686θ=3

687θ=3

688θ=3

689θ=3

690θ=3

691θ=3

692θ=3

693θ=3

694θ=3.196

695θ=3

696θ=3

697θ=3

698θ=3

699θ=3

700θ=3

701θ=3

702θ=3

703θ=3

704θ=3

705θ=3

706θ=3

707θ=3

708θ=3

709θ=3

710θ=3

711θ=3

712θ=3

713θ=3

714θ=3

715θ=3

716θ=3

717θ=3

718θ=3

719θ=3

720θ=3

721θ=3

722θ=3

723θ=3

724θ=3

725θ=3

726θ=3

727θ=3

728θ=3

729θ=3

730θ=3

731θ=3

732θ=3

733θ=3

734θ=3

735θ=3

736θ=3

737θ=3

738θ=3

739θ=3

740θ=3

741θ=3

742θ=3

743θ=3

744θ=3

745θ=3

746θ=3

747θ=3

748θ=3

749θ=3

750θ=3

751θ=3

752θ=3

753θ=3

754θ=3

755θ=3

756θ=3

757θ=3

758θ=3

759θ=3

760θ=3

761θ=3

762θ=3

763θ=3

764θ=3

765θ=3

766θ=3

767θ=3

768θ=3

769θ=3

770θ=3

771θ=3

772θ=3

773θ=3

774θ=3

775θ=3

776θ=3

777θ=3

778θ=3

779θ=3

780θ=3

781θ=3

782θ=3

783θ=3

784θ=3

785θ=3

786θ=4

787θ=3

788θ=3

789θ=3

790θ=3

791θ=3

792θ=3

793θ=3

794θ=3

795θ=3

796θ=3

797θ=3

798θ=3

799θ=3

800θ=3

801θ=3

802θ=3

803θ=3

804θ=3

805θ=3

806θ=3

807θ=3

808θ=3

809θ=3

810θ=3

811θ=3

812θ=3

813θ=3

814θ=3

815θ=3

816θ=3

817θ=3

818θ=3

819θ=3

820θ=3

821θ=3

822θ=3

823θ=3

824θ=3

825θ=3

826θ=3

827θ=3

828θ=3

829θ=3

830θ=3

831θ=3

832θ=3

833θ=3

834θ=3

835θ=3

836θ=3

837θ=3

838θ=3

839θ=3

840θ=3

841θ=3

842θ=3

843θ=3

844θ=3

845θ=3

846θ=3

847θ=3

848θ=3

849θ=3

850θ=3

851θ=3

852θ=3

853θ=3

854θ=3

855θ=3

856θ=3

857θ=3

858θ=3

859θ=3

860θ=3

861θ=3

862θ=3

863θ=3

864θ=3

865θ=3

866θ=3

867θ=3

868θ=3

869θ=3

870θ=3

871θ=3

872θ=3

873θ=3

874θ=3

875θ=3

876θ=3

877θ=3

878θ=3

879θ=3

880θ=3

881θ=3

882θ=3

883θ=3

884θ=3

885θ=3

886θ=3

887θ=3

888θ=3

889θ=3

890θ=3

891θ=3

892θ=3

893θ=3

894θ=3

895θ=3

896θ=3

897θ=3

898θ=3

899θ=3

900θ=3

901θ=3

902θ=3

903θ=3

904θ=3

905θ=3

906θ=3

907θ=3

908θ=3

909θ=3

910θ=3

911θ=3

912θ=3

913θ=3

914θ=3

915θ=3

916θ=3

917θ=2

918θ=3

919θ=2

920θ=2

921θ=2

922θ=3

923θ=3

924θ=3

925θ=3

926θ=3

927θ=3

928θ=3

929θ=3

930θ=3

931θ=3

932θ=3

933θ=2

934θ=2.236

935θ=3

936θ=2

937θ=2

938θ=2

939θ=2

940θ=3

941θ=2

942θ=2

943θ=2

944θ=2

945θ=2

946θ=2

947θ=2

948θ=2

949θ=2

950θ=2

951θ=2

952θ=2

953θ=2

954θ=2

955θ=2

956θ=3

957θ=2

958θ=3

959θ=2

960θ=3

961θ=2

962θ=2

963θ=2

964θ=3

965θ=2.236

966θ=2.236

967θ=3

968θ=2.236

969θ=2.236

970θ=2.236

971θ=2.236

972θ=2.236

973θ=2.236

974θ=2

975θ=2.236

976θ=2

977θ=2

978θ=2

979θ=2

980θ=2

981θ=2

982θ=2

983θ=2

984θ=2

985θ=2

986θ=2

987θ=2

988θ=2

989θ=2

990θ=2

991θ=2

992θ=2

993θ=2

994θ=3

995θ=2.236

996θ=2.236

997θ=2.236

998θ=2.236

999θ=2.236

1000θ=2.236

1001θ=2.236

1002θ=3

1003θ=2

1004θ=2.236

1005θ=2

1006θ=2

1007θ=2.109

1008θ=2

1009θ=2

1010θ=2

1011θ=2

1012θ=2

1013θ=2

1014θ=2

1015θ=2

1016θ=2

1017θ=2

1018θ=2

1019θ=2

1020θ=2

1021θ=2

1022θ=2

1023θ=2

1024θ=2

1025θ=2

1026θ=2

1027θ=2

1028θ=2

1029θ=2

1030θ=2

1031θ=2

1032θ=2

1033θ=2

1034θ=2

1035θ=2

1036θ=2

1037θ=2

1038θ=2

1039θ=2

1040θ=2

1041θ=2

1042θ=2

1043θ=2

1044θ=1

Figure 4.17: The ϑ number of all graphs of 7 nodes.

Page 73: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Bibliography

Steven J. Benson and Yinyu Ye. Algorithm 875:DSDP5: Software forsemidefinite programming. ACM Transactions on Mathematical Soft-ware, 34(3), 2008. URL http://doi.acm.org/10.1145/1356052.1356057.

Steven J. Benson, Yinyu Ye, and Xiong Zhang. Solving large-scale sparsesemidefinite programs for combinatorial optimization. SIAM Journal onOptimization, 10(2):443–461, 2000.

Stephen Boyd and Lieven Vandenberghe. Convex Optimization. CambridgeUniversity Press, 2004.

Robert M. Freund. Truss design and convex optimization.Technical report, Massachusetts Institute of Technology,April 2004. URL http://ocw.mit.edu/NR/rdonlyres/Sloan-School-of-Management/15-094JSpring-2004/2172F2C6-E4DB-45EB-AFD3-36C92E2AABB5/0/truss_design_art.pdf.

Matteo Frigo and Steven G. Johnson. The design and implementa-tion of fftw3. Technical report, Massachusetts Institute of Technol-ogy, 2003. URL http://www.fftw.org/. http://www.fftw.org/fftw-paper-ieee.pdf.

M. Galassi, Jim Davies, and Brian Gough. Gnu scientific library referencemanual (2nd ed.). Technical Report ISBN 0954161734, 2003. URL http://www.gnu.org/software/gsl/.

Walter W. Garvin. Introduction to Linear Programming. McGraw-Hill BookCompany, Inc, 1960.

Roger A. Horn and Charles R. Johnson. Matrix Analysis. Cambridge Uni-versity Press, 1985.

Page 74: Convex optimization1.75mm theory and practicekeithbriggs.info/documents/Skarakis_MSc.pdf · 2009-05-20 · CONVEX OPTIMIZATION theory and practice Constantinos Skarakis BT Group plc

Donald E. Knuth. The sandwich theorem. The Electronic Journal of Com-binatorics, 1(A1), 1994. URL http://www.emis.de/journals/EJC/Volume_1/volume1.html#A1.

L. Lovasz. On the shannon capacity of a graph. Information Theory, IEEETransactions on, 25(1):1–7, Jan 1979. ISSN 0018-9448.

Andrew Makhorin. Technical report, Department for Applied Informatics,Moscow Aviation Institute, Moscow, Russia, 2003. URL http://www.gnu.org/software/glpk/. The GLPK package is a part of the GNUproject, released under the aegis of GNU. (C) Copyright 2000, 2001, 2002,2003.

Lieven Vandenberghe, Stephen Boyd, and Shao-Po Wu. Determinant max-imization with linear matrix inequality constraints. SIAM Journal onMatrix Analysis and Applications, 19(2):499–533, 1998. URL citeseer.ist.psu.edu/vandenberghe98determinant.html.

R. Clint Whaley and Antoine Petitet. Minimizing development andmaintenance costs in supporting persistently optimized BLAS. Soft-ware: Practice and Experience, 35(2), 2005. URL http://math-atlas.sourceforge.net/.

Wikipedia. King post — wikipedia, the free encyclopedia, 2008a.URL http://en.wikipedia.org/w/index.php?title=King_post&oldid=227514338. [Online; accessed 30-July-2008].

Wikipedia. Tyne bridge — wikipedia, the free encyclopedia,2008b. URL http://en.wikipedia.org/w/index.php?title=Tyne_Bridge&oldid=229811490. [Online; accessed 21-August-2008].

Wikipedia. Young’s modulus — wikipedia, the free encyclopedia,2008c. URL http://en.wikipedia.org/w/index.php?title=Young%27s_modulus&oldid=232681599. [Online; accessed 21-August-2008].