{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/learning-to-solve-combinatorial-optimization-1","title":"Learning to Solve Combinatorial Optimization under Positive Linear Constraints via Non-Autoregressive Neural Networks","arxiv_id":"2409.04495","date":"2024-09-06","proceeding":null,"authors":["Runzhong Wang","Yang Li","Junchi Yan","Xiaokang Yang"],"abstract":"Combinatorial optimization (CO) is the fundamental problem at the intersection of computer science, applied mathematics, etc. The inherent hardness in CO problems brings up challenge for solving CO exactly, making deep-neural-network-based solvers a research frontier. In this paper, we design a family of non-autoregressive neural networks to solve CO problems under positive linear constraints with the following merits. First, the positive linear constraint covers a wide range of CO problems, indicating that our approach breaks the generality bottleneck of existing non-autoregressive networks. Second, compared to existing autoregressive neural network solvers, our non-autoregressive networks have the advantages of higher efficiency and preserving permutation invariance. Third, our offline unsupervised learning has lower demand on high-quality labels, getting rid of the demand of optimal labels in supervised learning. Fourth, our online differentiable search method significantly improves the generalizability of our neural network solver to unseen problems. We validate the effectiveness of this framework in solving representative CO problems including facility location, max-set covering, and traveling salesman problem. Our non-autoregressive neural solvers are competitive to and can be even superior to state-of-the-art solvers such as SCIP and Gurobi, especially when both efficiency and efficacy are considered. Code is available at https://github.com/Thinklab-SJTU/NAR-CO-Solver","url_abs":"https://arxiv.org/abs/2409.04495v1","url_pdf":"https://arxiv.org/pdf/2409.04495v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"learning-to-solve-combinatorial-optimization-1","repo_url":"https://github.com/thinklab-sjtu/nar-co-solver","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"learning-to-solve-combinatorial-optimization-1","repo_url":"https://github.com/Thinklab-SJTU/One-Shot-Cardinality-NN-Solver","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"combinatorial-optimization","task_name":"Combinatorial Optimization"},{"task_slug":"traveling-salesman-problem","task_name":"Traveling Salesman Problem"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.04495","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.04495"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thinklab-sjtu/nar-co-solver","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Thinklab-SJTU/One-Shot-Cardinality-NN-Solver","reach":{"status":"ok"}}],"summary":{"ran_honours":1,"ran":5,"unverified":1},"by_repo_kind":{"official":{"samples":7,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":7,"samples":[{"code_sha256_prefix":"3c9ef10a01e87fcb","entry":"bdot","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"constraint_layers/lml.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/constraint_layers/lml.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c9ef10a01e87fcb"}},{"code_sha256_prefix":"6177fd41053f5edc","entry":"build_graph_from_points","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"src/facility_location_methods.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/src/facility_location_methods.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6177fd41053f5edc"}},{"code_sha256_prefix":"1d1c36690ac9960f","entry":"cfg_from_file","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"src/config.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/src/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1d1c36690ac9960f"}},{"code_sha256_prefix":"254c316c8d371f3a","entry":"get_random_data","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"src/facility_location_data.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/src/facility_location_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"254c316c8d371f3a"}},{"code_sha256_prefix":"c3b96072f5ba1d2f","entry":"get_starbucks_data","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"src/facility_location_data.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/src/facility_location_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c3b96072f5ba1d2f"}},{"code_sha256_prefix":"e45b3bd133c80889","entry":"topk","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"constraint_layers/blackbox_diff.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/constraint_layers/blackbox_diff.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e45b3bd133c80889"}},{"code_sha256_prefix":"4a4705a51c1c262c","entry":"get_random_dataset","repo":"thinklab-sjtu/nar-co-solver","repo_kind":"official","path":"src/max_covering_data.py","file_url":"https://github.com/thinklab-sjtu/nar-co-solver/blob/HEAD/src/max_covering_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a4705a51c1c262c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}