SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.00742 · 2022

FirmTruss Community Search in Multilayer Networks

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 7 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2205.00742.json · badge: /api/ran/2205.00742.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
joint-em/ftcs canonical (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
FirmCore_k Ran
ran on a synthesized input
joint-em/ftcs/Code/FirmCore/FirmCore.py
code served (permissive licence) · get_code("a8ef299f07171313")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 heapq
import pickle
from collections import deque
from array import array
import gc

class MockInformation:
    def __init__(self):
        self.dataset = "test_dataset"

# Create a small multilayer graph structure
# multilayer_graph[node] = [list_of_neighbors_in_layer_0, list_of_neighbors_in_layer_1, ...]
multilayer_graph = {
    0: [array('i', [1, 2]), array('i', [2])],
    1: [array('i', [0, 3]), array('i', [0, 3])],
    2: [array('i', [0, 1]), array('i', [0])],
    3: [array('i', [1]), array('i', [1, 2])],
}

# nodes_iterator: should iterate over all node indices
nodes_iterator = range(4)

# layers_iterator: should iterate over layer indices
layers_iterator = range(2)

# k: minimum degree threshold
k = 1

# lammy: lambda parameter (number of largest degrees to consider)
lammy = 2

# query_nodes: starting node for BFS (as int or convertible to int)
query_nodes = 0

# information: object with dataset attribute
information = MockInformation()

ARGS = {
    "multilayer_graph": multilayer_graph,
    "nodes_iterator": nodes_iterator,
    "layers_iterator": layers_iterator,
    "k": k,
    "lammy": lammy,
    "query_nodes": query_nodes,
    "information": information,
    "save": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
density Ran
ran on a synthesized input
joint-em/ftcs/Code/Utils/density.py
code served (permissive licence) · get_code("dcb5afd14227fc89")
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 torch

torch.manual_seed(0)

# Analyzing the function:
# - number_of_nodes: used in division, should be int > 0
# - number_of_edges_layer_by_layer: dict-like, keys are layer identifiers, values are edge counts
# - beta: numeric, used in exponentiation

number_of_nodes = 10
number_of_edges_layer_by_layer = {
    0: 15,
    1: 8,
    2: 12,
    3: 5
}
beta = 0.5

ARGS = {
    "number_of_nodes": number_of_nodes,
    "number_of_edges_layer_by_layer": number_of_edges_layer_by_layer,
    "beta": beta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
density_log Ran
ran on a synthesized input
joint-em/ftcs/Code/Utils/density.py
code served (permissive licence) · get_code("7113f02270dcca67")
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 math

def density_log(number_of_nodes, number_of_edges_layer_by_layer, beta):
    maximum_density = 0.0
    maximum_layers = set()
    maximum_average_degrees = [0] * len(number_of_edges_layer_by_layer)
    sorted_layers = sorted(number_of_edges_layer_by_layer, key=number_of_edges_layer_by_layer.__getitem__, reverse=True)
    try:
        for number_of_layers, layer in enumerate(sorted_layers):
            maximum_average_degrees[layer] = number_of_edges_layer_by_layer[layer] / number_of_nodes
            layer_density = maximum_average_degrees[layer] * math.log(number_of_layers + 1)
            if layer_density >= maximum_density:
                maximum_density = layer_density
                maximum_layers = set([inner_layer for inner_layer in sorted_layers[:number_of_layers + 1]])
    except ZeroDivisionError:
        pass
    return (maximum_density, maximum_layers, tuple(maximum_average_degrees))

# Setup code
number_of_nodes = 10
number_of_edges_layer_by_layer = {
    0: 15,
    1: 8,
    2: 20,
    3: 5
}
beta = 0.5

ARGS = {
    "number_of_nodes": number_of_nodes,
    "number_of_edges_layer_by_layer": number_of_edges_layer_by_layer,
    "beta": beta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
get_d_hub_neighborhood Ran
ran on a synthesized input
joint-em/ftcs/Code/Utils/Distance.py
code served (permissive licence) · get_code("cb1120ddf287f023")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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.

from array import array

# Build a multilayer graph structure
# multilayer_graph[node] = [layer_neighbors_0, layer_neighbors_1, ...]
# where each layer_neighbors is a list of neighbor node indices

multilayer_graph = {
    0: [[1, 2], [2, 3]],      # node 0, layer 0: [1,2], layer 1: [2,3]
    1: [[0, 2], [3]],         # node 1, layer 0: [0,2], layer 1: [3]
    2: [[0, 1], [0, 3]],      # node 2, layer 0: [0,1], layer 1: [0,3]
    3: [[1, 2], [0, 1]],      # node 3, layer 0: [1,2], layer 1: [0,1]
}

# nodes_iterator: iterator over all node indices
nodes_iterator = [0, 1, 2, 3]

# d: distance/depth parameter
d = 2

# layers_iterator: iterator over all layer indices
layers_iterator = [0, 1]

# query_nodes: starting node for the neighborhood search
query_nodes = 0

# SFT_index: either False or a dict mapping (min_node, max_node) tuples to similarity/strength values
SFT_index = {
    (0, 1): 0.8,
    (0, 2): 0.7,
    (0, 3): 0.6,
    (1, 2): 0.9,
    (1, 3): 0.5,
    (2, 3): 0.75,
}

# k: threshold parameter for SFT_index filtering
k = 0.5

ARGS = {
    'multilayer_graph': multilayer_graph,
    'nodes_iterator': nodes_iterator,
    'd': d,
    'layers_iterator': layers_iterator,
    'query_nodes': query_nodes,
    'SFT_index': SFT_index,
    'k': k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
get_distances Ran
ran on a synthesized input
joint-em/ftcs/Code/Utils/Distance.py
code served (permissive licence) · get_code("99db67e0c5f78ccd")
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 dict. 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze function usage:
# - multilayer_graph[q] is indexed and iterated over (layers)
# - each layer_neighbors is iterated over and used with set operations
# - nodes is used with & (intersection) with sets and iterated over
# - nodes_iterator is used in list comprehensions with len
# - layers_iterator is used in list comprehensions with len
# - query_nodes is converted to int

# Create a small multilayer graph
# multilayer_graph should be a dict-like object where multilayer_graph[node_id] 
# returns a list of layers, and each layer contains neighbors
num_nodes = 5
num_layers = 3

# multilayer_graph[node_id] = [layer0_neighbors, layer1_neighbors, layer2_neighbors, ...]
multilayer_graph = {
    0: [[1, 2], [2, 3], [3, 4]],
    1: [[0, 2], [0, 3], [1, 4]],
    2: [[0, 1], [1, 3], [0, 4]],
    3: [[0, 2], [1, 2], [2, 4]],
    4: [[1, 2], [0, 3], [1, 3]]
}

# nodes should be a set that supports & (intersection) with other sets
nodes = {0, 1, 2, 3, 4}

# nodes_iterator should be iterable and used for range-like purposes
nodes_iterator = range(num_nodes)

# layers_iterator should be iterable
layers_iterator = range(num_layers)

# query_nodes should be convertible to int
query_nodes = 0

ARGS = {
    "multilayer_graph": multilayer_graph,
    "nodes": nodes,
    "nodes_iterator": nodes_iterator,
    "layers_iterator": layers_iterator,
    "query_nodes": query_nodes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
marginal_gain Ran
ran on a synthesized input
joint-em/ftcs/Code/Homophily/Homophily.py
code served (permissive licence) · get_code("9d1aecf000141b7a")
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 str. 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 torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - h: a dict mapping nodes to numeric values (float/int)
# - attributes: a dict mapping nodes to sequences (used with zip and sum)
# - p: a numeric parameter (int/float)

# The function iterates over h.keys() as nodes
# For each node, it accesses attributes[node] and attributes[node2]
# attributes values are zipped together and used in dot product calculations

# Creating small test data:
h = {
    'node_0': 5.0,
    'node_1': 3.0,
    'node_2': 7.0,
}

attributes = {
    'node_0': [1.0, 2.0, 0.5],
    'node_1': [0.5, 1.5, 2.0],
    'node_2': [2.0, 0.5, 1.0],
}

p = 2

ARGS = {
    'h': h,
    'attributes': attributes,
    'p': p,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
p_mean Ran
ran on a synthesized input
joint-em/ftcs/Code/Homophily/Homophily.py
code served (permissive licence) · get_code("5fcad4b6caeb295d")
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 float, ndim 0, dtype family float, shape () 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 math

def p_mean(h, p):
    score = 0
    if p <= -100:
        score = min(h.values())
    elif p >= 100:
        score = max(h.values())
    elif p == 0:
        score = 1
        for val in h.values():
            score *= math.log(val)
        score = score * (1 / len(h))
    else:
        for val in h.values():
            score += val ** p
        score /= len(h)
        score = score ** (1 / p)
    return score

# Construct valid arguments for p_mean
# h should be a dict with numeric values
# p should be a numeric parameter controlling the mean type

h_dict = {
    'a': 2.5,
    'b': 3.7,
    'c': 1.2,
    'd': 4.1
}

p_value = 2

ARGS = {
    'h': h_dict,
    'p': p_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
FirmTruss_k_index Not yet run
unverified (harvested, no recorded run)
joint-em/ftcs/Code/FirmTruss/FirmTruss.py
code served (permissive licence) · get_code("94d7e2d119c792b0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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-22.

Repositories linked to this paper

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

Abstract

In applications such as biological, social, and transportation networks, interactions between objects span multiple aspects. For accurately modeling such applications, multilayer networks have been proposed. Community search allows for personalized community discovery and has a wide range of applications in large real-world networks. While community search has been widely explored for single-layer graphs, the problem for multilayer graphs has just recently attracted attention. Existing community models in multilayer graphs have several limitations, including disconnectivity, free-rider effect, resolution limits, and inefficiency. To address these limitations, we study the problem of community search over large multilayer graphs. We first introduce FirmTruss, a novel dense structure in multilayer networks, which extends the notion of truss to multilayer graphs. We show that FirmTrusses possess nice structural and computational properties and bring many advantages compared to the existing models. Building on this, we present a new community model based on FirmTruss, called FTCS, and show that finding an FTCS community is NP-hard. We propose two efficient 2-approximation algorithms, and show that no polynomial-time algorithm can have a better approximation guarantee unless P = NP. We propose an index-based method to further improve the efficiency of the algorithms. We then consider attributed multilayer networks and propose a new community model based on network homophily. We show that community search in attributed multilayer graphs is NP-hard and present an effective and efficient approximation algorithm. Experimental studies on real-world graphs with ground-truth communities validate the quality of the solutions we obtain and the efficiency of the proposed algorithms.

For agents

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

get_harvested_code_for_paper("2205.00742")
get_code_for_paper("2205.00742")
have("2205.00742")

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

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

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

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

Connect an agent — have() is free.