SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.09810 · 2020

$p$-Norm Flow Diffusion for Local Graph Clustering

arXiv · PDF · Open in the Atlas

Code that ran

5 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 7 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2005.09810.json · badge: /api/ran/2005.09810.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
kfoynt/LocalGraphClustering canonical (classifier label)
classifier basis: census
5 ran · 7 no recorded run
FunctionStatusWhere it lives
acl_list Ran
ran on a synthesized input
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/acl_list.py
code served (permissive licence) · get_code("25afa867451dfa44")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import sparse

class GraphStandIn:
    def __init__(self):
        # Create a small sparse graph with 5 nodes
        # Using CSR format for efficient row slicing and iteration
        row = np.array([0, 0, 1, 1, 2, 3, 4])
        col = np.array([1, 2, 0, 3, 1, 4, 2])
        data = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
        
        self.adjacency_matrix = sparse.csr_matrix((data, (row, col)), shape=(5, 5))
        
        # Degree vector d: sum of edge weights for each node
        # Node 0: edges to 1, 2 -> d[0] = 2
        # Node 1: edges to 0, 3 -> d[1] = 2
        # Node 2: edge to 1 -> d[2] = 1
        # Node 3: edge to 4 -> d[3] = 1
        # Node 4: edge to 2 -> d[4] = 1
        self.d = np.array([2.0, 2.0, 1.0, 1.0, 1.0])

g = GraphStandIn()
ref_node = [0, 1]

ARGS = {
    'ref_node': ref_node,
    'g': g,
    'alpha': 0.15,
    'rho': 1e-05,
    'max_iter': 100000,
    'max_time': 100
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
diff Ran
ran on a synthesized input
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/fista_dinput_dense.py
code served (permissive licence) · get_code("0eca415c135a6946")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family int, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct valid arguments for diff(a, b)
# The function takes two array-like arguments and returns elements from 'a' 
# that are not in 'b', converted to int64 numpy array

a = [1, 2, 3, 4, 5, 2, 3]  # list with some duplicates
b = [2, 4, 6]  # list with some elements to exclude

ARGS = {
    'a': a,
    'b': b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eig2nL_subgraph Ran
ran on a synthesized input
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/eig2_nL.py
code served (permissive licence) · get_code("3bc99562f219b3ab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import scipy as sp
import scipy.sparse
import numpy as np

# Create a small stand-in graph object with required attributes
class MockGraph:
    def __init__(self, n_nodes=5):
        self.n_nodes = n_nodes
        
        # Create a small sparse adjacency matrix
        # Using a simple 5x5 matrix with some structure
        row = np.array([0, 1, 1, 2, 2, 3, 3, 4])
        col = np.array([1, 0, 2, 1, 3, 2, 4, 3])
        data = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
        self.adjacency_matrix = sp.sparse.coo_matrix(
            (data, (row, col)), 
            shape=(n_nodes, n_nodes)
        )
        
        # Create degree sequence and compute d_sqrt (degree^(-0.5))
        degrees = np.array(self.adjacency_matrix.sum(axis=1)).flatten()
        # Avoid division by zero by ensuring all degrees > 0
        degrees = np.maximum(degrees, 1.0)
        self.dn_sqrt = np.power(degrees, -0.5)

# Create the mock graph
g = MockGraph(n_nodes=5)

# Define reference nodes (subset of nodes)
ref_nodes = np.array([0, 2, 4])

# Define tolerance for eigenvalue computation
tol_eigs = 1e-06

# Define normalize flag
normalize = True

ARGS = {
    "g": g,
    "ref_nodes": ref_nodes,
    "tol_eigs": tol_eigs,
    "normalize": normalize
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mat_vec_with_Q Ran
ran on a synthesized input
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/fista_dinput_dense.py
code served (permissive licence) · get_code("fa5bf5f8919516b2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import sparse

# Create a small stand-in class for g that has the required attributes
class GraphObject:
    def __init__(self, n_nodes):
        self.n_nodes = n_nodes
        # dn_sqrt: diagonal matrix square root of degree normalization
        # Create a simple vector for element-wise multiplication
        self.dn_sqrt = np.array([0.5, 0.6, 0.7, 0.8])
        
        # adjacency_matrix: sparse matrix that supports .dot() operation
        # Create a small 4x4 sparse adjacency matrix
        data = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
        row = np.array([0, 0, 1, 1, 2, 3])
        col = np.array([1, 2, 0, 3, 1, 2])
        self.adjacency_matrix = sparse.csr_matrix(
            (data, (row, col)), shape=(4, 4)
        )

# Construct the arguments
g = GraphObject(n_nodes=4)
alpha = 0.5
x = np.array([1.0, 2.0, 3.0, 4.0])

ARGS = {
    "g": g,
    "alpha": alpha,
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sweepcut Ran
ran on a synthesized input
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/sweepcut.py
code served (permissive licence) · get_code("4f49bc8e3863ab76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class GraphObject:
    """Stand-in graph object with required attributes."""
    def __init__(self, n_nodes=5):
        self.n_nodes = n_nodes
        # Create a simple sparse adjacency matrix
        self.adjacency_matrix = np.array([
            [0, 1, 0, 1, 0],
            [1, 0, 1, 0, 1],
            [0, 1, 0, 1, 0],
            [1, 0, 1, 0, 1],
            [0, 1, 0, 1, 0]
        ], dtype=float)
        # Degree vector: sum of each row
        self.d = np.array([2, 3, 2, 3, 2], dtype=float)
        # Total volume of graph
        self.vol_G = np.sum(self.d)

# Create small test graph
g = GraphObject(n_nodes=5)

# Create probability vector p (non-negative values to sort)
p = np.array([0.9, 0.7, 0.5, 0.3, 0.1], dtype=float)

ARGS = {
    "p": p,
    "g": g
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MQI Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/MQI.py
code served (permissive licence) · get_code("e1737d8b1e0223d9")
How it ran

no invocation recorded.

MQI_weighted Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/MQI_weighted.py
code served (permissive licence) · get_code("a3be98a2ac73b7e5")
How it ran

no invocation recorded.

SimpleLocal Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/SimpleLocal.py
code served (permissive licence) · get_code("f3ee78284e072922")
How it ran

no invocation recorded.

SimpleLocal_weighted Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/SimpleLocal_weighted.py
code served (permissive licence) · get_code("5b7985e7d25d8368")
How it ran

no invocation recorded.

approximate_PageRank_weighted Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/approximate_PageRank_weighted.py
code served (permissive licence) · get_code("4b839d8e9371df3b")
How it ran

no invocation recorded.

eig2_nL Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/eig2_nL.py
code served (permissive licence) · get_code("63a290967ef4b75f")
How it ran

no invocation recorded.

fista_dinput_dense Not yet run
unverified (harvested, no recorded run)
kfoynt/LocalGraphClustering/localgraphclustering/algorithms/fista_dinput_dense.py
code served (permissive licence) · get_code("15a57b247e8c53ae")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
MQI 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters
MQI_weighted 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters
SimpleLocal 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters
SimpleLocal_weighted 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters
acl_list 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters
eig2nL_subgraph 1 other paper
1 later
2106.05245 (2021-06)
Local Algorithms for Finding Densely Connected Clusters

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Local graph clustering and the closely related seed set expansion problem are primitives on graphs that are central to a wide range of analytic and learning tasks such as local clustering, community detection, nodes ranking and feature inference. Prior work on local graph clustering mostly falls into two categories with numerical and combinatorial roots respectively. In this work, we draw inspiration from both fields and propose a family of convex optimization formulations based on the idea of diffusion with p-norm network flow for $p\in (1,\infty)$. In the context of local clustering, we characterize the optimal solutions for these optimization problems and show their usefulness in finding low conductance cuts around input seed set. In particular, we achieve quadratic approximation of conductance in the case of $p=2$ similar to the Cheeger-type bounds of spectral methods, constant factor approximation when $p\rightarrow\infty$ similar to max-flow based methods, and a smooth transition for general $p$ values in between. Thus, our optimization formulation can be viewed as bridging the numerical and combinatorial approaches, and we can achieve the best of both worlds in terms of speed and noise robustness. We show that the proposed problem can be solved in strongly local running time for $p\ge 2$ and conduct empirical evaluations on both synthetic and real-world graphs to illustrate our approach compares favorably with existing methods.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2005.09810")
get_code_for_paper("2005.09810")
have("2005.09810")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2005.09810.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2005.09810.svg)](https://syntology.ai/paper/2005.09810)

Connect an agent — have() is free.