Homework #5

Due: 10/25/02 (F)

Chapter 4. Exercises: 11, 26 (write a program), 35 (write a program)

Notes on exercises:

26) Design and implement a greedy program to minimize the assignment of n persons to n jobs. Each job must be assigned to exactly one person, and each person must be assigned a different job. Test your program with the data set.

An assignment (although not necessarily minimal) would be:

Person 0 assigned to Job 2 for a cost of 7

Person 1 assigned to Job 1 for a cost of 10

Person 2 assigned to Job 4 for a cost of 15

Person 3 assigned to Job 0 for a cost of 30

Person 4 assigned to Job 3 for a cost of 100

This assignment would have a total cost of 162. It is this total cost that you want to be minimizing. Again, your program need not generate the globally best assignment.

35) Design and implement a greedy version of TSP. Your program will not always determine the globally optimal tour, but that is okay.