{"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/arxiv-2602-16012","title":"Towards Efficient Constraint Handling in Neural Solvers for Routing Problems","arxiv_id":"2602.16012","date":"2026-02-17","proceeding":null,"authors":["Jieyi Bi","Zhiguang Cao","Jianan Zhou","Wen Song","Yaoxin Wu","Jie Zhang","Yining Ma","Cathy Wu"],"abstract":"Neural solvers have achieved impressive progress in addressing simple routing problems, particularly excelling in computational efficiency. However, their advantages under complex constraints remain nascent, for which current constraint-handling schemes via feasibility masking or implicit feasibility awareness can be inefficient or inapplicable for hard constraints. In this paper, we present Construct-and-Refine (CaR), the first general and efficient constraint-handling framework for neural routing solvers based on explicit learning-based feasibility refinement. Unlike prior construction-search hybrids that target reducing optimality gaps through heavy improvements yet still struggle with hard constraints, CaR achieves efficient constraint handling by designing a joint training framework that guides the construction module to generate diverse and high-quality solutions well-suited for a lightweight improvement process, e.g., 10 steps versus 5k steps in prior work. Moreover, CaR presents the first use of construction-improvement-shared representation, enabling potential knowledge sharing across paradigms by unifying the encoder, especially in more complex constrained scenarios. We evaluate CaR on typical hard routing constraints to showcase its broader applicability. Results demonstrate that CaR achieves superior feasibility, solution quality, and efficiency compared to both classical and neural state-of-the-art solvers.","url_abs":"https://arxiv.org/abs/2602.16012","url_pdf":"https://arxiv.org/pdf/2602.16012","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2602.16012","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.16012"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/jieyibi/CaR-constraint","reach":null}],"summary":{"ran_draft_wrong":1,"unverified":24},"by_repo_kind":{"found_in_text":{"samples":25,"ran":1,"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":0,"samples":[{"code_sha256_prefix":"459fe521069329c6","entry":"reshape_by_heads","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"models/SINGLEModel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/models/SINGLEModel.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"459fe521069329c6"}},{"code_sha256_prefix":"b614c1ddea8c410f","entry":"Euc_distance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/OR-Tools_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/OR-Tools_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b614c1ddea8c410f"}},{"code_sha256_prefix":"8db9a91b0002e752","entry":"calc_vrp_cost","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/HGS_pyvrp_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/HGS_pyvrp_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8db9a91b0002e752"}},{"code_sha256_prefix":"83dadb20cccdae82","entry":"calc_vrp_cost","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/LKH_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/LKH_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83dadb20cccdae82"}},{"code_sha256_prefix":"a2d50d249f007e4e","entry":"calculate_distance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/greedy_parallel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/greedy_parallel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a2d50d249f007e4e"}},{"code_sha256_prefix":"f17c01b663993e4e","entry":"check_mem","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f17c01b663993e4e"}},{"code_sha256_prefix":"939dcf5fde45950d","entry":"create_data_model","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/OR-Tools_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/OR-Tools_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"939dcf5fde45950d"}},{"code_sha256_prefix":"90ca1feb298895ad","entry":"estimate_batch_size","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/grid_search.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/grid_search.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"90ca1feb298895ad"}},{"code_sha256_prefix":"57f3aff50aa7f611","entry":"fast_multi_head_attention","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"models/SINGLEModel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/models/SINGLEModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"57f3aff50aa7f611"}},{"code_sha256_prefix":"f85cae57b28101a3","entry":"get_env","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f85cae57b28101a3"}},{"code_sha256_prefix":"add84ba016364520","entry":"get_hgs_cvrp_executable","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/HGS_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/HGS_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"add84ba016364520"}},{"code_sha256_prefix":"53d638ee9f6282f9","entry":"get_hgs_vrptw_executable","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/HGS_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/HGS_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"53d638ee9f6282f9"}},{"code_sha256_prefix":"d3630ff1f12d5a6e","entry":"get_lkh_executable","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/LKH_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/LKH_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d3630ff1f12d5a6e"}},{"code_sha256_prefix":"dad6cf482598ad57","entry":"get_opt_sol_path","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dad6cf482598ad57"}},{"code_sha256_prefix":"d0bd680f5f2b3b80","entry":"get_time_horizon","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/OR-Tools_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/OR-Tools_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0bd680f5f2b3b80"}},{"code_sha256_prefix":"dc03804de3dda999","entry":"greedy_tsptw_instance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/greedy_parallel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/greedy_parallel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc03804de3dda999"}},{"code_sha256_prefix":"6c620551834a7442","entry":"hamming_distance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/similarity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/similarity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c620551834a7442"}},{"code_sha256_prefix":"00cc8946a1c331bf","entry":"hamming_distance_vectorized","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/diversity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/diversity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"00cc8946a1c331bf"}},{"code_sha256_prefix":"0e79c3e2c2672651","entry":"jaccard_distance_vectorized","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/diversity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/diversity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0e79c3e2c2672651"}},{"code_sha256_prefix":"d345ac1930735cb8","entry":"levenshtein_distance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/similarity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/similarity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d345ac1930735cb8"}},{"code_sha256_prefix":"faf4e1c4deeb8f60","entry":"load_data","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/greedy_parallel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/greedy_parallel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"faf4e1c4deeb8f60"}},{"code_sha256_prefix":"657ae188fd7e1f14","entry":"multi_head_attention","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"models/SINGLEModel.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/models/SINGLEModel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"657ae188fd7e1f14"}},{"code_sha256_prefix":"b2c62640d0b5e307","entry":"plot_cvrp_trajectory000","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/similarity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/similarity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b2c62640d0b5e307"}},{"code_sha256_prefix":"308ec540b94dd9ed","entry":"positional_jaccard_distance","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"analysis/diversity.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/analysis/diversity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"308ec540b94dd9ed"}},{"code_sha256_prefix":"110b4de489553a90","entry":"read_hgs_vrplib","repo":"jieyibi/CaR-constraint","repo_kind":"found_in_text","path":"baselines/HGS_pyvrp_baseline.py","file_url":"https://github.com/jieyibi/CaR-constraint/blob/HEAD/baselines/HGS_pyvrp_baseline.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"110b4de489553a90"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}