{"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-handle-complex-constraints-for","title":"Learning to Handle Complex Constraints for Vehicle Routing Problems","arxiv_id":"2410.21066","date":"2024-10-28","proceeding":null,"authors":["Jieyi Bi","Yining Ma","Jianan Zhou","Wen Song","Zhiguang Cao","Yaoxin Wu","Jie Zhang"],"abstract":"Vehicle Routing Problems (VRPs) can model many real-world scenarios and often involve complex constraints. While recent neural methods excel in constructing solutions based on feasibility masking, they struggle with handling complex constraints, especially when obtaining the masking itself is NP-hard. In this paper, we propose a novel Proactive Infeasibility Prevention (PIP) framework to advance the capabilities of neural methods towards more complex VRPs. Our PIP integrates the Lagrangian multiplier as a basis to enhance constraint awareness and introduces preventative infeasibility masking to proactively steer the solution construction process. Moreover, we present PIP-D, which employs an auxiliary decoder and two adaptive strategies to learn and predict these tailored masks, potentially enhancing performance while significantly reducing computational costs during training. To verify our PIP designs, we conduct extensive experiments on the highly challenging Traveling Salesman Problem with Time Window (TSPTW), and TSP with Draft Limit (TSPDL) variants under different constraint hardness levels. Notably, our PIP is generic to boost many neural methods, and exhibits both a significant reduction in infeasible rate and a substantial improvement in solution quality.","url_abs":"https://arxiv.org/abs/2410.21066v1","url_pdf":"https://arxiv.org/pdf/2410.21066v1.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-handle-complex-constraints-for","repo_url":"https://github.com/jieyibi/pip-constraint","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"traveling-salesman-problem","task_name":"Traveling Salesman Problem"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.21066","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.21066"}},"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":"deterministic:regex_extraction","url":"https://github.com/jieyibi/PIP-constraint","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jieyibi/pip-constraint","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":10},"by_repo_kind":{"official":{"samples":12,"ran":2,"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":"01df1926cf07ac89","entry":"check_extension","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/lkh.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/lkh.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"01df1926cf07ac89"}},{"code_sha256_prefix":"69062811f34d8ff6","entry":"load_dataset","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/lkh.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/lkh.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"69062811f34d8ff6"}},{"code_sha256_prefix":"3df49b2f459b128d","entry":"SINGLEModel","repo":"jieyibi/pip-constraint","repo_kind":"official","path":"POMO+PIP/models/SINGLEModel.py","file_url":"https://github.com/jieyibi/pip-constraint/blob/HEAD/POMO%2BPIP/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":"3df49b2f459b128d"}},{"code_sha256_prefix":"246d64b95e2c6b6c","entry":"SINGLE_Decoder","repo":"jieyibi/pip-constraint","repo_kind":"official","path":"POMO+PIP/models/SINGLEModel.py","file_url":"https://github.com/jieyibi/pip-constraint/blob/HEAD/POMO%2BPIP/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":"246d64b95e2c6b6c"}},{"code_sha256_prefix":"51325c5a01cb50d8","entry":"SINGLE_Encoder","repo":"jieyibi/pip-constraint","repo_kind":"official","path":"POMO+PIP/models/SINGLEModel.py","file_url":"https://github.com/jieyibi/pip-constraint/blob/HEAD/POMO%2BPIP/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":"51325c5a01cb50d8"}},{"code_sha256_prefix":"f4b9a37d67290bfd","entry":"calc_vrp_cost","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/lkh.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/lkh.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":"f4b9a37d67290bfd"}},{"code_sha256_prefix":"767b477005da5d85","entry":"calculate_log_pb_uniform","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/train_nar.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/train_nar.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":"767b477005da5d85"}},{"code_sha256_prefix":"207388a6fced0206","entry":"gen_tw_naive","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/data_generator.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/data_generator.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":"207388a6fced0206"}},{"code_sha256_prefix":"58edcba2f8498729","entry":"get_edge_matrix","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/data_generator.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/data_generator.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":"58edcba2f8498729"}},{"code_sha256_prefix":"248273aac0ceb091","entry":"get_options","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"AM+PIP/options.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/AM%2BPIP/options.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":"248273aac0ceb091"}},{"code_sha256_prefix":"303d938f80c0f3f5","entry":"get_random_tour","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/data_generator.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/data_generator.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":"303d938f80c0f3f5"}},{"code_sha256_prefix":"fe1d8fbff7db28f0","entry":"validate_route","repo":"jieyibi/PIP-constraint","repo_kind":"official","path":"GFACS+PIP/train_nar.py","file_url":"https://github.com/jieyibi/PIP-constraint/blob/HEAD/GFACS%2BPIP/train_nar.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":"fe1d8fbff7db28f0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}