{"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/neural-combinatorial-optimization-with","title":"Neural Combinatorial Optimization with Reinforcement Learning","arxiv_id":"1611.09940","date":"2016-11-29","proceeding":null,"authors":["Irwan Bello","Hieu Pham","Quoc V. Le","Mohammad Norouzi","Samy Bengio"],"abstract":"This paper presents a framework to tackle combinatorial optimization problems\nusing neural networks and reinforcement learning. We focus on the traveling\nsalesman problem (TSP) and train a recurrent network that, given a set of city\ncoordinates, predicts a distribution over different city permutations. Using\nnegative tour length as the reward signal, we optimize the parameters of the\nrecurrent network using a policy gradient method. We compare learning the\nnetwork parameters on a set of training graphs against learning them on\nindividual test graphs. Despite the computational expense, without much\nengineering and heuristic designing, Neural Combinatorial Optimization achieves\nclose to optimal results on 2D Euclidean graphs with up to 100 nodes. Applied\nto the KnapSack, another NP-hard problem, the same method obtains optimal\nsolutions for instances with up to 200 items.","url_abs":"http://arxiv.org/abs/1611.09940v3","url_pdf":"http://arxiv.org/pdf/1611.09940v3.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":"neural-combinatorial-optimization-with","repo_url":"https://github.com/Rintarooo/TSP_DRL_PointerNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/Rintarooo/TSP_DRL_PtrNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/Rintarooo/TSP_RL_Pointer_Actor_Critic","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/abdullah-al-masud/rl-optimize","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/ahottung/EAS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/chaitjo/learning-tsp","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/longkangli/pfss-il","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/zhengsr3/Reinforcement_Learning_Pointer_Networks_TSP_Pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"neural-combinatorial-optimization-with","repo_url":"https://github.com/JoseVillagranE/Pointer-Networks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"combinatorial-optimization","task_name":"Combinatorial Optimization"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"},{"task_slug":"traveling-salesman-problem","task_name":"Traveling Salesman Problem"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1611.09940","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1611.09940"}},"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/ahottung/EAS","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Rintarooo/TSP_DRL_PointerNet","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JoseVillagranE/Pointer-Networks","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Rintarooo/TSP_DRL_PtrNet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/abdullah-al-masud/rl-optimize","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/longkangli/pfss-il","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhengsr3/Reinforcement_Learning_Pointer_Networks_TSP_Pytorch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chaitjo/learning-tsp","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Rintarooo/TSP_RL_Pointer_Actor_Critic","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_fixture":2,"ran_draft_wrong":2,"ran_violates":1,"unverified":14},"by_repo_kind":{"listed":{"samples":20,"ran":6,"repositories":5}},"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":5,"samples":[{"code_sha256_prefix":"b337a9636b389167","entry":"PreProcessOutput","repo":"JoseVillagranE/Pointer-Networks","repo_kind":"listed","path":"TSP.py","file_url":"https://github.com/JoseVillagranE/Pointer-Networks/blob/HEAD/TSP.py","link_basis":"first_harvest_node","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":"b337a9636b389167"}},{"code_sha256_prefix":"d88d8c4f9d624404","entry":"PreProcessOutput_batch","repo":"JoseVillagranE/Pointer-Networks","repo_kind":"listed","path":"RLtraining.py","file_url":"https://github.com/JoseVillagranE/Pointer-Networks/blob/HEAD/RLtraining.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d88d8c4f9d624404"}},{"code_sha256_prefix":"7c3324bc44451062","entry":"Reward","repo":"JoseVillagranE/Pointer-Networks","repo_kind":"listed","path":"RLtraining.py","file_url":"https://github.com/JoseVillagranE/Pointer-Networks/blob/HEAD/RLtraining.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c3324bc44451062"}},{"code_sha256_prefix":"0c43e7290e581e42","entry":"sequence_mask","repo":"JoseVillagranE/Pointer-Networks","repo_kind":"listed","path":"pointer_network.py","file_url":"https://github.com/JoseVillagranE/Pointer-Networks/blob/HEAD/pointer_network.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0c43e7290e581e42"}},{"code_sha256_prefix":"248284f69adfeaad","entry":"str2bool","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"trainer.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/trainer.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"248284f69adfeaad"}},{"code_sha256_prefix":"926944485fdd4f48","entry":"tensor_sort","repo":"JoseVillagranE/Pointer-Networks","repo_kind":"listed","path":"RLtraining.py","file_url":"https://github.com/JoseVillagranE/Pointer-Networks/blob/HEAD/RLtraining.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"926944485fdd4f48"}},{"code_sha256_prefix":"131a59fa13a6da38","entry":"comparison_table","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/utils.py","link_basis":"harvester_set","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":"131a59fa13a6da38"}},{"code_sha256_prefix":"c5bf8b09fc4c7356","entry":"create_data_model","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"tsp_utils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/tsp_utils.py","link_basis":"harvester_set","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":"c5bf8b09fc4c7356"}},{"code_sha256_prefix":"06248b1d4ce6e73f","entry":"create_dataset","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"sorting_task.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/sorting_task.py","link_basis":"harvester_set","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":"06248b1d4ce6e73f"}},{"code_sha256_prefix":"20f31737837ced8e","entry":"download_file_from_google_drive","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"tsp_task.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/tsp_task.py","link_basis":"harvester_set","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":"20f31737837ced8e"}},{"code_sha256_prefix":"cb53b718ef642545","entry":"get_2city_distance","repo":"Rintarooo/TSP_DRL_PointerNet","repo_kind":"listed","path":"env.py","file_url":"https://github.com/Rintarooo/TSP_DRL_PointerNet/blob/HEAD/env.py","link_basis":"harvester_set","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":"cb53b718ef642545"}},{"code_sha256_prefix":"135b3dc835ffe6ad","entry":"get_confirm_token","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"tsp_task.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/tsp_task.py","link_basis":"harvester_set","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":"135b3dc835ffe6ad"}},{"code_sha256_prefix":"1080a3f43ce02c26","entry":"get_solution","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"tsp_utils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/tsp_utils.py","link_basis":"harvester_set","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":"1080a3f43ce02c26"}},{"code_sha256_prefix":"603daec7955e6b32","entry":"inference_config","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"rlutils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/rlutils.py","link_basis":"harvester_set","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":"603daec7955e6b32"}},{"code_sha256_prefix":"cdefd51f0daf2843","entry":"load_pkl","repo":"Rintarooo/TSP_DRL_PtrNet","repo_kind":"listed","path":"config.py","file_url":"https://github.com/Rintarooo/TSP_DRL_PtrNet/blob/HEAD/config.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":"cdefd51f0daf2843"}},{"code_sha256_prefix":"2a2a3a02703e0cc3","entry":"make_big","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"rlutils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/rlutils.py","link_basis":"harvester_set","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":"2a2a3a02703e0cc3"}},{"code_sha256_prefix":"d8ef9d8f7e4a2e47","entry":"prepare_tsp_config","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"config.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/config.py","link_basis":"harvester_set","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":"d8ef9d8f7e4a2e47"}},{"code_sha256_prefix":"da119d24707d7943","entry":"reward","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"sorting_task.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/sorting_task.py","link_basis":"harvester_set","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":"da119d24707d7943"}},{"code_sha256_prefix":"570a2842c2ff2ab8","entry":"reward","repo":"pemami4911/neural-combinatorial-rl-pytorch","repo_kind":"listed","path":"tsp_task.py","file_url":"https://github.com/pemami4911/neural-combinatorial-rl-pytorch/blob/HEAD/tsp_task.py","link_basis":"harvester_set","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":"570a2842c2ff2ab8"}},{"code_sha256_prefix":"175f1ee7b5d44f2d","entry":"solve_agent","repo":"abdullah-al-masud/rl-optimize","repo_kind":"listed","path":"rlutils.py","file_url":"https://github.com/abdullah-al-masud/rl-optimize/blob/HEAD/rlutils.py","link_basis":"harvester_set","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":"175f1ee7b5d44f2d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}