Using greedy algorithm to determine a sequence


Assignment:

A pharmaceutical company uses glass containers to store their chemicals. Over time, they reuse the containers, but if they do, they are required to clean them. The cleaning costs depend on what was stored in the container before, and what will be stored next. The cleaning costs of the six chemicals A, B, C, D, E, and F are shown in the following matrix:

565_matrix.JPG

For example, if chemical C is stored in a glass that was used for F before, then the cleaning costs are 8 (from F to C, i.e., element (F, C), in the sixth row and third column).

(a) Assume that presently, chemical D is stored in a container. Use the Greedy algorithm to determine a sequence that has each of the six chemicals stored in a container exactly once. (Ties are broken arbitrarily). Clearly specify the sequence that results from the application of the Greedy algorithm. What are the costs associated with the sequence?

(b) Use the pairwise exchange method to improve the solution determined under (a). Examine all pairs until an exchange results in an improvement. Make this improvement and stop (even though additional improvements may be possible).

Provide complete and step by step solution for the question and show calculations and use formulas.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Using greedy algorithm to determine a sequence
Reference No:- TGS01979463

Now Priced at $30 (50% Discount)

Recommended (91%)

Rated (4.3/5)