Introduction Marco Chiarandini Department of Mathematics & - - PowerPoint PPT Presentation

introduction
SMART_READER_LITE
LIVE PREVIEW

Introduction Marco Chiarandini Department of Mathematics & - - PowerPoint PPT Presentation

DM559 Linear and Integer Programming Lecture 1 Introduction Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Course Organization Outline Preliminaries 1. Course Organization 2.


slide-1
SLIDE 1

DM559 Linear and Integer Programming Lecture 1

Introduction

Marco Chiarandini

Department of Mathematics & Computer Science University of Southern Denmark

slide-2
SLIDE 2

Course Organization Preliminaries

Outline

  • 1. Course Organization
  • 2. Preliminaries

2

slide-3
SLIDE 3

Course Organization Preliminaries

Outline

  • 1. Course Organization
  • 2. Preliminaries

3

slide-4
SLIDE 4

Course Organization Preliminaries

Aims of the course

Learn about:

  • both the theory and the practice of Linear Algebra
  • one of the most important applications of Linear Algebra:
  • Mathematical optimization: linear programming
  • Discrete optimization: integer programming

Practical experience with computer software The solution to really many real-life problems will be within short reach

4

slide-5
SLIDE 5

Course Organization Preliminaries

Contents of the Course (1/2)

(see Syllabus) Linear Algebra: manipulation of matrices and vectors with some theoretical background

Linear Algebra 1 Matrices and vectors - Matrix algebra, Geometric insight 2 Systems of Linear Equations - Gaussian elimination 3 Matrix inversion and determinants 4 Vector spaces 5 Linear Transformations - Matrix representation 6 Diagonalization - Eigenvalues and Eigenvectors (7 Orthogonality or Numerical Methods)

5

slide-6
SLIDE 6

Course Organization Preliminaries

Contents of the Course (2/2)

(see Syllabus)

Linear Programming 1 Introduction - Linear Programming, Notation 2 Linear Programming, Simplex Method 3 Exception Handling 4 Duality Theory 5 Sensitivity 6 Revised Simplex Method Integer Linear Programming 7 Modeling Examples, Good Formulations, Relaxations 8 Well Solved Problems 9 Network Optimization Models (Max Flow, Min cost flow, matching) 10 Cutting Planes & Branch and Bound 11 More on Modeling

6

slide-7
SLIDE 7

Course Organization Preliminaries

Practical Information

Teacher: Marco Chiarandini (http://www.imada.sdu.dk/~marco) Instructor: Jens Østergaard Schedule:

  • Introductory classes: 44 hours (22 classes)
  • Training classes: 50 hours
  • Exercises: 42 hours
  • Laboratory: 8 hours

Alternative views of the schedule:

  • http://mitsdu.sdu.dk/skema, SDU Mobile
  • Official course description (læserplaner)
  • http://www.imada.sdu.dk/~marco/DM559

7

slide-8
SLIDE 8

Course Organization Preliminaries

Communication Means

  • BlackBoard (BB) ⇔ Main Web Page (WWW)

(link http://www.imada.sdu.dk/~marco/DM559)

  • Announcements in BlackBoard
  • Discussion Board in (BB) - allowed anonymous posting and rating
  • Write to Marco (marco@imada.sdu.dk) and to instructor
  • Ask peers
  • You are welcome to visit me in my office in working hours (8-16)

It is good to ask questions!! Let me know when you think we should do things differently! Things can be changed.

8

slide-9
SLIDE 9

Course Organization Preliminaries

Books

Linear Algebra Part: AR Howard Anton and Chris Rorres. Elementary Linear Algebra. 11th

  • Edition. 2014. Wiley

Other books: AH Martin Anthony and Michele Harvey, Linear Algebra, Concepts and

  • Methods. 2012. Cambridge

Le Steven J. Leon, Linear Algebra with Applications, 8th edition, Prentice Hall (2010). FSV Computing with Python: An introduction to Python for science and engineering Claus Führer, Jan Erik Solem, Olivier Verdier

9

slide-10
SLIDE 10

Course Organization Preliminaries

Books

Linear and Integer Programming Part: LN Lecture Notes MG J. Matousek and B. Gartner. Understanding and Using Linear

  • Programming. Springer Berlin Heidelberg, 2007

Wo L.A. Wolsey. Integer programming. John Wiley & Sons, New York, USA, 1998 Other books: HL Frederick S Hillier and Gerald J Lieberman, Introduction to Operations Research, 9th edition, 2010

  • ...

10

slide-11
SLIDE 11

Course Organization Preliminaries

Course Material

Main Web Page (WWW) is the main reference for list of contents (ie1, syllabus, pensum). It contains:

  • slides
  • list of topics and references
  • exercises
  • links
  • software

1ie = id est, eg = exempli gratia, wrt = with respect to

11

slide-12
SLIDE 12

Course Organization Preliminaries

Assessment

  • 7.5 ECTS
  • (Four) Obligatory Assignments, pass/fail, evaluation by teacher

both theoretical and practical (programming) exercises

  • 4 hour written exam, 7-grade scale, external censor

(theory part) similar to exercises in class and past exams in June

  • (language: Danish and/or English)

12

slide-13
SLIDE 13

Course Organization Preliminaries

Obligatory Assignments

  • Small practical tasks must be passed to attend the written exam
  • Individual work
  • They require the use of Python + a MILP Solver (2nd part) See Tools

from Public Web Page

13

slide-14
SLIDE 14

Course Organization Preliminaries

Training Sessions

  • Prepare them in advance to get out the most
  • Best carried out in small groups
  • Exam rehearsal (in June?)

14

slide-15
SLIDE 15

Course Organization Preliminaries

Some Numbers

DM559 Obligatory Assignments In Blackboard 60 Registered 43 Submitted 24 Passed 19 Final exam: Registered 19 Showed up 14 Passed 6 Reexam: Registered 12 Showed up 6 Passed 4 DM545 Obligatory Assignments In Blackboard 60 Registered 27 Submitted 19 Passed 18 Final exam: Registered 29 Showed up 21 Passed 16 Reexam: Registered 12 Showed up 4 Passed 4

15

slide-16
SLIDE 16

Course Organization Preliminaries

Who is here?

65 registered in BlackBoard...

  • Computer Science

(2nd year, 4th semester)

  • Applied Mathematics?
  • Math-economy?
  • Returning CS

Prerequisites

  • Goodwill
  • Algorithms and Data Structures,

Programming

16

slide-17
SLIDE 17

Course Organization Preliminaries

Coding

Coding smal examples can help you to understand math! Beside:

  • listening to lectures
  • watching an instructor work through a derivation
  • working through numerical examples by hand

you can learn by doing by interacting with Python.

  • jupyter.org/ipython (= interactive python)
  • Python 2.7 or 3.5?

19

slide-18
SLIDE 18

Course Organization Preliminaries

Outline

  • 1. Course Organization
  • 2. Preliminaries

20

slide-19
SLIDE 19

Course Organization Preliminaries

Overview

  • Notation
  • Martices and vectors:
  • matrix arithmetic operations (addition, subtraction, and multiplication)
  • scalar multiplication and transposition.

21

slide-20
SLIDE 20

Course Organization Preliminaries

Sets

  • A set is a collection of objects. eg.: A = {1, 2, 3}
  • A = {n | n is a whole number and 1 ≤ n ≤ 3}

(’|’ reads ’such that’)

  • B = {x | x is a reader of this book}
  • x ∈ A

x belongs to A

  • set of no members: empty set, denoted ∅
  • if a set S is a (proper) subset of a set T, we write (S ⊂ T) T ⊆ S

{1, 2, 5} ⊂ {1, 2, 4, 5, 6, 30}

  • for two sets A and B, the union A ∪ B is {x | x ∈ A or x ∈ B}
  • for two sets A and B, the intersection A ∩ B is {x | x ∈ A and x ∈ B}

{1, 2, 3, 5} and B = {2, 4, 5, 7}, then A ∩ B = {2, 5}

23

slide-21
SLIDE 21

Course Organization Preliminaries

Numbers

  • set of real numbers: R
  • set of natural numbers: N = {1, 2, 3, 4, ...} (positive integers)
  • set of all integers: Z = {..., −3, −2, −1, 0, 1, 2, 3, ...}
  • set of rational numbers: Q = {p/q | p, q ∈ Z, q = 0}
  • set of complex numbers: C
  • absolute value (non-negative):

|a| =

  • a

if a ≥ 0 −a if a ≤ 0 |a + b| ≤ |a| + |b|, a, b ∈ R

  • the set R2 is the set of ordered pairs (x, y) of real numbers

(eg, coordinates of a point wrt a pair of axes, the Cartesian plane)

24

slide-22
SLIDE 22

Course Organization Preliminaries

Matrices and Vectors

  • A matrix is a rectangular array of numbers or symbols. It can be written

as      a11 a12 · · · a1n a21 a22 · · · a2n . . . . . . ... . . . am1 am2 · · · amn     

  • An n × 1 matrix is a column vector, or simply a vector:

v =      v1 v2 . . . vn     

  • the set Rn is the set of vectors [x1, x2, . . . , xn]T of real numbers (eg,

coordinates of a point wrt an n-dimensional space, the Euclidean Space)

25

slide-23
SLIDE 23

Course Organization Preliminaries

Basic Algebra

Elementary Algebra: the study of symbols and the rules for manipulating

  • symbols. It differs from arithmetic in the use of abstractions, such as using

letters to stand for numbers that are either unknown or allowed to take on many values

  • collecting up terms: eg. 2a + 3b − a + 5b = a + 8b
  • multiplication of variables: eg:

a(−b) − 3ab + (−2a)(−4b) = −ab − 3ab + 8ab = 4ab

  • expansion of bracketed terms: eg:

−(a − 2b) = −a + 2b, (2x − 3y)(x + 4y) = 2x2 − 3xy + 8xy − 12y2 = 2x2 + 5xy − 12y2

  • aras = ar+s,

(ar)s = ars, a−n = 1/an, a1/n = x ⇐ ⇒ xn = a, am/n = (a1/n)m

26

slide-24
SLIDE 24

Course Organization Preliminaries

Variables

  • In Mathematics and Statistics, a variable is an alphabetic character

representing a value, which is unknown. They are used in symbolic calculations. Commonly given one-character names.

  • in contrast, a constant or given or scalar is a known real number
  • In Computer Science, a variable is a storage location paired with an

associated identifier, which contains a value, which may be known or unknown. Commonly given long, explanatory names.

27

slide-25
SLIDE 25

Course Organization Preliminaries

Functions

  • a function f on a set X into a set Y is a rule that assigns a unique

element f(x) in S to each element x in X. y = f(x) y dependent variable x independent variable

  • a linear function has only sums and scalar multiplications, that is, for

variable x ∈ R and scalars a, b ∈ R: f(x) := ax + b

28

slide-26
SLIDE 26

Course Organization Preliminaries

Graphs of Functions

The graph of a function f consists of those points in the Cartesian plane whose coordinates (x, y) are pairs of input-output values for f.

29

slide-27
SLIDE 27

Course Organization Preliminaries

Equations

  • for a linear equation: ax + b = 0 with a, b ∈ R

the solution is a real number x for which the equation is true

  • Quadratic equation

ax2 + bx + c = 0, a = 0.

  • closed form or analytical solution:

x1 = −b − √ b2 − 4ac 2a x2 = −b + √ b2 − 4ac 2a

30

slide-28
SLIDE 28
  • Quadratic equation

ax2 + bx + c = 0, a = 0.

  • quadratic formula:

x1 = −b − √ b2 − 4ac 2a x2 = −b + √ b2 − 4ac 2a the term b2 − 4ac is called discriminant

  • Solutions from discriminant:
  • if b2 − 4ac > 0 =

⇒ two real solutions

  • if b2 − 4ac = 0 =

⇒ exactly one solution: x = −b/(2a)

  • if b2 − 4ac < 0 =

⇒ no real solution but complex solutions

  • Can be solved also by factorization, eg:

x2 − 6x + 5 = (x − 1)(x − 5) = 0 then either x − 1 = 0 or x − 5 = 0.

  • r by completing the square =

⇒ a(x + d)2 + e = 0, eg: i) x2 + 6x + 9 = 0, and ii) x2 − 2x + 3 = 0

slide-29
SLIDE 29

Course Organization Preliminaries

Polynomial Equations

  • A polynomial of degree n in x is an expression of the form:

Pn(x) = a0 + a1x + a2x2 + · · · + anxn, where the ai are real constants, an = 0, and x is a real variable.

  • Pn(x) = 0 has at most n solutions, eg:

x3 − 7x + 6 = (x − 1)(x − 2)(x + 3) = 0, which are called roots or zeros of Pn(x)

  • No general (closed) formula
  • If α is a solution then (x − α) must be a factor for Pn(x)

We find α by trial and error and then set (x − α)Q(x) where Q(x) is a polynomial of degree n − 1

  • Eg, x3 − 7x + 6

32

slide-30
SLIDE 30

Course Organization Preliminaries

In Python

import matplotlib.pyplot as plt import numpy as np a=[1,0,-7,6] P=np.poly1d(a) print(P) 3 1 x - 7 x + 6 x = np.linspace(-3.5, 3.5, 500) plt.plot(x, P(x), ’-’) plt.axhline(y=0) plt.title(’A polynomial of order 3’);

4 3 2 1 1 2 3 4 15 10 5 5 10 15 20 25

A polynomial of order 3

33

slide-31
SLIDE 31

Course Organization Preliminaries

Differentiation

A line L through a point (x0, f(x0))

  • f f can be described by:

y = m(x − x0) + f(x0) The derivative is the slope of the line that is tangent to the curve: y = f ′(x0)(x − x0) + f(x0)

34

slide-32
SLIDE 32

Course Organization Preliminaries

Functions of Several Variables

  • A function f of n real variables is a rule that assigns a unique real

number f(x1, x2, . . . , xn) to each point (x1, x2, . . . , xn) Example in R2: f(x, y) =

  • 102 − x2 − y2

x2 + y2 + z2 = 10

35

slide-33
SLIDE 33

Course Organization Preliminaries

Partial Derivatives

  • The first partial derivative of the function f(x, y) with respect to the

variables x and y are: f1(x, y) = lim

h→0

f(x + h, y) − f(x, y) h = ∂ ∂xf(x, y) f2(x, y) = lim

k→0

f(x, y + k) − f(x, y) k = ∂ ∂y f(x, y)

  • Their value in a point (x0, y0) is given by:

f1(x0, y0) = ∂ ∂xf(x, y)

  • (x0,y0)

f2(x0, y0) = ∂ ∂y f(x, y)

  • (x0,y0)

36

slide-34
SLIDE 34

Course Organization Preliminaries

Trigonometry

  • sine and cosine functions, sin θ and cos θ, geometrical meaning
  • angles measured in radiants rather than degrees (π = 3.141..., π = 180)
  • cos x = sin(x + π/2)
  • sin2 θ + cos2 θ = 1
  • sin(θ + φ) = sin θ cos φ + cos θ sin φ
  • cos(θ + φ) = cos θ cos φ − sin θ sin φ

37