R. Clayton (rclayton@monmouth.edu)
(no date)
I've updated the assignment files:
Graph.java now generates random, (usually) non-complete graphs and it checks
to make sure an answer doesn't have two adjacent singleton nodes. Also, if
you look in the constructor, you'll see some code that can be enabled to
print out the adjacency matrix.
NodePairing.java creates a random-number generator for graph, and recognizes
the -s option to set the random-number generator's seed. Without using -s,
each run of the program creates a different random graph, which can be a pain
when you're trying to debug your program. By using the -s n option you can
repeatedly generate the same random graph.
I also want to re-warn you that the neighbors array passed into the
NodeRunnable constructor is uninitialized. None of your Node Runnable code
should do anything with the neighbors array - or related data - until run() is
called and everything's been initialized properly. Failure to appreciate the
importance of this can lead to nasty synchronization problems, like the one I
spent a couple of hours this afternoon tracking down (I'm so embarassed - my
invariants really weren't initially true).
This archive was generated by hypermail 2.0b3 on Tue Aug 12 2003 - 09:30:05 EDT