## Monday, 9 November 2015

### Lecture 13

I have rewritten Section 13.1 of the notes (arguments for a PTAS for the knapsack problem.) I will discuss this in the next lecture. I have also added notes for Lectures 14 and 15 (which may be subject to small revisions.)

As some of us talked of after the lecture, the branch and bound algorithm can be generalised to the alpha-beta pruning algorithm, which lies at the heart of programs that play strategic board games like chess and reversi.

When looking for a branch and bound tool I might show you (see next paragraph), I came across an article, Branch And Bound—Why Does It Work?, in which the author addresses the question of why it is difficult to prove a concrete result about average running time of the branch and bound algorithm. I once spent some time trying to investigate this question myself, without any success. The author makes the provocative comment that doing something on this problem rings bells in ones mind with the famous Collatz conjecture.

I showed you briefly this nice interactive branch and bound solver for the knapsack problem, by Jacopo Corbetta, which can help you to understand the algorithm. I suggest pressing "add item" until you have 7 items, and then put max weight = 20. Click on "start solving" and then choose where to "branch", successively, until you find the optimal solution. Here is the start of the tree. Notice that branches of increasing depth are indicated by indentation to the right.

## Solution

Current best value: zcur = (none)
Possible branches: 3
Step 1a Branch constraints: x6=0
Optimal value for the relaxed problem: 25.714285714285715 (remaining weight: 0)
x: 1111100.7142857142857143
Step 0 Branch constraints: (none)
Optimal value for the relaxed problem: 25.833333333333336 (remaining weight: 0)
x: 111110.83333333333333340
Step 2a Branch constraints: x5=0 x6=1
Optimal value for the relaxed problem: 25.57142857142857 (remaining weight: 0)
x: 1111010.5714285714285714
Step 1b Branch constraints: x6=1
Optimal value for the relaxed problem: 25.8 (remaining weight: 0)
x: 11110.810
Step 2b Branch constraints: x5=1 x6=1
Optimal value for the relaxed problem: 25.75 (remaining weight: 0)
x: 1110.75110