COS 226 Programming Assignment 7 - Checklist


Checklist 7: Point Location.

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
  • Overview
  • Requirements
  • Possible Progress Steps
  • Testing Your Program

  • 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.
  • Input Format: The input begins with an integer N, then N lines, each defined by four floats that give the endpoints of the line segments. Since they represent intersections with the edge of the unit square, each line segment endpoint coordinate is 0 or 1 in at least one coordinate. Following the N lines is a sequence of pairs of points (also four floats per input line). You can find examples in the files tiny, medium, large, and giant. (copies of these files are located in /u/cs226/prog7_files/)
    Please note that we will be testing the correctness of your programs on many more queries than the ones given in the above files. You will notice that the above files give more and more line segments, however each of them only contains one or two sample queries at the end. Since one of the biggest issues of geometric computing is to correctly handle the many cases which arise, you should make sure to test your program correctness on many more queries.
  • Output Format: The output for your program should include the following: program.
  • At the end of the construction of your data structure, your program should report the number of external nodes in your tree, and the average external path length. (The path length to a particular external node is the number of internal nodes which are encountered when walking down the tree to that external node).
  • For each of the pairs of query points, you should print a line of output which describes a specific line which separates the two points, or else states that no such line exists.
  • readme: Your readme file for this program should contain the following:
  • A high-level description for the design of your algorithm, what influenced your decisions, and any performance issues.
  • A table of the number of external nodes, and average path length of these nodes for various size input files. Discuss the growth of these numbers.
  • A (brief) discussion of any vulnerability which your program has as far as degenerate cases or numerical inaccuracy.

  • 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