You are on page 1of 5

0/1 Knapsack exercise

• Selection of n=4 items, capacity of knapsack


M=8
Item 1 2 3 4
Value 15 10 9 5
Weight 1 5 3 4
All Pairs Shortest Path Exercise

15

5
5 50 5 15
30

15
Multistage graph exercise
21 41 1 71
3

7
6
5 4
3 51
91 T
11
2
S
5 6

2 3

8
31 61 81
2
The traveling salesperson (TSP)
problem
• Exercise: Directed graph :

• Cost matrix:

8 -5

You might also like