CPS420 |
W2024 Assignment | |
Worth: 6% |
Hamiltonian Circuits |
Due: March 24 |
Team WorkThis assignment can be done in teams of one or two people. A third person can be added to the team for a 20% penalty (i.e. the final grade for the work will be 80% of the original grade). This third member must be declared in writing in the D2L component of the submission when the assignment is submitted.You do not have to be in the same teams as for Lab6! Assignment SummaryIn this assignment you will implement a brute force backtracking algorithm to find a Hamiltonian circuit in an undirected graph when this is possible.Just like for lab 6, your code will be automatically tested and graded on the moons, with a manual verification of the algorithm. You are also provided grading functionality in the main class of the program, but it is partial: Running it will show what the first 25 marks out of 30 will be for your assignment assuming that the algorithm is implemented reasonably. The remaining 5 marks will be determined by running your work on a few other large examples. Your code will only be graded on the moons and not on any other platforms, and it must pass the grading tests on the moons in order to receive a grade. For this reason, you are encouraged to do your entire development on the moons: like for lab6, you will not be writing large quantities of code (our solution adds 30 lines of code to the Hamilton class, in addition to the lab6 code that added about 15 lines to the Graph class) A sophisticated development environment is not required for this amount of coding. Also the testing infrastructure is already set up on the moons. However, the coding in this assignment is more challenging than in lab6 and this is why the assignment is worth more, and you are given more time to do it. Assignment DescriptionIntroductionIn this assignment you will need to make a few modifications to one class in an existing set of java classes described in their javadoc.Be sure to finish Lab6 before starting this assignment to familiarize yourselves with the Graph API, java development process on the moons, and the provided testing infrastructure and process which are all used in both. Preparation on the moonsThe preparation is very similar to the one for Lab6:
HandoutsHere is an explanation of the handouts:
ProgrammingAs mentioned above, the only java file that you will work on is Hamilton.java. The class Hamilton is a static class i.e. a class that is not meant to be instantiated: all its methods and variables are static.
Compiling and TestingThe processes for compiling and testing your code are the same as for lab6: Your assignment will be graded on the one platform that you all have access to, the Computer Science Linux moons, and therefore you should make sure that your assignment is compiling and running smoothly on that platform. To that effect, you will find a makefile to compile your code and a testing script to run the tests in the Handouts directory.
The test script simply runs the main program which is located in the Test class. This Test class provides all the testing facilities that you will need to test your work. The main function uses test cases that are stored in the tests folder to calculate the first 25 grades (out of 30) for your assignment, assuming the algorithm is implemented reasonably. If you are struggling to pass the provided tests, you are encouraged to supplement this testing with your own files, and you can certainly modify Test.java to do so, but keep in mind that we will be using our own Test.java for grading, and not yours. The additional testing we will perform when grading your assignment will load test your program, so if you are finding that your program is slowing down on larger graphs, you should try to make your algorithm more efficient. March 14 update: because there are different definitions of Hamiltonian circuits for very small numbers of vertices,when we grade the assignment we will remove the test cases "toosmall" and "small", which are for graphs of 2 of fewer vertices, and we will redistribute their 2 grades in the other tests. Once your code is running smoothly, you are ready to submit the assignment as explained in the Submission section below. Do not wait until the last minute to start this assignment and test it on the moons as you may run into unexpected last minute problems! As mentioned above, your program must work on the moons in order to get a grade. As for lab6, do not wait until the last minute to test your code on the moons as you may run into unexpected last minute problems! As mentioned above, your program must work on the moons in order to get a grade. References and links
Assignment SubmissionThe submission process for this assignment is similar to the one for Lab6. There are 2 parts to this submission:
Last modified Thursday, 14-Mar-2024 14:41:26 EDT |