General information for programming exercises

Exercise 1

Bellman-Ford Algorithm

Deadline: 30.10.2013 9:00 a.m.(files in svn at that time count)

Code Review: 01.11.2013 during exercise

Format specifications (Test files can be found in the svn repository)

Input

As input format we use the Trivial Graph Format (TGF) which is defined as follows:

0 someString0

1 someString1

2 someString2

3 someString3

#

0 1 weight

1 2 weight

1 3 weight

3 2 weight

First all node identifier (int) and associated node names (arbitrary strings - we limit to single words) are listed. You can expect them to be 0..|V|-1 in increasing order. After a single line containing only a single # symbol all directed edges are listed with their weights (double, at most 3 fractional digits).

Your program shall be called as:

./exercise1 graph.tgf sourceId targetId

sourceId and targetId are the node identifiers (not the names!) of the source and target node for the shortest path search.

Output (Must be exactly as below! No additional output or typos!)

If no path form source to target exists your program shall generate the single output no path

If the graph contains negative weight cycles your program shall generate the single output infeasible

Otherwise your program shall return two lines of output first the length of the shortest path P, then the path itself e.g.

134.5

sourceId idP2 idP3 idP4 … targetId

Exercise 2

Ford Fulkerson Algorithm

Deadline: 13.11.2013 9:00 a.m.(files in svn at that time count)

Code Review: 15.11.2013 during exercise

Format specifications (Test files can be found in the svn repository)

Input

As input format we use the Trivial Graph Format (TGF) from exercise 1. Now the weights of the edges represent their capacities and you can expect them to be positive integer numbers.

Output

The output is simple one number specifying the value of the maximum flow

Call

Your program shall be called as:

./exercise2 network.tgf sourceId sinkId

sourceId and sinkId are the node identifiers (not the names!) of the source and sink node for maximum flow computation.

Exercise 3

Dictionary

Deadline: 27.11.2013 9:00 a.m.(files in svn at that time count)

Code Review: 29.11.2013 during exercise

Point scheme

For each exercise you can score 4 Points, 3 for the program and 1 for the application note. For the program:
3 Pts = program runs without errors
2 Pts = program contains small errors
1 Pts = program contains critical errors
0 Pts = no program submitted

Requirements: You have to reach at least 75% of the points summed for all programming exercises