From 91574007eb2fa436ddba07abeb78f5d40029b2fc Mon Sep 17 00:00:00 2001 From: FiveMovesAhead Date: Tue, 23 Dec 2025 23:41:00 +0800 Subject: [PATCH] Implement job scheduling challenge --- .github/workflows/build_algorithm.yml | 2 + Cargo.lock | 1 + scripts/test_algorithm | 1 + tig-algorithms/Cargo.toml | 2 + tig-algorithms/src/job_scheduling/mod.rs | 1997 +++++++++++++++++ tig-algorithms/src/job_scheduling/template.md | 41 + tig-algorithms/src/job_scheduling/template.rs | 50 + tig-binary/Cargo.toml | 2 + tig-binary/scripts/build_algorithm | 6 +- tig-challenges/Cargo.toml | 3 + .../baselines/dispatching_rules.rs | 177 ++ .../src/job_scheduling/baselines/mod.rs | 1 + tig-challenges/src/job_scheduling/mod.rs | 383 ++++ tig-challenges/src/lib.rs | 4 + tig-runtime/Cargo.toml | 2 + tig-runtime/src/main.rs | 6 + tig-verifier/Cargo.toml | 2 + tig-verifier/src/main.rs | 6 + 18 files changed, 2685 insertions(+), 1 deletion(-) create mode 100644 tig-algorithms/src/job_scheduling/mod.rs create mode 100644 tig-algorithms/src/job_scheduling/template.md create mode 100644 tig-algorithms/src/job_scheduling/template.rs create mode 100644 tig-challenges/src/job_scheduling/baselines/dispatching_rules.rs create mode 100644 tig-challenges/src/job_scheduling/baselines/mod.rs create mode 100644 tig-challenges/src/job_scheduling/mod.rs diff --git a/.github/workflows/build_algorithm.yml b/.github/workflows/build_algorithm.yml index 85d09520..695bb24e 100644 --- a/.github/workflows/build_algorithm.yml +++ b/.github/workflows/build_algorithm.yml @@ -9,12 +9,14 @@ on: - 'vector_search/*' - 'hypergraph/*' - 'neuralnet_optimizer/*' + - 'job_scheduling/*' - 'test/satisfiability/*' - 'test/vehicle_routing/*' - 'test/knapsack/*' - 'test/vector_search/*' - 'test/hypergraph/*' - 'test/neuralnet_optimizer/*' + - 'test/job_scheduling/*' jobs: init: diff --git a/Cargo.lock b/Cargo.lock index 7adfe68c..1832e49f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2067,6 +2067,7 @@ dependencies = [ "ndarray", "paste", "rand", + "rand_distr", "serde", "serde_json", "statrs", diff --git a/scripts/test_algorithm b/scripts/test_algorithm index 1fcb8451..6c904e9d 100644 --- a/scripts/test_algorithm +++ b/scripts/test_algorithm @@ -100,6 +100,7 @@ f"""Library not found at {so_path}: "vector_search": "c004", "hypergraph": "c005", "neuralnet_optimizer": "c006", + "job_scheduling": "c007", } challenge_id = challenge_ids[CHALLENGE] diff --git a/tig-algorithms/Cargo.toml b/tig-algorithms/Cargo.toml index a918dcf9..2b5d34fe 100644 --- a/tig-algorithms/Cargo.toml +++ b/tig-algorithms/Cargo.toml @@ -39,3 +39,5 @@ c005 = ["cudarc", "tig-challenges/c005"] hypergraph = ["c005"] c006 = ["cudarc", "tig-challenges/c006"] neuralnet_optimizer = ["c006"] +c007 = ["tig-challenges/c007"] +job_scheduling = ["c007"] diff --git a/tig-algorithms/src/job_scheduling/mod.rs b/tig-algorithms/src/job_scheduling/mod.rs new file mode 100644 index 00000000..5fcb6441 --- /dev/null +++ b/tig-algorithms/src/job_scheduling/mod.rs @@ -0,0 +1,1997 @@ +// c007_a001 + +// c007_a002 + +// c007_a003 + +// c007_a004 + +// c007_a005 + +// c007_a006 + +// c007_a007 + +// c007_a008 + +// c007_a009 + +// c007_a010 + +// c007_a011 + +// c007_a012 + +// c007_a013 + +// c007_a014 + +// c007_a015 + +// c007_a016 + +// c007_a017 + +// c007_a018 + +// c007_a019 + +// c007_a020 + +// c007_a021 + +// c007_a022 + +// c007_a023 + +// c007_a024 + +// c007_a025 + +// c007_a026 + +// c007_a027 + +// c007_a028 + +// c007_a029 + +// c007_a030 + +// c007_a031 + +// c007_a032 + +// c007_a033 + +// c007_a034 + +// c007_a035 + +// c007_a036 + +// c007_a037 + +// c007_a038 + +// c007_a039 + +// c007_a040 + +// c007_a041 + +// c007_a042 + +// c007_a043 + +// c007_a044 + +// c007_a045 + +// c007_a046 + +// c007_a047 + +// c007_a048 + +// c007_a049 + +// c007_a050 + +// c007_a051 + +// c007_a052 + +// c007_a053 + +// c007_a054 + +// c007_a055 + +// c007_a056 + +// c007_a057 + +// c007_a058 + +// c007_a059 + +// c007_a060 + +// c007_a061 + +// c007_a062 + +// c007_a063 + +// c007_a064 + +// c007_a065 + +// c007_a066 + +// c007_a067 + +// c007_a068 + +// c007_a069 + +// c007_a070 + +// c007_a071 + +// c007_a072 + +// c007_a073 + +// c007_a074 + +// c007_a075 + +// c007_a076 + +// c007_a077 + +// c007_a078 + +// c007_a079 + +// c007_a080 + +// c007_a081 + +// c007_a082 + +// c007_a083 + +// c007_a084 + +// c007_a085 + +// c007_a086 + +// c007_a087 + +// c007_a088 + +// c007_a089 + +// c007_a090 + +// c007_a091 + +// c007_a092 + +// c007_a093 + +// c007_a094 + +// c007_a095 + +// c007_a096 + +// c007_a097 + +// c007_a098 + +// c007_a099 + +// c007_a100 + +// c007_a101 + +// c007_a102 + +// c007_a103 + +// c007_a104 + +// c007_a105 + +// c007_a106 + +// c007_a107 + +// c007_a108 + +// c007_a109 + +// c007_a110 + +// c007_a111 + +// c007_a112 + +// c007_a113 + +// c007_a114 + +// c007_a115 + +// c007_a116 + +// c007_a117 + +// c007_a118 + +// c007_a119 + +// c007_a120 + +// c007_a121 + +// c007_a122 + +// c007_a123 + +// c007_a124 + +// c007_a125 + +// c007_a126 + +// c007_a127 + +// c007_a128 + +// c007_a129 + +// c007_a130 + +// c007_a131 + +// c007_a132 + +// c007_a133 + +// c007_a134 + +// c007_a135 + +// c007_a136 + +// c007_a137 + +// c007_a138 + +// c007_a139 + +// c007_a140 + +// c007_a141 + +// c007_a142 + +// c007_a143 + +// c007_a144 + +// c007_a145 + +// c007_a146 + +// c007_a147 + +// c007_a148 + +// c007_a149 + +// c007_a150 + +// c007_a151 + +// c007_a152 + +// c007_a153 + +// c007_a154 + +// c007_a155 + +// c007_a156 + +// c007_a157 + +// c007_a158 + +// c007_a159 + +// c007_a160 + +// c007_a161 + +// c007_a162 + +// c007_a163 + +// c007_a164 + +// c007_a165 + +// c007_a166 + +// c007_a167 + +// c007_a168 + +// c007_a169 + +// c007_a170 + +// c007_a171 + +// c007_a172 + +// c007_a173 + +// c007_a174 + +// c007_a175 + +// c007_a176 + +// c007_a177 + +// c007_a178 + +// c007_a179 + +// c007_a180 + +// c007_a181 + +// c007_a182 + +// c007_a183 + +// c007_a184 + +// c007_a185 + +// c007_a186 + +// c007_a187 + +// c007_a188 + +// c007_a189 + +// c007_a190 + +// c007_a191 + +// c007_a192 + +// c007_a193 + +// c007_a194 + +// c007_a195 + +// c007_a196 + +// c007_a197 + +// c007_a198 + +// c007_a199 + +// c007_a200 + +// c007_a201 + +// c007_a202 + +// c007_a203 + +// c007_a204 + +// c007_a205 + +// c007_a206 + +// c007_a207 + +// c007_a208 + +// c007_a209 + +// c007_a210 + +// c007_a211 + +// c007_a212 + +// c007_a213 + +// c007_a214 + +// c007_a215 + +// c007_a216 + +// c007_a217 + +// c007_a218 + +// c007_a219 + +// c007_a220 + +// c007_a221 + +// c007_a222 + +// c007_a223 + +// c007_a224 + +// c007_a225 + +// c007_a226 + +// c007_a227 + +// c007_a228 + +// c007_a229 + +// c007_a230 + +// c007_a231 + +// c007_a232 + +// c007_a233 + +// c007_a234 + +// c007_a235 + +// c007_a236 + +// c007_a237 + +// c007_a238 + +// c007_a239 + +// c007_a240 + +// c007_a241 + +// c007_a242 + +// c007_a243 + +// c007_a244 + +// c007_a245 + +// c007_a246 + +// c007_a247 + +// c007_a248 + +// c007_a249 + +// c007_a250 + +// c007_a251 + +// c007_a252 + +// c007_a253 + +// c007_a254 + +// c007_a255 + +// c007_a256 + +// c007_a257 + +// c007_a258 + +// c007_a259 + +// c007_a260 + +// c007_a261 + +// c007_a262 + +// c007_a263 + +// c007_a264 + +// c007_a265 + +// c007_a266 + +// c007_a267 + +// c007_a268 + +// c007_a269 + +// c007_a270 + +// c007_a271 + +// c007_a272 + +// c007_a273 + +// c007_a274 + +// c007_a275 + +// c007_a276 + +// c007_a277 + +// c007_a278 + +// c007_a279 + +// c007_a280 + +// c007_a281 + +// c007_a282 + +// c007_a283 + +// c007_a284 + +// c007_a285 + +// c007_a286 + +// c007_a287 + +// c007_a288 + +// c007_a289 + +// c007_a290 + +// c007_a291 + +// c007_a292 + +// c007_a293 + +// c007_a294 + +// c007_a295 + +// c007_a296 + +// c007_a297 + +// c007_a298 + +// c007_a299 + +// c007_a300 + +// c007_a301 + +// c007_a302 + +// c007_a303 + +// c007_a304 + +// c007_a305 + +// c007_a306 + +// c007_a307 + +// c007_a308 + +// c007_a309 + +// c007_a310 + +// c007_a311 + +// c007_a312 + +// c007_a313 + +// c007_a314 + +// c007_a315 + +// c007_a316 + +// c007_a317 + +// c007_a318 + +// c007_a319 + +// c007_a320 + +// c007_a321 + +// c007_a322 + +// c007_a323 + +// c007_a324 + +// c007_a325 + +// c007_a326 + +// c007_a327 + +// c007_a328 + +// c007_a329 + +// c007_a330 + +// c007_a331 + +// c007_a332 + +// c007_a333 + +// c007_a334 + +// c007_a335 + +// c007_a336 + +// c007_a337 + +// c007_a338 + +// c007_a339 + +// c007_a340 + +// c007_a341 + +// c007_a342 + +// c007_a343 + +// c007_a344 + +// c007_a345 + +// c007_a346 + +// c007_a347 + +// c007_a348 + +// c007_a349 + +// c007_a350 + +// c007_a351 + +// c007_a352 + +// c007_a353 + +// c007_a354 + +// c007_a355 + +// c007_a356 + +// c007_a357 + +// c007_a358 + +// c007_a359 + +// c007_a360 + +// c007_a361 + +// c007_a362 + +// c007_a363 + +// c007_a364 + +// c007_a365 + +// c007_a366 + +// c007_a367 + +// c007_a368 + +// c007_a369 + +// c007_a370 + +// c007_a371 + +// c007_a372 + +// c007_a373 + +// c007_a374 + +// c007_a375 + +// c007_a376 + +// c007_a377 + +// c007_a378 + +// c007_a379 + +// c007_a380 + +// c007_a381 + +// c007_a382 + +// c007_a383 + +// c007_a384 + +// c007_a385 + +// c007_a386 + +// c007_a387 + +// c007_a388 + +// c007_a389 + +// c007_a390 + +// c007_a391 + +// c007_a392 + +// c007_a393 + +// c007_a394 + +// c007_a395 + +// c007_a396 + +// c007_a397 + +// c007_a398 + +// c007_a399 + +// c007_a400 + +// c007_a401 + +// c007_a402 + +// c007_a403 + +// c007_a404 + +// c007_a405 + +// c007_a406 + +// c007_a407 + +// c007_a408 + +// c007_a409 + +// c007_a410 + +// c007_a411 + +// c007_a412 + +// c007_a413 + +// c007_a414 + +// c007_a415 + +// c007_a416 + +// c007_a417 + +// c007_a418 + +// c007_a419 + +// c007_a420 + +// c007_a421 + +// c007_a422 + +// c007_a423 + +// c007_a424 + +// c007_a425 + +// c007_a426 + +// c007_a427 + +// c007_a428 + +// c007_a429 + +// c007_a430 + +// c007_a431 + +// c007_a432 + +// c007_a433 + +// c007_a434 + +// c007_a435 + +// c007_a436 + +// c007_a437 + +// c007_a438 + +// c007_a439 + +// c007_a440 + +// c007_a441 + +// c007_a442 + +// c007_a443 + +// c007_a444 + +// c007_a445 + +// c007_a446 + +// c007_a447 + +// c007_a448 + +// c007_a449 + +// c007_a450 + +// c007_a451 + +// c007_a452 + +// c007_a453 + +// c007_a454 + +// c007_a455 + +// c007_a456 + +// c007_a457 + +// c007_a458 + +// c007_a459 + +// c007_a460 + +// c007_a461 + +// c007_a462 + +// c007_a463 + +// c007_a464 + +// c007_a465 + +// c007_a466 + +// c007_a467 + +// c007_a468 + +// c007_a469 + +// c007_a470 + +// c007_a471 + +// c007_a472 + +// c007_a473 + +// c007_a474 + +// c007_a475 + +// c007_a476 + +// c007_a477 + +// c007_a478 + +// c007_a479 + +// c007_a480 + +// c007_a481 + +// c007_a482 + +// c007_a483 + +// c007_a484 + +// c007_a485 + +// c007_a486 + +// c007_a487 + +// c007_a488 + +// c007_a489 + +// c007_a490 + +// c007_a491 + +// c007_a492 + +// c007_a493 + +// c007_a494 + +// c007_a495 + +// c007_a496 + +// c007_a497 + +// c007_a498 + +// c007_a499 + +// c007_a500 + +// c007_a501 + +// c007_a502 + +// c007_a503 + +// c007_a504 + +// c007_a505 + +// c007_a506 + +// c007_a507 + +// c007_a508 + +// c007_a509 + +// c007_a510 + +// c007_a511 + +// c007_a512 + +// c007_a513 + +// c007_a514 + +// c007_a515 + +// c007_a516 + +// c007_a517 + +// c007_a518 + +// c007_a519 + +// c007_a520 + +// c007_a521 + +// c007_a522 + +// c007_a523 + +// c007_a524 + +// c007_a525 + +// c007_a526 + +// c007_a527 + +// c007_a528 + +// c007_a529 + +// c007_a530 + +// c007_a531 + +// c007_a532 + +// c007_a533 + +// c007_a534 + +// c007_a535 + +// c007_a536 + +// c007_a537 + +// c007_a538 + +// c007_a539 + +// c007_a540 + +// c007_a541 + +// c007_a542 + +// c007_a543 + +// c007_a544 + +// c007_a545 + +// c007_a546 + +// c007_a547 + +// c007_a548 + +// c007_a549 + +// c007_a550 + +// c007_a551 + +// c007_a552 + +// c007_a553 + +// c007_a554 + +// c007_a555 + +// c007_a556 + +// c007_a557 + +// c007_a558 + +// c007_a559 + +// c007_a560 + +// c007_a561 + +// c007_a562 + +// c007_a563 + +// c007_a564 + +// c007_a565 + +// c007_a566 + +// c007_a567 + +// c007_a568 + +// c007_a569 + +// c007_a570 + +// c007_a571 + +// c007_a572 + +// c007_a573 + +// c007_a574 + +// c007_a575 + +// c007_a576 + +// c007_a577 + +// c007_a578 + +// c007_a579 + +// c007_a580 + +// c007_a581 + +// c007_a582 + +// c007_a583 + +// c007_a584 + +// c007_a585 + +// c007_a586 + +// c007_a587 + +// c007_a588 + +// c007_a589 + +// c007_a590 + +// c007_a591 + +// c007_a592 + +// c007_a593 + +// c007_a594 + +// c007_a595 + +// c007_a596 + +// c007_a597 + +// c007_a598 + +// c007_a599 + +// c007_a600 + +// c007_a601 + +// c007_a602 + +// c007_a603 + +// c007_a604 + +// c007_a605 + +// c007_a606 + +// c007_a607 + +// c007_a608 + +// c007_a609 + +// c007_a610 + +// c007_a611 + +// c007_a612 + +// c007_a613 + +// c007_a614 + +// c007_a615 + +// c007_a616 + +// c007_a617 + +// c007_a618 + +// c007_a619 + +// c007_a620 + +// c007_a621 + +// c007_a622 + +// c007_a623 + +// c007_a624 + +// c007_a625 + +// c007_a626 + +// c007_a627 + +// c007_a628 + +// c007_a629 + +// c007_a630 + +// c007_a631 + +// c007_a632 + +// c007_a633 + +// c007_a634 + +// c007_a635 + +// c007_a636 + +// c007_a637 + +// c007_a638 + +// c007_a639 + +// c007_a640 + +// c007_a641 + +// c007_a642 + +// c007_a643 + +// c007_a644 + +// c007_a645 + +// c007_a646 + +// c007_a647 + +// c007_a648 + +// c007_a649 + +// c007_a650 + +// c007_a651 + +// c007_a652 + +// c007_a653 + +// c007_a654 + +// c007_a655 + +// c007_a656 + +// c007_a657 + +// c007_a658 + +// c007_a659 + +// c007_a660 + +// c007_a661 + +// c007_a662 + +// c007_a663 + +// c007_a664 + +// c007_a665 + +// c007_a666 + +// c007_a667 + +// c007_a668 + +// c007_a669 + +// c007_a670 + +// c007_a671 + +// c007_a672 + +// c007_a673 + +// c007_a674 + +// c007_a675 + +// c007_a676 + +// c007_a677 + +// c007_a678 + +// c007_a679 + +// c007_a680 + +// c007_a681 + +// c007_a682 + +// c007_a683 + +// c007_a684 + +// c007_a685 + +// c007_a686 + +// c007_a687 + +// c007_a688 + +// c007_a689 + +// c007_a690 + +// c007_a691 + +// c007_a692 + +// c007_a693 + +// c007_a694 + +// c007_a695 + +// c007_a696 + +// c007_a697 + +// c007_a698 + +// c007_a699 + +// c007_a700 + +// c007_a701 + +// c007_a702 + +// c007_a703 + +// c007_a704 + +// c007_a705 + +// c007_a706 + +// c007_a707 + +// c007_a708 + +// c007_a709 + +// c007_a710 + +// c007_a711 + +// c007_a712 + +// c007_a713 + +// c007_a714 + +// c007_a715 + +// c007_a716 + +// c007_a717 + +// c007_a718 + +// c007_a719 + +// c007_a720 + +// c007_a721 + +// c007_a722 + +// c007_a723 + +// c007_a724 + +// c007_a725 + +// c007_a726 + +// c007_a727 + +// c007_a728 + +// c007_a729 + +// c007_a730 + +// c007_a731 + +// c007_a732 + +// c007_a733 + +// c007_a734 + +// c007_a735 + +// c007_a736 + +// c007_a737 + +// c007_a738 + +// c007_a739 + +// c007_a740 + +// c007_a741 + +// c007_a742 + +// c007_a743 + +// c007_a744 + +// c007_a745 + +// c007_a746 + +// c007_a747 + +// c007_a748 + +// c007_a749 + +// c007_a750 + +// c007_a751 + +// c007_a752 + +// c007_a753 + +// c007_a754 + +// c007_a755 + +// c007_a756 + +// c007_a757 + +// c007_a758 + +// c007_a759 + +// c007_a760 + +// c007_a761 + +// c007_a762 + +// c007_a763 + +// c007_a764 + +// c007_a765 + +// c007_a766 + +// c007_a767 + +// c007_a768 + +// c007_a769 + +// c007_a770 + +// c007_a771 + +// c007_a772 + +// c007_a773 + +// c007_a774 + +// c007_a775 + +// c007_a776 + +// c007_a777 + +// c007_a778 + +// c007_a779 + +// c007_a780 + +// c007_a781 + +// c007_a782 + +// c007_a783 + +// c007_a784 + +// c007_a785 + +// c007_a786 + +// c007_a787 + +// c007_a788 + +// c007_a789 + +// c007_a790 + +// c007_a791 + +// c007_a792 + +// c007_a793 + +// c007_a794 + +// c007_a795 + +// c007_a796 + +// c007_a797 + +// c007_a798 + +// c007_a799 + +// c007_a800 + +// c007_a801 + +// c007_a802 + +// c007_a803 + +// c007_a804 + +// c007_a805 + +// c007_a806 + +// c007_a807 + +// c007_a808 + +// c007_a809 + +// c007_a810 + +// c007_a811 + +// c007_a812 + +// c007_a813 + +// c007_a814 + +// c007_a815 + +// c007_a816 + +// c007_a817 + +// c007_a818 + +// c007_a819 + +// c007_a820 + +// c007_a821 + +// c007_a822 + +// c007_a823 + +// c007_a824 + +// c007_a825 + +// c007_a826 + +// c007_a827 + +// c007_a828 + +// c007_a829 + +// c007_a830 + +// c007_a831 + +// c007_a832 + +// c007_a833 + +// c007_a834 + +// c007_a835 + +// c007_a836 + +// c007_a837 + +// c007_a838 + +// c007_a839 + +// c007_a840 + +// c007_a841 + +// c007_a842 + +// c007_a843 + +// c007_a844 + +// c007_a845 + +// c007_a846 + +// c007_a847 + +// c007_a848 + +// c007_a849 + +// c007_a850 + +// c007_a851 + +// c007_a852 + +// c007_a853 + +// c007_a854 + +// c007_a855 + +// c007_a856 + +// c007_a857 + +// c007_a858 + +// c007_a859 + +// c007_a860 + +// c007_a861 + +// c007_a862 + +// c007_a863 + +// c007_a864 + +// c007_a865 + +// c007_a866 + +// c007_a867 + +// c007_a868 + +// c007_a869 + +// c007_a870 + +// c007_a871 + +// c007_a872 + +// c007_a873 + +// c007_a874 + +// c007_a875 + +// c007_a876 + +// c007_a877 + +// c007_a878 + +// c007_a879 + +// c007_a880 + +// c007_a881 + +// c007_a882 + +// c007_a883 + +// c007_a884 + +// c007_a885 + +// c007_a886 + +// c007_a887 + +// c007_a888 + +// c007_a889 + +// c007_a890 + +// c007_a891 + +// c007_a892 + +// c007_a893 + +// c007_a894 + +// c007_a895 + +// c007_a896 + +// c007_a897 + +// c007_a898 + +// c007_a899 + +// c007_a900 + +// c007_a901 + +// c007_a902 + +// c007_a903 + +// c007_a904 + +// c007_a905 + +// c007_a906 + +// c007_a907 + +// c007_a908 + +// c007_a909 + +// c007_a910 + +// c007_a911 + +// c007_a912 + +// c007_a913 + +// c007_a914 + +// c007_a915 + +// c007_a916 + +// c007_a917 + +// c007_a918 + +// c007_a919 + +// c007_a920 + +// c007_a921 + +// c007_a922 + +// c007_a923 + +// c007_a924 + +// c007_a925 + +// c007_a926 + +// c007_a927 + +// c007_a928 + +// c007_a929 + +// c007_a930 + +// c007_a931 + +// c007_a932 + +// c007_a933 + +// c007_a934 + +// c007_a935 + +// c007_a936 + +// c007_a937 + +// c007_a938 + +// c007_a939 + +// c007_a940 + +// c007_a941 + +// c007_a942 + +// c007_a943 + +// c007_a944 + +// c007_a945 + +// c007_a946 + +// c007_a947 + +// c007_a948 + +// c007_a949 + +// c007_a950 + +// c007_a951 + +// c007_a952 + +// c007_a953 + +// c007_a954 + +// c007_a955 + +// c007_a956 + +// c007_a957 + +// c007_a958 + +// c007_a959 + +// c007_a960 + +// c007_a961 + +// c007_a962 + +// c007_a963 + +// c007_a964 + +// c007_a965 + +// c007_a966 + +// c007_a967 + +// c007_a968 + +// c007_a969 + +// c007_a970 + +// c007_a971 + +// c007_a972 + +// c007_a973 + +// c007_a974 + +// c007_a975 + +// c007_a976 + +// c007_a977 + +// c007_a978 + +// c007_a979 + +// c007_a980 + +// c007_a981 + +// c007_a982 + +// c007_a983 + +// c007_a984 + +// c007_a985 + +// c007_a986 + +// c007_a987 + +// c007_a988 + +// c007_a989 + +// c007_a990 + +// c007_a991 + +// c007_a992 + +// c007_a993 + +// c007_a994 + +// c007_a995 + +// c007_a996 + +// c007_a997 + +// c007_a998 + +// c007_a999 diff --git a/tig-algorithms/src/job_scheduling/template.md b/tig-algorithms/src/job_scheduling/template.md new file mode 100644 index 00000000..5ddf66cf --- /dev/null +++ b/tig-algorithms/src/job_scheduling/template.md @@ -0,0 +1,41 @@ +# TIG Code Submission + +## Submission Details + +* **Challenge Name:** job_scheduling +* **Algorithm Name:** [name of submission] +* **Copyright:** [year work created] [name of copyright owner] +* **Identity of Submitter:** [name of person or entity submitting the work to TIG] +* **Identity of Creator of Algorithmic Method:** [if applicable else null] +* **Unique Algorithm Identifier (UAI):** [if applicable else null] + + +## References and Acknowledgments +*(If this implementation is based on or inspired by existing work, please include citations and acknowledgments below. Remove this section if unused.)* + +### 1. Academic Papers +- [Author(s)], *"[Paper Title]"*, DOI: [DOI or URL if available] + +### 2. Code References +- [Author(s)] – [URL] + +### 3. Other +- [Author(s)] – [Details or description] + + +## Additional Notes +*(Include any relevant context, usage notes, or implementation details here. Remove this section if unused.)* + + +## License + +The files in this folder are under the following licenses: +* TIG Benchmarker Outbound License +* TIG Commercial License +* TIG Inbound Game License +* TIG Innovator Outbound Game License +* TIG Open Data License +* TIG THV Game License + +Copies of the licenses can be obtained at: +https://github.com/tig-foundation/tig-monorepo/tree/main/docs/licenses \ No newline at end of file diff --git a/tig-algorithms/src/job_scheduling/template.rs b/tig-algorithms/src/job_scheduling/template.rs new file mode 100644 index 00000000..6fe0c5ee --- /dev/null +++ b/tig-algorithms/src/job_scheduling/template.rs @@ -0,0 +1,50 @@ +// TIG's UI uses the pattern `tig_challenges::` to automatically detect your algorithm's challenge +use crate::{seeded_hasher, HashMap, HashSet}; +use anyhow::{anyhow, Result}; +use serde::{Deserialize, Serialize}; +use serde_json::{Map, Value}; +use tig_challenges::job_scheduling::*; + +#[derive(Serialize, Deserialize)] +pub struct Hyperparameters { + // Optionally define hyperparameters here. Example: + // pub param1: usize, + // pub param2: f64, +} + +pub fn help() { + // Print help information about your algorithm here. It will be invoked with `help_algorithm` script + println!("No help information provided."); +} + +pub fn solve_challenge( + challenge: &Challenge, + save_solution: &dyn Fn(&Solution) -> Result<()>, + hyperparameters: &Option>, +) -> Result<()> { + // If you need random numbers, recommend using SmallRng with challenge.seed: + // use rand::{rngs::SmallRng, Rng, SeedableRng}; + // let mut rng = SmallRng::from_seed(challenge.seed); + + // If you need HashMap or HashSet, make sure to use a deterministic hasher for consistent runtime_signature: + // use crate::{seeded_hasher, HashMap, HashSet}; + // let hasher = seeded_hasher(&challenge.seed); + // let map = HashMap::with_hasher(hasher); + + // Support hyperparameters if needed: + // let hyperparameters = match hyperparameters { + // Some(hyperparameters) => { + // serde_json::from_value::(Value::Object(hyperparameters.clone())) + // .map_err(|e| anyhow!("Failed to parse hyperparameters: {}", e))? + // } + // None => Hyperparameters { /* set default values here */ }, + // }; + + // use save_solution(&Solution) to save your solution. Overwrites any previous solution + + // return Err() if your algorithm encounters an error + // return Ok(()) if your algorithm is finished + Err(anyhow!("Not implemented")) +} + +// Important! Do not include any tests in this file, it will result in your submission being rejected diff --git a/tig-binary/Cargo.toml b/tig-binary/Cargo.toml index 6604e637..a267e7c5 100644 --- a/tig-binary/Cargo.toml +++ b/tig-binary/Cargo.toml @@ -36,3 +36,5 @@ c005 = ["cuda", "tig-algorithms/c005", "tig-challenges/c005"] hypergraph = ["c005"] c006 = ["cuda", "tig-algorithms/c006", "tig-challenges/c006"] neuralnet_optimizer = ["c006"] +c007 = ["tig-algorithms/c007", "tig-challenges/c007"] +job_scheduling = ["c007"] diff --git a/tig-binary/scripts/build_algorithm b/tig-binary/scripts/build_algorithm index 5960ca8f..9dd59cf7 100644 --- a/tig-binary/scripts/build_algorithm +++ b/tig-binary/scripts/build_algorithm @@ -46,8 +46,12 @@ case "$CHALLENGE" in build_so $ALGORITHM build_ptx $ALGORITHM ;; + job_scheduling) + echo "Building ALGORITHM '$ALGORITHM' for CHALLENGE 'job_scheduling'" + build_so $ALGORITHM + ;; *) - echo "Error: Invalid CHALLENGE value. Must be one of: satisfiability, knapsack, vehicle_routing, vector_search, hypergraph, neuralnet_optimizer" + echo "Error: Invalid CHALLENGE value. Must be one of: satisfiability, knapsack, vehicle_routing, vector_search, hypergraph, neuralnet_optimizer, job_scheduling" exit 1 ;; esac \ No newline at end of file diff --git a/tig-challenges/Cargo.toml b/tig-challenges/Cargo.toml index 7a270a21..9cca4bf8 100644 --- a/tig-challenges/Cargo.toml +++ b/tig-challenges/Cargo.toml @@ -21,6 +21,7 @@ rand = { version = "0.8.5", default-features = false, features = [ "std_rng", "small_rng", ] } +rand_distr = "0.4.3" serde = { version = "1.0.196", features = ["derive"] } serde_json = { version = "1.0.113" } statrs = { version = "0.18.0" } @@ -39,3 +40,5 @@ c005 = ["cudarc"] hypergraph = ["c005"] c006 = ["cudarc", "cudarc/cublas", "cudarc/cudnn"] neuralnet_optimizer = ["c006"] +c007 = [] +job_scheduling = ["c007"] diff --git a/tig-challenges/src/job_scheduling/baselines/dispatching_rules.rs b/tig-challenges/src/job_scheduling/baselines/dispatching_rules.rs new file mode 100644 index 00000000..7d5d681a --- /dev/null +++ b/tig-challenges/src/job_scheduling/baselines/dispatching_rules.rs @@ -0,0 +1,177 @@ +use crate::job_scheduling::{Challenge, Solution}; +use anyhow::{anyhow, Result}; +use serde_json::{Map, Value}; +use std::collections::HashMap; + +fn average_processing_time(operation: &HashMap) -> f64 { + if operation.is_empty() { + return 0.0; + } + let sum: u32 = operation.values().sum(); + sum as f64 / operation.len() as f64 +} + +fn earliest_end_time( + time: u32, + machine_available_time: &[u32], + operation: &HashMap, +) -> u32 { + let mut earliest_end = u32::MAX; + for (&machine_id, &proc_time) in operation.iter() { + let start = time.max(machine_available_time[machine_id]); + let end = start + proc_time; + if end < earliest_end { + earliest_end = end; + } + } + earliest_end +} + +pub fn solve_challenge( + challenge: &Challenge, + save_solution: &dyn Fn(&Solution) -> Result<()>, + _hyperparameters: &Option>, +) -> Result<()> { + let num_jobs = challenge.num_jobs; + let num_machines = challenge.num_machines; + + let mut job_products = Vec::with_capacity(num_jobs); + for (product, count) in challenge.jobs_per_product.iter().enumerate() { + for _ in 0..*count { + job_products.push(product); + } + } + if job_products.len() != num_jobs { + return Err(anyhow!( + "Job count mismatch. Expected {}, got {}", + num_jobs, + job_products.len() + )); + } + + let mut product_avg_times = Vec::with_capacity(challenge.product_processing_times.len()); + for product_ops in challenge.product_processing_times.iter() { + let mut avg_ops = Vec::with_capacity(product_ops.len()); + for op in product_ops.iter() { + avg_ops.push(average_processing_time(op)); + } + product_avg_times.push(avg_ops); + } + + let mut job_ops_len = Vec::with_capacity(num_jobs); + let mut job_remaining_work: Vec = Vec::with_capacity(num_jobs); + for &product in job_products.iter() { + let avg_ops = &product_avg_times[product]; + job_ops_len.push(avg_ops.len()); + job_remaining_work.push(avg_ops.iter().sum()); + } + + let mut job_next_op_idx = vec![0usize; num_jobs]; + let mut job_ready_time = vec![0u32; num_jobs]; + let mut machine_available_time = vec![0u32; num_machines]; + let mut job_schedule = job_ops_len + .iter() + .map(|&ops_len| Vec::with_capacity(ops_len)) + .collect::>(); + + let mut remaining_ops = job_ops_len.iter().sum::(); + let mut time = 0u32; + let eps = 1e-9_f64; + + while remaining_ops > 0 { + let mut available_machines = (0..num_machines) + .filter(|&m| machine_available_time[m] <= time) + .collect::>(); + available_machines.sort_unstable(); + + let mut scheduled_any = false; + for &machine in available_machines.iter() { + let mut best_job: Option = None; + let mut best_priority = -1.0_f64; + + for job in 0..num_jobs { + if job_next_op_idx[job] >= job_ops_len[job] { + continue; + } + if job_ready_time[job] > time { + continue; + } + + let product = job_products[job]; + let op_idx = job_next_op_idx[job]; + let op_times = &challenge.product_processing_times[product][op_idx]; + let proc_time = match op_times.get(&machine) { + Some(&value) => value, + None => continue, + }; + + let earliest_end = earliest_end_time(time, &machine_available_time, op_times); + let machine_end = time.max(machine_available_time[machine]) + proc_time; + if machine_end != earliest_end { + continue; + } + + let priority = job_remaining_work[job]; + if priority > best_priority + eps + || ((priority - best_priority).abs() <= eps + && best_job.map_or(true, |best| job < best)) + { + best_job = Some(job); + best_priority = priority; + } + } + + if let Some(job) = best_job { + let product = job_products[job]; + let op_idx = job_next_op_idx[job]; + let op_times = &challenge.product_processing_times[product][op_idx]; + let proc_time = op_times[&machine]; + + let start_time = time.max(machine_available_time[machine]); + let end_time = start_time + proc_time; + + job_schedule[job].push((machine, start_time)); + job_next_op_idx[job] += 1; + job_ready_time[job] = end_time; + machine_available_time[machine] = end_time; + job_remaining_work[job] -= product_avg_times[product][op_idx]; + if job_remaining_work[job] < 0.0 { + job_remaining_work[job] = 0.0; + } + + remaining_ops -= 1; + scheduled_any = true; + } + } + + if remaining_ops == 0 { + break; + } + + // Compute next event time (either machine becoming available or job becoming ready) + let mut next_time: Option = None; + for &t in machine_available_time.iter() { + if t > time { + next_time = Some(next_time.map_or(t, |best| best.min(t))); + } + } + for job in 0..num_jobs { + if job_next_op_idx[job] < job_ops_len[job] && job_ready_time[job] > time { + let t = job_ready_time[job]; + next_time = Some(next_time.map_or(t, |best| best.min(t))); + } + } + + // Advance time to next event + time = next_time.ok_or_else(|| { + if scheduled_any { + anyhow!("No next event time found while operations remain unscheduled") + } else { + anyhow!("No schedulable operations remain; dispatching rules stalled") + } + })?; + } + + save_solution(&Solution { job_schedule })?; + Ok(()) +} diff --git a/tig-challenges/src/job_scheduling/baselines/mod.rs b/tig-challenges/src/job_scheduling/baselines/mod.rs new file mode 100644 index 00000000..b909fdec --- /dev/null +++ b/tig-challenges/src/job_scheduling/baselines/mod.rs @@ -0,0 +1 @@ +pub mod dispatching_rules; diff --git a/tig-challenges/src/job_scheduling/mod.rs b/tig-challenges/src/job_scheduling/mod.rs new file mode 100644 index 00000000..30f91699 --- /dev/null +++ b/tig-challenges/src/job_scheduling/mod.rs @@ -0,0 +1,383 @@ +use crate::QUALITY_PRECISION; +mod baselines; +use anyhow::{anyhow, Result}; +use rand::{ + distributions::Distribution, + rngs::{SmallRng, StdRng}, + Rng, SeedableRng, +}; +use rand_distr::Normal; +use serde::{Deserialize, Serialize}; +use std::cell::RefCell; +use std::collections::{HashMap, HashSet}; + +pub struct FlowConfig { + pub avg_op_flexibility: f32, + pub reentrance_level: f32, + pub flow_structure: f32, + pub product_mix_ratio: f32, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum Flow { + STRICT, + PARALLEL, + RANDOM, + COMPLEX, + CHAOTIC, +} + +impl From for FlowConfig { + fn from(flow: Flow) -> Self { + match flow { + Flow::STRICT => FlowConfig { + avg_op_flexibility: 1.0, + reentrance_level: 0.2, + flow_structure: 0.0, + product_mix_ratio: 0.5, + }, + Flow::PARALLEL => FlowConfig { + avg_op_flexibility: 3.0, + reentrance_level: 0.2, + flow_structure: 0.0, + product_mix_ratio: 0.5, + }, + Flow::RANDOM => FlowConfig { + avg_op_flexibility: 1.0, + reentrance_level: 0.0, + flow_structure: 0.4, + product_mix_ratio: 1.0, + }, + Flow::COMPLEX => FlowConfig { + avg_op_flexibility: 3.0, + reentrance_level: 0.2, + flow_structure: 0.4, + product_mix_ratio: 1.0, + }, + Flow::CHAOTIC => FlowConfig { + avg_op_flexibility: 10.0, + reentrance_level: 0.0, + flow_structure: 1.0, + product_mix_ratio: 1.0, + }, + } + } +} + +impl std::fmt::Display for Flow { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Flow::STRICT => write!(f, "strict"), + Flow::PARALLEL => write!(f, "parallel"), + Flow::RANDOM => write!(f, "random"), + Flow::COMPLEX => write!(f, "complex"), + Flow::CHAOTIC => write!(f, "chaotic"), + } + } +} + +impl std::str::FromStr for Flow { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result { + match s.to_lowercase().as_str() { + "strict" => Ok(Flow::STRICT), + "parallel" => Ok(Flow::PARALLEL), + "random" => Ok(Flow::RANDOM), + "complex" => Ok(Flow::COMPLEX), + "chaotic" => Ok(Flow::CHAOTIC), + _ => Err(anyhow::anyhow!("Invalid flow type: {}", s)), + } + } +} + +impl_kv_string_serde! { + Track { + n: usize, + m: usize, + o: usize, + r#flow: Flow + } +} + +impl_base64_serde! { + Solution { + job_schedule: Vec>, + } +} + +impl Solution { + pub fn new() -> Self { + Self { + job_schedule: Vec::new(), + } + } +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct Challenge { + pub seed: [u8; 32], + pub num_jobs: usize, + pub num_machines: usize, + pub num_operations: usize, + pub jobs_per_product: Vec, + // each product has a sequence of operations, and each operation has a map of eligible machines to processing times + pub product_processing_times: Vec>>, +} + +impl Challenge { + pub fn generate_instance(seed: &[u8; 32], track: &Track) -> Result { + let mut rng = SmallRng::from_seed(StdRng::from_seed(seed.clone()).r#gen()); + let FlowConfig { + avg_op_flexibility, + reentrance_level, + flow_structure, + product_mix_ratio, + } = track.flow.clone().into(); + let n_jobs = track.n; + let n_machines = track.m; + let n_op_types = track.o; + let n_products = 1.max((product_mix_ratio * n_jobs as f32) as usize); + let n_routes = 1.max((flow_structure * n_jobs as f32) as usize); + let min_eligible_machines = 1; + let flexibility_std_dev = 0.5; + let base_proc_time_min = 1; + let base_proc_time_max = 200; + let min_speed_factor = 0.8; + let max_speed_factor = 1.2; + + // random product for each job, only keep products that have at least one job + let mut map = HashMap::new(); + let jobs_per_product = (0..n_jobs).fold(Vec::new(), |mut acc, _| { + let map_len = map.len(); + let product = *map + .entry(rng.gen_range(0..n_products)) + .or_insert_with(|| map_len); + if product >= acc.len() { + acc.push(0); + } + acc[product] += 1; + acc + }); + // actual number of products (some products may have zero jobs) + let n_products = jobs_per_product.len(); + + // random route for each product, only keep routes that are used + let mut map = HashMap::new(); + let product_route = (0..n_products) + .map(|_| { + let map_len = map.len(); + *map.entry(rng.gen_range(0..n_routes)) + .or_insert_with(|| map_len) + }) + .collect::>(); + // actual number of routes + let n_routes = map.len(); + + // generate operation sequence for each route + let routes = (0..n_routes) + .map(|_| { + let seq_len = n_op_types; + let mut base_sequence: Vec = (0..n_op_types).collect(); + let mut steps = Vec::new(); + + // randomly build op sequence + for _ in 0..seq_len { + let next_op_idx = if rng.r#gen::() < flow_structure { + // Job Shop Logic: Random permutation + rng.gen_range(0..base_sequence.len()) + } else { + // Flow Shop Logic: Pick next sequential op + 0 + }; + + let op_id = base_sequence.remove(next_op_idx); + steps.push(op_id); + } + + for step_idx in (2..steps.len()).rev() { + // Reentrance Logic + if rng.r#gen::() < reentrance_level { + // assuming reentrance_level of 0.1 + let op_id = steps[rng.gen_range(0..step_idx - 1)]; + steps.insert(step_idx, op_id); + } + } + + steps + }) + .collect::>>(); + + // generate machine eligibility and base processing time for each operation + let normal = Normal::new(avg_op_flexibility, flexibility_std_dev).unwrap(); + let all_machines = (0..n_machines).collect::>(); + let op_eligible_machines = (0..n_op_types) + .map(|i| { + if avg_op_flexibility as usize >= n_machines { + (0..n_machines).collect::>() + } else { + let mut eligible = HashSet::::from([if i < n_machines { + i + } else { + rng.gen_range(0..n_machines) + }]); + if avg_op_flexibility > 1.0 { + let target_flex = min_eligible_machines + .max(normal.sample(&mut rng) as usize) + .min(n_machines); + let mut remaining = all_machines + .difference(&eligible) + .cloned() + .collect::>(); + let num_to_add = (target_flex - 1).min(remaining.len()); + for j in 0..num_to_add { + let idx = rng.gen_range(j..remaining.len()); + remaining.swap(j, idx); + } + eligible.extend(remaining[..num_to_add].iter().cloned()); + } + eligible + } + }) + .collect::>(); + let base_proc_times = (0..n_op_types) + .map(|_| rng.gen_range(base_proc_time_min..=base_proc_time_max)) + .collect::>(); + + // generate processing times for each product according to its route + let product_processing_times = product_route + .iter() + .map(|&r_idx| { + let route = &routes[r_idx]; + route + .iter() + .map(|&op_id| { + let machines = &op_eligible_machines[op_id]; + let base_time = base_proc_times[op_id]; + machines + .iter() + .map(|&m_id| { + ( + m_id, + 1.max( + (base_time as f32 + * (min_speed_factor + + (max_speed_factor - min_speed_factor) + * rng.r#gen::())) + as u32, + ), + ) + }) + .collect::>() + }) + .collect::>() + }) + .collect::>(); + + Ok(Challenge { + seed: seed.clone(), + num_jobs: n_jobs, + num_machines: n_machines, + num_operations: n_op_types, + jobs_per_product, + product_processing_times, + }) + } + + pub fn evaluate_makespan(&self, solution: &Solution) -> Result { + if solution.job_schedule.len() != self.num_jobs { + return Err(anyhow!( + "Expecting solution to have {} jobs. Got {}", + self.num_jobs, + solution.job_schedule.len(), + )); + } + let mut job = 0; + let mut machine_usage = HashMap::>::new(); + let mut makespan = 0u32; + for (product, num_jobs) in self.jobs_per_product.iter().enumerate() { + for _ in 0..*num_jobs { + let schedule = &solution.job_schedule[job]; + let processing_times = &self.product_processing_times[product]; + if schedule.len() != processing_times.len() { + return Err(anyhow!( + "Job {} of product {} expecting {} operations. Got {}", + job, + product, + processing_times.len(), + schedule.len(), + )); + } + let mut min_start_time = 0; + for (op_idx, &(machine, start_time)) in schedule.iter().enumerate() { + let eligible_machines = &processing_times[op_idx]; + if !eligible_machines.contains_key(&machine) { + return Err(anyhow!("Job {} schedule contains ineligible machine", job,)); + } + if start_time < min_start_time { + return Err(anyhow!( + "Job {} schedule contains operation starting before previous is complete", + job, + )); + } + let finish_time = start_time + eligible_machines[&machine]; + machine_usage + .entry(machine) + .or_default() + .push((start_time, finish_time)); + min_start_time = finish_time; + } + // min_start_time is the finish time of the job + if min_start_time > makespan { + makespan = min_start_time; + } + job += 1; + } + } + + for (machine, usage) in machine_usage.iter_mut() { + usage.sort_by_key(|&(start, _)| start); + for i in 1..usage.len() { + if usage[i].0 < usage[i - 1].1 { + return Err(anyhow!( + "Machine {} is scheduled with overlapping jobs", + machine, + )); + } + } + } + + Ok(makespan) + } + + conditional_pub!( + fn compute_greedy_baseline(&self) -> Result { + let solution = RefCell::new(Solution::new()); + let save_solution_fn = |s: &Solution| -> Result<()> { + *solution.borrow_mut() = s.clone(); + Ok(()) + }; + baselines::dispatching_rules::solve_challenge(self, &save_solution_fn, &None)?; + Ok(solution.into_inner()) + } + ); + + conditional_pub!( + fn compute_sota_baseline(&self) -> Result { + Err(anyhow!("Not implemented yet")) + } + ); + + conditional_pub!( + fn evaluate_solution(&self, solution: &Solution) -> Result { + let makespan = self.evaluate_makespan(solution)?; + let greedy_solution = self.compute_greedy_baseline()?; + let greedy_makespan = self.evaluate_makespan(&greedy_solution)?; + // TODO: implement SOTA baseline + let quality = (greedy_makespan as f64 - makespan as f64) / greedy_makespan as f64; + let quality = quality.clamp(-10.0, 10.0) * QUALITY_PRECISION as f64; + let quality = quality.round() as i32; + Ok(quality) + } + ); +} diff --git a/tig-challenges/src/lib.rs b/tig-challenges/src/lib.rs index a4c636c5..8e21c643 100644 --- a/tig-challenges/src/lib.rs +++ b/tig-challenges/src/lib.rs @@ -202,3 +202,7 @@ pub use hypergraph as c005; pub mod neuralnet_optimizer; #[cfg(feature = "c006")] pub use neuralnet_optimizer as c006; +#[cfg(feature = "c007")] +pub mod job_scheduling; +#[cfg(feature = "c007")] +pub use job_scheduling as c007; diff --git a/tig-runtime/Cargo.toml b/tig-runtime/Cargo.toml index 9d0dbc5e..d9a88284 100644 --- a/tig-runtime/Cargo.toml +++ b/tig-runtime/Cargo.toml @@ -34,3 +34,5 @@ c005 = ["cuda", "tig-challenges/c005"] hypergraph = ["c005"] c006 = ["cuda", "tig-challenges/c006"] neuralnet_optimizer = ["c006"] +c007 = ["tig-challenges/c007"] +job_scheduling = ["c007"] diff --git a/tig-runtime/src/main.rs b/tig-runtime/src/main.rs index 32b83d05..248b25bf 100644 --- a/tig-runtime/src/main.rs +++ b/tig-runtime/src/main.rs @@ -335,6 +335,12 @@ pub fn compute_solution( #[cfg(feature = "c006")] dispatch_challenge!(c006, gpu) } + "c007" => { + #[cfg(not(feature = "c007"))] + panic!("tig-runtime was not compiled with '--features c007'"); + #[cfg(feature = "c007")] + dispatch_challenge!(c007, cpu) + } _ => panic!("Unsupported challenge"), } } diff --git a/tig-verifier/Cargo.toml b/tig-verifier/Cargo.toml index bac77ff0..ca688e06 100644 --- a/tig-verifier/Cargo.toml +++ b/tig-verifier/Cargo.toml @@ -32,3 +32,5 @@ c005 = ["cuda", "tig-challenges/c005"] hypergraph = ["c005"] c006 = ["cuda", "tig-challenges/c006"] neuralnet_optimizer = ["c006"] +c007 = ["tig-challenges/c007"] +job_scheduling = ["c007"] diff --git a/tig-verifier/src/main.rs b/tig-verifier/src/main.rs index 6a0ddb08..1d1bb8f2 100644 --- a/tig-verifier/src/main.rs +++ b/tig-verifier/src/main.rs @@ -209,6 +209,12 @@ pub fn verify_solution( #[cfg(feature = "c006")] dispatch_challenge!(c006, gpu) } + "c007" => { + #[cfg(not(feature = "c007"))] + panic!("tig-verifier was not compiled with '--features c007'"); + #[cfg(feature = "c007")] + dispatch_challenge!(c007, cpu) + } _ => panic!("Unsupported challenge"), }