The following is a checklist which provides a summary of the
assignment. This is meant only as a supplement; please read the original assignment
description.
Frequently Asked Questions:
(This is the only part of this checklist which will change during the
week.)
[Michael 4/7] BIG PROBLEM: My original code had a huge bug in
the way it reported the external path lengths. This bug is now
fixed. My deepest apologies to all people who compared my numbers to
your own. Of course I did warn that my code might not be bug-free!
(course I'm getting a 7/10 on my grade this week).
[Michael 4/5]
Someone has noticed that the larger input files we gave have many
clearly degenerate lines which only intersect the border of the unit
square. We have replaced the input files with new data which does
not have this issue. (for those who want the originals, they are
in the prog7_files directory with suffix .OLD)
[Michael 4/5]
Just to reiterate, in a case where many lines separate a query pair,
you are only responsible for outputing a single such line (which one
is up to you).
Overview:
In the assignment, it states "You are welcome to try any method
you would like to solve this problem."
The wise reader will notice that immediately after this statement the
entire rest of the assignment discusses a particular approach based on
search trees. We expect that you will be doing this program using
the search tree approach. If you do choose to use some other
method, it will be important that you give a good justification in
your readme as to why you chose that approach.
Requirements:
The requirements are spelled out in detail in the original
assignment. Your program should read in a list of line
segments and build a data structure based on these segments which
supports a query routine which given two new points determines whether
any line segment separates these two points.
Possible Progress Steps:
These are purely suggestions for how you might make progress. You do
not have to follow these steps.
Successfully read the input lines.
Write a program which creates a postscript diagram of the
input lines. (you will find this diagram very helpful in working through bugs
in your program) A sample of such a postscript picture is given here.
Write a brute force routine for answering queries (i.e. one which
compares the query points individually to each input line). Although
this will not involve preprocessing the input lines, it will force you
to implement some of the necessary geometric primitives.
Testing Your Program:
As mentioned above, you should test your program on many more
interesting inputs and queries than the ones we have provided. In
testing correctness of your method, you may want to debug by also
comparing your results to the (more expensive) brute force method for
answering queries. Also, this week we are providing an executable
(/u/cs226/RaceMichael/prog7) which you may run. This again
gives you an "answer key" for any queries that you wish to test, and
it gives some comparison for possible performance of a program.
There is no guarantee that our code is bug-free. We think it
is, but if you feel confident that you answer a query correctly and
that our program does not, feel free to send us a sample input file
with a brief explanation.
cos226 Class Page
wass@cs.princeton.edu
Last modified: April 7, 1999