From brand guide: https://flsouthern.mediavalet.com/portals/fsc-brand-guidelines
CSC 3380: Algorithms
(Spring 2025)

Syllabus

LMS

Teachers

Assignments
Assignments


Other Pages

Project 3:
Finest Friends


Assigned: Fri Mar 21 2025
Due: 11:59:00 PM on Mon Apr 07 2025
Team Size: 2
Language: Java
Out of: 100 points


One of your eccentric pals in the department has assigned all of their friends 2-dimensional coordinates based on two values that they think are important. (Probably fan levels of some important brands like My Little Pony and Rainbow Brite.) After finishing their list, they want to know which two of their friends are the finest, which is the two with the lowest Euclidean distance between them. You think of an obvious brute-force algorithm and promise to implement it for them. Unfortunately, you had no idea just how many friends they had...

Part 0, 0 points: Look at the instructions below to organize your code to simplify the submission process.

Part 1, 0 points: Create FriendsFinder.java, and add a static method, nearestFriends, that takes a List of Point objects (the stats of all friend's fandoms) and returns a List that contains exactly two of those Points (the two closest friends).

Part 2, 0 points: Add a JavaDoc comment header to describe your project and list who is in your team. Additionally, add a method to your class, getAuthors, that returns a string with the names of all members of your team, like this:

    /**
     * Returns the authors' names.
     * @return  The names of the authors of this file.
     */
    public static String getAuthors() {
        return "Anne Borgin and Kyle Burke";
    }

Part 3, 0 points:

You'll need these files in order to run the tester:

Part 4, 100 points: Your grade will be based on the longest friend lists where you can correctly find the closest friends in a restricted amount of time. Here is FriendsFinderTester.java, which will run your code on increasingly larger lists of points. It does not test the correctness of larger lists of friends, due to run time constraints. (If you submit it to me, I will be able to check the validity.) Important notes:

  • If any of the tests produce the wrong answer, you won't get any points.
  • Testing runs you try yourself do not give an official grade; you'll need to submit and have me run them for that.
  • When testing on your own, you'll need to enable assertions. In the command line, you can do that with the -ea flag: java -ea ClassToExecute If you're using an IDE, you'll have to look online to figure out how to enable them.

Part 5, 0 points: I highly recommend that you start with the brute-force method to solve this. That will get you some of the points on this project and will help you understand how to write the code and use the java.awt.Point class, while the algorithm itself is quite easy to implement.

Part 6, 0 points: A divide-and-conquer algorithm exists for this project, but it is not straightforward, as you might imagine. I expect that I will cover this algorithm in class. If you are having trouble implementing the divide-and-conquer version, please come ask me questions!

Part 7, 0 points: I expect that you'll need to use multiple threads to earn maximum points in the project. Hint: the computer I'm grading on has 16 CPUS.

Submitting your Project:

The files I'm looking for in this project are:

    Pick a team name (all alphabetical characters) for yourself that no one else will choose. (Using your names makes it easier for me, e.g. if I worked with Anne Borgin, our team name could be BorginAndBurke.) Put completed working files you have directly in a folder (no subfolders) named <YourTeamName>Project3, then zip the folder and upload the resulting .zip file to the assignment's canvas page so I can grade it. (E.g. BorginAndBurkeProject3.zip.) If you do it before the deadline and want me to run it through my tester to see how it does against the random players, send me a message and I'll do it. If you upload it after the deadline, please send me a message so I can grade it ASAP. Please please please name the folder correctly, then zip it; don't rename the zip file, or you'll have to resubmit and may incur a lateness penalty.