CS 422 Fall 2000,
Instructor: Jeffrey Horn
General
Student Concerns: Colloquia
and Seminars Local
Events NMU
CS Employment
What's REALLY New:
-
NOTICE!! Class on Friday, Nov.
10, is MOVED to Jamrich 206
-
OK, actually class is replaced by my presentation
and demo to the Internet 2 mini-conference being held tomorrow.
This involves both NMU and MTU presenters and attendees.
-
But since I will be discussing GENETIC ALGORITHMS,
and since I have decided that the GA will be our approximation algorithm
to be applied to some NP-Complete problems, I think you must go!
-
Also, I plan to hand out another assignment there
(I mean for you guys, not them!)
-
The presentation begins at 1:30pm and will last only
about 1/2 hour (you know me!) followed by Q&A.
-
The assignment should show up on the web too, eventually...
-
General
Announcements (for all students)
Not so New (Older Announcements):
CONTENTS
LECTURE NOTES
Topics
NP COMPLETE PROBLEMS:
Compendium of NP-Complete Problems
MORE NP-Complete Problems
Handouts
HOMEWORKS & PROGRAMS
-
Homework 1, Pseudocode, Enumerative Algorithms, and
Combinatorical Problems: Here
is the handout.
-
Homework 2: Empirical Analysis of Run-Times:
Sorts
-
Homework 3:
-
From the book: page 11, number 1.2-5, then page
17: numbers 1.4-1, and 1.4-2, then page 15, number 1.3-4
-
Due: Monday, Oct. 9, 2000
-
Homework 4: The Halting Problem
-
handed out Monday, October 16, 2000. Due:
Monday, October 23, 2000.
-
Everybody got assigned one of the questions below:
-
Task 1: John, Zach, Mike, Russ
-
Task 2: Todd, Justin, Jim
-
Task 3: Jason, Chaplin, Keith
-
Task 4: Renaye, Carlo, Dave
-
Each question is potentially a realistic task that you
might someday be asked to do. that is, you might be asked to write
a program that reads in other programs and answers the question.
-
But your task might be impossible! If so, you'll
have to prove it (or DO it).
-
So use "Halting
Problem" class handout as a skeleton and write up a BRIEF, INFORMAL
proof that your task is impossible.
-
Here
is a concrete example of a program P'' that uses a supposed solution (another
program P) to some undecideable problem (e.g., detecting division by 0)
to ceate a contradiction when P'' is run on itself (i.e., with its own
source code, the file "main.cc", as input).
-
THE TASKS: Your program should read in the source
code of a given program P and answer the question:
-
Given a program P and an interger i, does P
ever execute line number i?
-
Given a program P, does P ever divide by zero?
-
Given a program P, does P ever cause an integer
overflow?
-
Given a program P, does P ever print out the
string "You can shove this ThinkPad!"
-
Homework 5: Intractability versus Moore's Law, THE RACE!
-
handed out Friday, October 20, 2000. Due: Monday,
Oct. 30, 2000.
-
We (NMU and MTU) are using an approximation algorithm
(in this case a GENETIC ALGORITHM) to solve a groundwater remediation (cleanup)
problem, as described in class.
-
There are 15 pumping wells and the flow rate for each is
encoded in 4 bits (so 16 unique pumping rates are possible).
So there are a total of 15 * 4 = 60 bits in the encoding of the decision
variables and therefore the total search space size is _____.
-
It currently takes us 2.5 minutes (approx.) of wall clock
time to run the groundwater simulation to test a single solution (i.e.,
setting of the 60 bits). (This is on a 450 MHz Sparcstation).
-
Assuming Murphy's law is true (and it has held up remarkably
well over the last two decades), which is that processor speed DOUBLES
approximately every two years, maybe we really COULD solve this problem
EXACTLY, using enumeration. Let's see...
-
Assume that a run-time of ONE WEEK is considered PRACTICAL,
but any algorithm that takes more than a week to run is considered impractical.
-
QUESTION 1: How long (in years) would I have to wait
for it to become PRACTICAL to enumerate the search space? (assume
NO parallel processing!)
-
QUESTION 2: How long for the NYC TUNNELS problem?
(Recall that was 21 pipe diameters encoded with 4 bits each)
-
QUESTION 3: If I re-started the enumeration on a brand
new, state-of-art processor every two years, starting now (year 2000)
with a 450 MHz processor taking 2.5 minutes per simulation, and then
every two years buying a new machine with twice the speed and re-starting
the enumeration on that, which year's machine would finish FIRST?
(answer for both problems: groundwater cleanup and NYC Tunnels).
-
Homework 6: Analysis of some "Really Easy Problems"
and some "Really Fast" algorithms!
-
HANDED OUT: Monday Nov. 13, 2000
-
DUE: before Turkey break!
-
Give me run-time analysis, and indicate best-case, worst-case,
or avg. case, for one of the following problems:
-
(i.e., find the best known algorithm(s), name it, then find
out the run times)
-
Shortest-Path (in a weighted, undirected graph)
-
Minimum Cost Spanning Tree (in a weighted, undirected
graph)
-
Maximum Sum Subsequence (on a sequence of n integers,
possibly including negative numbers!)
TESTS AND QUIZES
-
QUIZ 1: (take-home): Prove that the problem
of SUBGRAPH ISOMORPHISM (handout)
is NP-COMPLETE!
-
First show that it is in NP, then reduce a known NP-complete
problem to it
-
(hint: reduce CLIQUE!)
-
Handed out Monday Nov. 6, 2000, Due Wed. Nov. 8, 2000.
-
QUIZ 2: The Genetic Algorithm and the Knapsack Problem
-
Run the code for HW 7 above on your own version of the
KnapSack problem.
-
Modify "knapsack.cc" to use a chromosome length equal
to the length of your full name. Make up the associated weights!
-
Try out the GA on the problem, modifying the parameter
values in the file "parameters"
-
Get some good runs done, and then just show me in class
or office hours.
-
Due Monday, Dec. 4, 2000
FINAL
There will be no final EXAM in this class. Rather,
there will be a final project, applying the GA to an NP-Complete problem,
which I will expect everyone to implement their own "piece" of the action,
and then to show up on our Final exam day and time, in NSF 1207, the lab,
to try to put it all together and get it running.
(Final exam schedule at:
http://www.nmu.edu/Records/ExamSched00F.htm)
FINAL PROJECT: Nature's Approximation Algorithm:
GENETIC ALGORITHMS! (applied to some NP-Complete problems)
-
Here
is the GA++ code, currently configured to run on the ONEMAX problem.
-
You can copy the code from ~jeffhorn/pub/Classes/CS422/Fall2000/GA++
-
The ONEMAX problem is in the file "onemax.cc",
which is compiled into the executable "onemax" file
-
The knapsack problem is in the file "knapsack.cc",
which is compiled into the executable "knapsack" file
-
To switch between problems, you have to edit the file
"individual.cc",
the method "evaluate()" and go to the line for the system call,
which is
int res=system("./knapsack");
and change the name of the executable file to whatever
is the executable for your problem (e.g., "verttexcover")
-
Here are the NP-Complete problems:
-
TSP
-
Here
is
a sample input file, describing a particular undirected graph as an adjacency
matrix, with the entries representing the costs of the edges from node
row
to node column. A "-1" indicates no edge. Note
that the matrix is symmetric about the main diagonal, since this is for
an undirected graph (i.e., same cost each direction).
-
Here is Jim Bean's Random Keys scheme for encoding
TSP as a chromosome (indeed, this encoding works for ANY ordering problem):
-
In a k city problem, each chromosome is assumed
to contain a string of k integers. For example, if using a
binary chromosome of length L = b * k bits (i.e., some multiple
of k), then each b bits are decoded as an integer. The i_th
integer in the string represents the i_th city. Then the tour
is determined by the sorted ordering of each city's integer. Thus
for example, in a k = 4 city problem, with cities 1,2,3, and 4,
and using b = 4 bits per city,
the string 0101 1001 1100 0010 1010 would be
decoded as 5, 9 12 10 and would thus represent the tour 1 -> 2 -> 4 ->
3 -> 1 (must always return to origin!)
-
Thus Random Keys always gives a valid tour ("valid" means
each city is on the tour once and only once, and that you return to your
starting point) for ANY string of integers (or binary coded integers).
Note that ties must be broken consistently, unlike in presidential elections!
-
ASSIGNMENT:
-
binary chromosome (0110101000111101010101)
-> decoded integers ( 8 12 5 11
29 ) DAVE NEWMAN
-
Decoded integers -> Permutation of cities
(3 1 4 2 5) MIKE DELLANGELO
-
"tsp.input" file -> internal graph representation (e.g.,
adjacency matrix or list) KEITH RUTKOWSKI
-
permutation of cities -> total cost of tour (e.g.,
1588) JASON STAKVEL
-
BOOLEAN SATISFIABILITY (CARLO)
-
Set-Covering
-
Clique (CHAPLIN CINELLI)
-
Vertex Cover RUSS METCALF
-
And here are the remaining tasks:
-
Enumerate TSP (generate every possible permutation of
integers 1 to N; that's all N! of them!)
-
RENAYE J. and JIM URBANIAK
-
Enumerate BOOLEAN SAT. (i.e., generate every possible
binary string of length N).
-
TODD JUTILA and JOHN BOLLIGER (?)
or JUSTIN MARTH(?)
-
Here
is Russ' link to some GA tutorial