## Short Overview

The practical exercises for the lecture Optimization won't be programming exercises. Mostly you have to get familiar with an LP Solver, try to solve LPs and understand the results.

### Exercise 0: MATLAB

• solve the programming exercises which you can find here.

### Exercise 1: MATLAB

• solve the LPs given here with gurobi.

### Exercise 2: Flux Balance Analysis

Write a program that:
• reads in a metabolic network: A struct in a .mat file called "network" with:
• S: the stoichiometric matrix
• rev: the reversibility vector (rev(i) = 0: reaction i is not reversible, rev(i) = 1: reaction i is reversible)
• rxns: names of the reactions
• lb: lower bounds
• ub: upper bounds
• description: name of the network
• reads a second argument that is either BIOMASS or BLOCKED
• reads a third argument that is the output filename.
• depending on the given argument either:
• computes flux distribution that maximizes the biomass production and fulfills the steady state assumption. The network will contain a reaction named "Biomass" whose rate has to be maximized.
• determines for every reaction whether it is blocked or not.
• Output format:
• in BIOMASS mode:
• a cell (or a .txt file) with two columns where each row contains the reaction_id and the corresponding rate
• the first row contains the Biomass reaction, the remaining reactions are ordered according to their index
• in BLOCKED mode:
• a vector which contains the names of the blocked reactions
• they are ordered according to their index

### Exercise 3: n-Queens Problem

Write a program that solves the n-Queens Problem:

Place as much queens as possible on a n x n chess board such that no two queens interfere. Thus:
• In each vertical line ...
• In each horizontal line ...
• In each diagonal line ...
... is only one queen allowed.

Use MATLAB and gurobi.

Write a function board = nQueens(n) that gives you a n x n matrix where the entries are 0 or 1. A 1 deontes that a queen was placed in the corresponding field.
Topic revision: r11 - 17 Dec 2015, AnnikaRoehl