{"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/faster-all-pairs-shortest-paths-via-circuit","title":"Faster all-pairs shortest paths via circuit complexity","arxiv_id":"1312.6680","date":"2013-12-23","proceeding":null,"authors":["Ryan Williams"],"abstract":"We present a new randomized method for computing the min-plus product (a.k.a., tropical product) of two $n \\times n$ matrices, yielding a faster algorithm for solving the all-pairs shortest path problem (APSP) in dense $n$-node directed graphs with arbitrary edge weights. On the real RAM, where additions and comparisons of reals are unit cost (but all other operations have typical logarithmic cost), the algorithm runs in time \\[\\frac{n^3}{2^{\\Omega(\\log n)^{1/2}}}\\] and is correct with high probability. On the word RAM, the algorithm runs in $n^3/2^{\\Omega(\\log n)^{1/2}} + n^{2+o(1)}\\log M$ time for edge weights in $([0,M] \\cap {\\mathbb Z})\\cup\\{\\infty\\}$. Prior algorithms used either $n^3/(\\log^c n)$ time for various $c \\leq 2$, or $O(M^{\\alpha}n^{\\beta})$ time for various $\\alpha > 0$ and $\\beta > 2$. The new algorithm applies a tool from circuit complexity, namely the Razborov-Smolensky polynomials for approximately representing ${\\sf AC}^0[p]$ circuits, to efficiently reduce a matrix product over the $(\\min,+)$ algebra to a relatively small number of rectangular matrix products over ${\\mathbb F}_2$, each of which are computable using a particularly efficient method due to Coppersmith. We also give a deterministic version of the algorithm running in $n^3/2^{\\log^{\\delta} n}$ time for some $\\delta > 0$, which utilizes the Yao-Beigel-Tarui translation of ${\\sf AC}^0[m]$ circuits into \"nice\" depth-two circuits.","url_abs":"https://arxiv.org/abs/1312.6680v2","url_pdf":"https://arxiv.org/pdf/1312.6680v2.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":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"faster-all-pairs-shortest-paths-via-circuit","repo_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1312.6680","atlas_url":"https://app.syntology.ai/?focus=1312.6680","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1312.6680"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/JamesCraster/URSS-Subcubic-APSP","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":17},"by_repo_kind":{"listed":{"samples":17,"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":0,"samples":[{"code_sha256_prefix":"59ed30bae36ca3fd","entry":"RWilliamsMinPlus","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"RWilliamsMinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/RWilliamsMinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"59ed30bae36ca3fd"}},{"code_sha256_prefix":"f5d5e7aabe69cb90","entry":"argMinPlus","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f5d5e7aabe69cb90"}},{"code_sha256_prefix":"903fcf8483af0f7e","entry":"dim","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"RWilliamsAPSP.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/RWilliamsAPSP.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"903fcf8483af0f7e"}},{"code_sha256_prefix":"eb71ef13d3ffee0e","entry":"floydWarshall","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"FloydWarshall.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/FloydWarshall.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"eb71ef13d3ffee0e"}},{"code_sha256_prefix":"d1c4b0db90c665aa","entry":"generateGraphOfSize","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"Benchmark.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/Benchmark.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d1c4b0db90c665aa"}},{"code_sha256_prefix":"95767a8f095b257c","entry":"generateGraphOfSize","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"BenchmarkRW.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/BenchmarkRW.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"95767a8f095b257c"}},{"code_sha256_prefix":"5a8b1aa58f68be63","entry":"generateMatrixOfSize","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"BenchmarkMatrices.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/BenchmarkMatrices.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5a8b1aa58f68be63"}},{"code_sha256_prefix":"32aa0455fb301f3e","entry":"minPlus","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"32aa0455fb301f3e"}},{"code_sha256_prefix":"f747800188783d17","entry":"minVal","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f747800188783d17"}},{"code_sha256_prefix":"a237e553ac664dd7","entry":"naive","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MatrixAlgorithms.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MatrixAlgorithms.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a237e553ac664dd7"}},{"code_sha256_prefix":"9cc64dc868711220","entry":"nextEven","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"FastClosure.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/FastClosure.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9cc64dc868711220"}},{"code_sha256_prefix":"917ffd5a5db05fbc","entry":"nextPowerOf2","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MatrixAlgorithms.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MatrixAlgorithms.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"917ffd5a5db05fbc"}},{"code_sha256_prefix":"4c60d99367be8570","entry":"padMatrix","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"MatrixAlgorithms.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/MatrixAlgorithms.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4c60d99367be8570"}},{"code_sha256_prefix":"e08936aa36f0c6a8","entry":"padMatrix","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"FastClosure.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/FastClosure.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e08936aa36f0c6a8"}},{"code_sha256_prefix":"ec7c83665cc45c83","entry":"reconstructPath","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"FloydWarshall.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/FloydWarshall.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ec7c83665cc45c83"}},{"code_sha256_prefix":"0435d663778fc6f1","entry":"splitMatrixHorizontal","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"RWilliamsMinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/RWilliamsMinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0435d663778fc6f1"}},{"code_sha256_prefix":"50a2e684e6a98dbc","entry":"splitMatrixVertical","repo":"JamesCraster/URSS-Subcubic-APSP","repo_kind":"listed","path":"RWilliamsMinPlus.py","file_url":"https://github.com/JamesCraster/URSS-Subcubic-APSP/blob/HEAD/RWilliamsMinPlus.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"50a2e684e6a98dbc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}