{"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/partition-and-code-learning-how-to-compress","title":"Partition and Code: learning how to compress graphs","arxiv_id":"2107.01952","date":"2021-07-05","proceeding":"NeurIPS 2021 12","authors":["Giorgos Bouritsas","Andreas Loukas","Nikolaos Karalias","Michael M. Bronstein"],"abstract":"Can we use machine learning to compress graph data? The absence of ordering in graphs poses a significant challenge to conventional compression algorithms, limiting their attainable gains as well as their ability to discover relevant patterns. On the other hand, most graph compression approaches rely on domain-dependent handcrafted representations and cannot adapt to different underlying graph distributions. This work aims to establish the necessary principles a lossless graph compression method should follow to approach the entropy storage lower bound. Instead of making rigid assumptions about the graph distribution, we formulate the compressor as a probabilistic model that can be learned from data and generalise to unseen instances. Our \"Partition and Code\" framework entails three steps: first, a partitioning algorithm decomposes the graph into subgraphs, then these are mapped to the elements of a small dictionary on which we learn a probability distribution, and finally, an entropy encoder translates the representation into bits. All the components (partitioning, dictionary and distribution) are parametric and can be trained with gradient descent. We theoretically compare the compression quality of several graph encodings and prove, under mild conditions, that PnC achieves compression gains that grow either linearly or quadratically with the number of vertices. Empirically, PnC yields significant compression improvements on diverse real-world networks.","url_abs":"https://arxiv.org/abs/2107.01952v2","url_pdf":"https://arxiv.org/pdf/2107.01952v2.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":"partition-and-code-learning-how-to-compress","repo_url":"https://github.com/gbouritsas/PnC","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2107.01952","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.01952"}},"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/gbouritsas/PnC","reach":null}],"summary":{"ran_draft_wrong":3,"ran":4,"unverified":7},"by_repo_kind":{"official":{"samples":14,"ran":7,"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":"8cece8d22b52bc54","entry":"choose_activation","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8cece8d22b52bc54"}},{"code_sha256_prefix":"83e9302ed0fe1f1b","entry":"global_add_pool_sparse","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83e9302ed0fe1f1b"}},{"code_sha256_prefix":"2da63d8f037ad4d9","entry":"global_mean_pool_sparse","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2da63d8f037ad4d9"}},{"code_sha256_prefix":"cd5a40ffd4482a6d","entry":"mlp","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd5a40ffd4482a6d"}},{"code_sha256_prefix":"c1e8d544258036a5","entry":"multi_embedding","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","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":"c1e8d544258036a5"}},{"code_sha256_prefix":"1f0176d5abd4a4be","entry":"one_hot_encoder","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","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":"1f0176d5abd4a4be"}},{"code_sha256_prefix":"c3f1381752954a99","entry":"zero_encoder","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c3f1381752954a99"}},{"code_sha256_prefix":"8b73e3e20eed4c7e","entry":"DiscreteEmbedding","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"8b73e3e20eed4c7e"}},{"code_sha256_prefix":"25c4c0727f9562c6","entry":"MPNN","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"25c4c0727f9562c6"}},{"code_sha256_prefix":"4f5c1b211865576c","entry":"MPNN_edge","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"4f5c1b211865576c"}},{"code_sha256_prefix":"8495449348deca6c","entry":"MPNN_edge_sparse","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"8495449348deca6c"}},{"code_sha256_prefix":"c25767f2fc88847f","entry":"MPNN_sparse","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"c25767f2fc88847f"}},{"code_sha256_prefix":"70d10c25ac5a1544","entry":"NeuralPartGNN","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"70d10c25ac5a1544"}},{"code_sha256_prefix":"43b0a3df8a2ecc9c","entry":"central_encoder","repo":"gbouritsas/PnC","repo_kind":"official","path":"models/GNN_neural_part_subgraph_selection.py","file_url":"https://github.com/gbouritsas/PnC/blob/HEAD/models/GNN_neural_part_subgraph_selection.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":"43b0a3df8a2ecc9c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}