{"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/fosr-first-order-spectral-rewiring-for","title":"FoSR: First-order spectral rewiring for addressing oversquashing in GNNs","arxiv_id":"2210.11790","date":"2022-10-21","proceeding":null,"authors":["Kedar Karhadkar","Pradeep Kr. Banerjee","Guido Montúfar"],"abstract":"Graph neural networks (GNNs) are able to leverage the structure of graph data by passing messages along the edges of the graph. While this allows GNNs to learn features depending on the graph structure, for certain graph topologies it leads to inefficient information propagation and a problem known as oversquashing. This has recently been linked with the curvature and spectral gap of the graph. On the other hand, adding edges to the message-passing graph can lead to increasingly similar node representations and a problem known as oversmoothing. We propose a computationally efficient algorithm that prevents oversquashing by systematically adding edges to the graph based on spectral expansion. We combine this with a relational architecture, which lets the GNN preserve the original graph structure and provably prevents oversmoothing. We find experimentally that our algorithm outperforms existing graph rewiring methods in several graph classification tasks.","url_abs":"https://arxiv.org/abs/2210.11790v2","url_pdf":"https://arxiv.org/pdf/2210.11790v2.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":"fosr-first-order-spectral-rewiring-for","repo_url":"https://github.com/kedar2/FoSR","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"fosr-first-order-spectral-rewiring-for","repo_url":"https://github.com/harel147/REFine","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"graph-classification","task_name":"Graph Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2210.11790","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.11790"}},"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/kedar2/FoSR","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/harel147/REFine","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":5,"ran_honours":1,"unverified":5},"by_repo_kind":{"official":{"samples":6,"ran":6,"repositories":1},"listed":{"samples":5,"ran":0,"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":6,"samples":[{"code_sha256_prefix":"8da3844af3011078","entry":"_edge_rewire","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8da3844af3011078"}},{"code_sha256_prefix":"8253415b0d9f44f0","entry":"add_edge","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.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":"8253415b0d9f44f0"}},{"code_sha256_prefix":"4240dff02339db3f","entry":"adj_matrix_multiply","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.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":"4240dff02339db3f"}},{"code_sha256_prefix":"063fa9897760a77f","entry":"choose_edge_to_add","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"063fa9897760a77f"}},{"code_sha256_prefix":"64f9409122eaca34","entry":"compute_degrees","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.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":"64f9409122eaca34"}},{"code_sha256_prefix":"c73dc9f34fc49fed","entry":"edge_rewire","repo":"kedar2/FoSR","repo_kind":"official","path":"preprocessing/fosr.py","file_url":"https://github.com/kedar2/FoSR/blob/HEAD/preprocessing/fosr.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c73dc9f34fc49fed"}},{"code_sha256_prefix":"511ae6a831d944f3","entry":"compute_kernel_data","repo":"harel147/REFine","repo_kind":"listed","path":"algorithms/refine/REFine.py","file_url":"https://github.com/harel147/REFine/blob/HEAD/algorithms/refine/REFine.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":"511ae6a831d944f3"}},{"code_sha256_prefix":"ea8c61a8a9111315","entry":"cut_graph_by_cutoff","repo":"harel147/REFine","repo_kind":"listed","path":"algorithms/borf/util.py","file_url":"https://github.com/harel147/REFine/blob/HEAD/algorithms/borf/util.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":"ea8c61a8a9111315"}},{"code_sha256_prefix":"ee0c1b3c7efe196a","entry":"kernel_to_edge_index_and_edge_weight","repo":"harel147/REFine","repo_kind":"listed","path":"algorithms/refine/REFine.py","file_url":"https://github.com/harel147/REFine/blob/HEAD/algorithms/refine/REFine.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":"ee0c1b3c7efe196a"}},{"code_sha256_prefix":"f882e1c03fbe1140","entry":"print_max_min_cluster_sizes","repo":"harel147/REFine","repo_kind":"listed","path":"algorithms/utils.py","file_url":"https://github.com/harel147/REFine/blob/HEAD/algorithms/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":"f882e1c03fbe1140"}},{"code_sha256_prefix":"94b99f56c5136410","entry":"symmetric_normalize_tensor","repo":"harel147/REFine","repo_kind":"listed","path":"algorithms/refine/REFine.py","file_url":"https://github.com/harel147/REFine/blob/HEAD/algorithms/refine/REFine.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":"94b99f56c5136410"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}