The full statement for the project is available through the slides on Moodle.
- Instance: medium
- Threshold 1: 1400
- Threshold 2: 1520
Grading:
- 7/20 if you find any valid solution.
- 12/20 if you reach the first threshold.
- 15/20 if you reach the second threshold. 20/20 if you find the best solution among all groups. Linear (depending on your rank in the scoreboard, per instance) in between.
The grade given by INGInious is not your final grade, as it will only give you either 0 (which is final), 7 (which is final), 12 (which is final) and 15 (which is the minimum you will obtain in this case).
Your solver will be started with the command
mvn -q exec:exec -Dexec.executable=java -Dexec.args="-Xss16m -classpath %classpath minicp.examples.CostProfitTSP path/to/instance"
Test it on your computer before testing on INGInious. Note that the filename given as input is not the same as the filename found in your repository (i.e. "path/to/instance" will never be "data/CostProfitTSP/medium").
You will need to add a main() method in the CostProfitTSP class, which will be the entry point of your solver. It should read the instance given as input, solve it and print the solution to standard output.
public static void main(String[] args) {
String filename = args[0];
// read instance
// solve it
// print solution
}
The last line of your output will be read, as it should contain your best found solution.
Use the CostProfitTSPSolution class to build the solution, and print only your last solution. It should be something like this:
Cost: 2000 [4, 0, 2, 6]
cost is of course the sum of the rewards obtain by each visits. The next line is the sequence of visit your solution is following.
Don't print anything else than your last solution, as it considerably slows down your submission.
You have 3 minutes in CPU (!!) time for each instance. Make sure your solver stops before being killed. You can measure the CPU time of your solver by using the following code snippet:
import java.lang.management.ManagementFactory; ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime();
Be sure to RTFM to understand what this function does.
INGInious