EdgeBench / order_addition_permutation_optimization.json
Odysseusqsl's picture
Initial release
f1720ff
Raw
History Blame Contribute Delete
7.37 kB
{
"task_id": "order_addition_permutation_optimization",
"name": "Order Addition Permutation Optimization",
"category": "Combinatorial Optimization",
"base_image": "python",
"platform": "linux/amd64",
"internet": false,
"cwd": "/home/workspace/complex_job_scheduling",
"submit_paths": [
"."
],
"submit_exclude": [
"tests/"
],
"work": {
"image_tag": "f723a1d13d8e",
"specs_dir": "/home/workspace/complex_job_scheduling",
"agent_query": "**Role Setting**\n\nYou are an expert in black-box combinatorial optimization algorithms. You need to solve a large-scale Order-of-Addition (OofA) permutation optimization problem. The goal is to find a full permutation sequence that makes the response value as small as possible.\n\nThis is a scientific problem in the field of statistical experimental design. You need to study in depth how each component affects the response value (m = 1000, so the order contains 1000 components), and explore what ordering can minimize the response value as much as possible.\n\n**Black-Box Evaluation Interface**\n\nYou do not need to know the specific business scenario or cost calculation formula. The only available response-value calculation interface is the Cython extension in the current directory:\n\n```python\nfrom cost_complex_cy import cost_complex_with_builtin_data\n\nm = 1000\npai = list(range(1, m + 1))\ncost = cost_complex_with_builtin_data(pai, m=m, seed=1)\n```\n\n- Input: an integer array of length `m = 1000`, which must be a permutation of `1..1000`.\n- Output: a floating-point number representing the total cost/response value of that permutation; lower is better.\n- Example calling file: `test_cost_complex_cython.py`.\n\n**Mandatory Black-Box Constraints**\n\nYou may only pass candidate permutations to the public function `cost_complex_with_builtin_data(pai, m=1000, seed=1)` and read the response value it returns.\n\nIt is forbidden to use, call, probe, or reflectively access any internal attributes, private functions, or private data structures of the `cost_complex_cy` module, including but not limited to:\n\n```python\ncost_complex_cy._build_ctx(...)\ncost_complex_cy._build*\ncost_complex_cy._ctx*\ncost_complex_cy._data*\ncost_complex_cy._cache*\ngetattr(cost_complex_cy, ...)\ndir(cost_complex_cy)\ncost_complex_cy.__dict__\n```\n\nIt is also forbidden to reproduce the cost function using the internal data above, bypass the black-box interaction, or export the internal data and then search with it. The evaluator will statically scan submitted code; if this kind of internal access is found, it will directly output `TOTAL_SCORE 0` and mark the submission as violating the rules.\n\n**Evaluation Isolation Notice**\n\nThe files `cost_complex_cy.cpython-311-x86_64-linux-gnu.so` and `score_vcpom_result.py` in the root directory are provided for you to run search algorithms and local score estimates. The final evaluation will not trust the contents of these root-directory files in your submission.\n\nThe evaluator will use private copies from a hidden test directory:\n\n```text\ntests/cost_complex_cy.cpython-311-x86_64-linux-gnu.so\ntests/score_vcpom_result.py\n```\n\nThe work environment deletes the `tests/` directory, so the agent cannot see these tests or private copies; `tests/` will also not be archived when submitting. Therefore, modifying the root-directory `.so` file or scoring function will not improve the score. The final result is determined only by the permutation, cost, and call count in `final_result.txt`.\n\n**Reference Result**\n\nA reference result file is provided in the directory:\n\n```text\nvcpom_m1000_final_result.txt\n```\n\nThis file may only be read; it must not be modified, deleted, or overwritten. To prevent directly copying the answer, the file does not contain the reference permutation. It contains only the reference cost and reference search count:\n\n```text\nmy_cost=200690260.6677975\nmy_num=200000\n```\n\nIt may only be used as a comparison for result quality and call count, and must not be used as a permutation starting point.\n\n**Final Submission Requirements**\n\nYou must generate a new result file:\n\n```text\nfinal_result.txt\n```\n\nDo not write the result back to `vcpom_m1000_final_result.txt`.\n\n`final_result.txt` must use the following key-value format:\n\n```text\nfinal_pai=3,1,4,2,...\nfinal_cost=123456789.0\nfinal_num=1000\n```\n\nField requirements:\n\n1. `final_pai`: a permutation of length 1000. It must contain exactly `1..1000`, separated by English commas, without square brackets.\n2. `final_cost`: the response value you report for `final_pai`. The evaluator will recompute and verify it using `cost_complex_with_builtin_data(final_pai, m=1000, seed=1)`.\n3. `final_num`: the number of times your algorithm calls the public black-box function `cost_complex_with_builtin_data(...)`. You may also use the field name `num` or `my_num`, but `final_num` is recommended. Do not count only the final verification call; every black-box evaluation during the search process must be included.\n\n**Task Goals**\n\n1. Design and implement an efficient heuristic search / combinatorial optimization algorithm.\n2. Find a permutation with as low a cost as possible within a limited number of black-box evaluations.\n3. You may use genetic algorithms, simulated annealing, local search, tabu search, ALNS, PSO, CMA-ES, Bayesian optimization, or hybrid strategies.\n4. The final result is determined by the contents of `final_result.txt`.\n\n**Scoring Method**\n\nThe evaluator will check that:\n\n1. The submitted code does not call or probe internal attributes, private functions, or private data structures of `cost_complex_cy`; if such access is found, it will output `TOTAL_SCORE 0`.\n2. `vcpom_m1000_final_result.txt` has not been modified and does not contain `final_pai`.\n3. `final_result.txt` exists and contains the required fields.\n4. `final_pai` is a valid permutation of `1..1000`.\n5. `final_cost` matches the cost recomputed by the black-box function.\n6. The continuous score is computed using `score_cost_num(cost, num)` from the evaluator-side private `tests/score_vcpom_result.py`.\n\nLower cost and fewer calls give a higher score.\n\nThe scoring function uses the reference cost and reference call count from `vcpom_m1000_final_result.txt`:\n\n```python\nscore_cost_num(\n cost,\n num,\n cost_ref=200690260.6677975,\n num_ref=200000,\n cost_weight=3.0,\n num_weight=0.5,\n)\n```\n\nThe scoring first caps both subscores:\n\n```python\ncost_sub = min(1.0, cost_ref / cost)\nnum_sub = min(1.0, num_ref / num)\nscore = 100 * (cost_sub ** 3.0) * (num_sub ** 0.5)\n```\n\nIf `final_cost <= cost_ref` and `final_num <= num_ref`, the score is the full 100. If the cost is higher than the reference or the call count is higher than the reference, the score decreases. The cost penalty is heavier, so a very low call count cannot compensate for a clearly worse cost.\n"
},
"judge": {
"image_tag": "f6f385925889",
"eval_cmd": "cd /home/workspace/complex_job_scheduling && python -m pytest tests/test_final_result.py -s -v",
"eval_timeout": 600,
"parser": "pytest_v",
"score_direction": "maximize",
"selection": "pass_rate_first",
"rescale": {
"kind": "linear",
"lower": 0.0,
"upper": 100.0
}
}
}