Skip to main content

CIS 263

Closest Pair

Fall 2019

Use this GitHub Classroom link to get started: classroom.github.com/a/5jehf_QK.

Don't edit the test file yet. The tests are still a work in progress. If you want to add tests now, put them in a separate .cpp file.

The Challenge

Implement a divide and conquer algorithm for determining which points in a set are the closest. The algorithm will be similar to the one presented in class, with three additions:

Details

Implement the following two methods:

Grading

There are several tiers to this project. Your grade will be based on how many you complete. (Unlike previous homework, you can still receive a decent grade if certain parts of this assignment don't work.)

Points Details
Works with no ties and no rounding 25 closestPairs (1) implements a divide and conquer algorithm, (2) passes all of the tests tagged noTie and noRound. This means that (1) All answers contain just one PointPair, and (2) you can ignore tolerance.
Works with ties. 15 In addition to the criteria above, all of the tests tagged tie pass. (5 points if tie tests pass for brute force only.)
Works with tolerance. 10 In addition to the criteria above, all of the tests tagged round pass. (4 points if round tests pass for brute force only.)
Has a running time of O(n log n) 10 You must prepare and attach a graph showing the running time for input sizes ranging from 500 to 50,000 compared to a graph of a function of the form cn log n. (You can only receive these points if closestPairs works correctly.) You need only meet the n log n bound for inputs that contain no ties. (4 points for preparing a graph, even if it isn't n log n.) Include the graph in your git repo. Important: You must also include the code that generated the numbers used in the graph. (In other words, I need to be albe to reproduce your results.)

Rules

Suggestions

Submission and grading


Updated Wednesday, 27 November 2019, 1:10 PM

W3c Validation