Docsity

Integer Programming Solutions - Discrete Modeling and Optimization - Lecture Slides, Slides of Discrete Structures and Graph Theory

Partial preview of the text

Download Integer Programming Solutions - Discrete Modeling and Optimization - Lecture Slides and more Slides Discrete Structures and Graph Theory in PDF only on Docsity!

Integer programming solutions

for graph problems

In this handout

• Assignment Problem

• Coloring Problem

Assignment Problem

  • Given : n people and n jobs

Each person can be assigned to exactly one job Each job should be assigned to exactly one person Person-job compatibility is given by a directed network (e.g., having a link A → x means “person A can do job x ”)

  • Goal : Find an assignment of n jobs to n people

(if such an assignment exists).

  • Example:

people A^ B C D^ E

jobs (^) x y z u v

Solving Maximum Assignment problem by integer

programming

set students;

set projects;

set arcs within students cross projects;

var assign{(i,j) in arcs} binary;

is 1 if student i is assigned to project j, 0 otherwise

maximize total_assignments: sum{(i,j) in arcs} assign[i,j];

s.t. at_most_one_project_for_each_student{i in students}:

sum{(i,j) in arcs} assign[i,j] <= 1;

s.t. at_most_one_student_for_each_project{j in projects}:

sum{(i,j) in arcs} assign[i,j] <= 1;

Integer program for maximum assignment problem

Suppose the constraints of the integer program are written in matrix form Ax ≤ B.

Note that all the entries in A are 0 or 1.

It can be shown that A is totally unimodular , that is, every square nonsingular submatrix has determinant 1 or -1.

As a result of that property, the integer program for Maximum Assignment Problem has the following feature: All CPF solutions of LP-relaxation are integral.

Thus,

the optimal solution of LP-relaxation is also optimal solution for the original IP.

Note that generally having entries 0, 1, -1 doesn’t guarantee that A is totally unimodular (see Coloring Problem).

Coloring Graphs

  • Definition : A graph has been colored if a color has been

assigned to each vertex in such a way that adjacent vertices

have different colors.

  • Definition: The chromatic number of a graph is the smallest

number of colors with which it can be colored.

In the example above, the chromatic number is 4.

  • Finding the chromatic number of a graph is a minimization

problem. Docsity.com

Solving the Coloring problem by integer programming

set colors;

set nodes;

set arcs within nodes cross nodes;

var use{c in colors} binary;

is 1 if color c is used, 0 otherwise

var assign{i in nodes, c in colors} binary;

is 1 if node i has color c, 0 otherwise

minimize number_of_colors: sum{c in colors} use[c];

Solving the integer program for a data set

data;

set colors:= blue red green;

set nodes:= A B C D E F;

set arcs:=

A B

B C

C D

D E

E A

C F;

The AMPL output for the data set

21 "assign['F','green']" 0 ;

  • objective
  • 1 "use['blue']" 0. var :=
  • 2 "use['red']" 0.
  • 3 "use['green']"
  • 4 "assign['A','blue']" 0.
  • 5 "assign['A','red']" 0.
  • 6 "assign['A','green']"
  • 7 "assign['B','blue']" 0.
  • 8 "assign['B','red']" 0.
  • 9 "assign['B','green']"
    • 10 "assign['C','blue']" 0.
    • 11 "assign['C','red']" 0.
    • 12 "assign['C','green']"
    • 13 "assign['D','blue']" 0.
    • 14 "assign['D','red']" 0.
    • 15 "assign['D','green']"
    • 16 "assign['E','blue']" 0.
    • 17 "assign['E','red']" 0.
    • 18 "assign['E','green']"
    • 19 "assign['F','blue']" 0.
    • 20 "assign['F','red']" 0.