-
Notifications
You must be signed in to change notification settings - Fork 269
Implement optimization problems #2998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
as6325400
wants to merge
19
commits into
DOMjudge:8.3
Choose a base branch
from
as6325400:version-8.3.1-DS_OOP
base: 8.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add opt-score comparison to Scoreboard::scoreCompare(). When ‘Use optimisation score as score-tiebreaker’ is enabled, the list is now sorted by: 1. points 2. totalOptScore (max or min, per contest setting) 3. total runtime / total time 4. solve-times sequence Fixes the discrepancy where the UI still ranked teams by first-AC time even though opt-score decided the official rank. Supports both “maximize” (desc) and “minimize” (asc) modes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of a feature I needed for my class, I went ahead and implemented it myself. I'm not sure if this is something the DOMjudge team would be interested in adopting, but I thought I'd share it in case it can serve as a useful reference.
Issue: #2519
To use this feature, simply have the compare script output to stderr a line starting with
OPT_SCORE=
. Currently, I'm storing the value as a float, so both integers and decimals are supported.On the judgehost side, the score for each testcase is recorded in the judging_run table and then propagated to scorecache and rankcache.
To enable using the optscore as a contest tiebreaker, go to the contest settings and set
"Opt score as score tiebreaker"
to yes. This will reveal two options:You can then configure whether a higher or lower score is considered better for optimization problems.
Note: It is asserted that Runtime as score tiebreaker cannot be used at the same time as Opt score as score tiebreaker.

In the team interface, if Opt score as score tiebreaker is enabled, the optscore will be shown in the submission list for each submission. For problems that do not report an optscore, a value of 0 will be shown on the scoreboard and - in the submission list.

Regardless of whether the tiebreaker setting is enabled, jury members will always be able to see the optscore for each submission.

Standard problems (without optimization scores) are unaffected by this feature.

This implementation is essentially a minimum viable product (MVP). I’m not sure if outputting OPT_SCORE= directly in the compare script is the best long-term approach, but it works well for now.
Since my class is actively using this judge system, I’ve implemented the changes on version 8.3.1. If this feature is of interest, I can port the code to the main branch.
I’ve also set up a live demo judge at: https://domjudge.as6325400.org/
problem: https://domjudge.as6325400.org/public/problems/4/statement
If you’d like to try it out, feel free to message me on Slack for a login account.