CS 422 Fall 2002, Instructor:
Jeffrey Horn
HOMEWORK 2: Pseudocode, enumerative
algorithms, and combinatorical problems
Handed out/Assigned: |
Friday,Sept. 6, 2002 |
|
|
Write pseudocode to solve one of the three problems we
discussed in class. Use an enumerative, exhaustive approach
that guarantees the optimal answer will be found.
-
New York City Tunnels Problem (pipe network design):
-
p = 21 pipes, d = 16 diameters possible
for each pipe.
-
Thus can use 4 bits for each pipe, times 21 yields 84 bits
total binary represenation of decision variables.
-
Assume a function called simulate(pipe_design) that
takes as input a pipe network design (e.g., setting of the 84 bits, or
an array of 21 integers from 0..15 each, whatever) and returns a floating
point cost, which you are trying to minimize.
-
Write the loops, or recursions, or whatever, to examine the
entire search space, keeping track of the lowest cost solution found so
far.
-
Specify, abstractly, a data structure for the pipes and diameters.
(e.g., a binary string, or a list of integers, etc.)
-
Roughly analyze the run-time of your algorithm, in terms
of input sizes p and d.
-
Groundwater Monitoring (subset selection)
-
There are w = 396 possible well sites. You must
choose k=20 of them.
-
Assume a function called simulate(wells), that takes
as input a collection of 20 different wells, and outputs a floating
point value for the subsequent capture_rate, which you are trying
to maximize.
-
Write the loops, or recursions, or whatever, to examine the
entire search space, keeping track of the highest capture rate found so
far.
-
Specify, abstractly, a data structure for the well sites
and wells.
-
Roughly analyze the run-time of your algorithm, in terms
of input sizes w and k.
-
Task Scheduling
-
You have t unique tasks to schedule linearly (i.e.,
a single, complete ordering).
-
Assume a function called simulate(schedule) that takes
as input an ordering of the t tasks and outputs a floating point
profit, to be maximized.
-
Write the loops, or recursions, or whatever, to examine the
entire search space, keeping track of the highest profitsolution found
so far.
-
Specify, abstractly, a data structure for the ordering of
the tasks
-
Roughly analyze the run-time of your algorithm, in terms
of input size t.