OSCR

Chordless cycle filtrations for dimensionality detection in complex networks via topological data analysis.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

3 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 5 matches
  1. [1] § Methods › Database and neural network architecture › Neural network DIMNN model ↔ scripts/neural_network_training_two_phases.py, lines 23 to 101 · score 0.71 · hidden layers, AdamW, activations, dropout, optimizer, residual · block oscr:b:9A8PWC8239SK5-X · Report a mismatch
  2. [2] § Methods › Database and neural network architecture › Neural network DIMNN model ↔ dimnn/neural_network_training_clean.py, lines 64 to 168 · score 0.69 · hidden layers, AdamW, dropout, optimizer, residual, MLP · block oscr:b:FTWE47QVW0ZAB-R · Report a mismatch
  3. [3] § Results › Dimensionality estimation using neural networks ↔ geometric-randomization/notebooks/network-properties-d-mercator.ipynb, lines 194 to 214 · score 0.65 · clustering spectrum, connected component, neighbor degree, Mercator, properties, networks · Report a mismatch
  4. [4] § Methods › Multidimensional geometric soft configuration model › Microcanonical formulation of model ↔ SD-model/notebooks/tutorial.ipynb, lines 37 to 54 · score 0.55 · power law, generated synthetic networks, exponent, nodes, model, dimension · Report a mismatch
  5. [5] § Methods › Multidimensional geometric soft configuration model › Microcanonical formulation of model ↔ geometric-randomization/generate_synthetic_networks.py, lines 18 to 61 · score 0.51 · generated synthetic networks, geometric randomization, realizations, dimension · block oscr:b:DWPXP5B97EXPP-5 · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 105 lines · 4.6 KB · no license · 1 match

  1. import pandas as pd
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. from sklearn.preprocessing import StandardScaler
  5. import keras
  6. import tensorflow as tf
  7. from keras.callbacks import EarlyStopping
  8. import seaborn as sns
  9. from residual_network import build_residual_mlp
  10. gpus = tf.config.list_physical_devices('GPU')
  11. if gpus:
  12. # Restrict TensorFlow to only use the first GPU
  13. try:
  14. tf.config.set_visible_devices(gpus[0], 'GPU')
  15. logical_gpus = tf.config.list_logical_devices('GPU')
  16. print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPU")
  17. except RuntimeError as e:
  18. # Visible devices must be set before GPUs have been initialized
  19. print(e)
  20. def main():
  21. keras.utils.set_random_seed(42)
  22. data = pd.read_csv('../data/data_for_training_large.csv')
  23. #data2 = pd.read_csv('./data/training_synthetic_networks.csv', index_col=0)
  24. #data = pd.concat([data, data2], ignore_index=True)
  25. # Possible feature vectors
  26. columns = ['num_nodes', 'avg_degree', 'Ct', 'Cs', 'Cp']
  27. columns = ['num_nodes', 'avg_degree', 'tp1_t', 'tp1_s', 'tp1_p']
  28. columns = ['num_nodes', 'avg_degree', 'Ct', 'Cs', 'Cp','tp1_t', 'tp1_s', 'tp1_p']
  29. y_train_phase_1 = data[['gamma', 'beta']]
  30. y_train_phase_2 = data['dim'] - 1 # Ensure 'dim' is zero-indexed
  31. X_train_phase_1 = data[columns]
  32. X_train_phase_2 = data[columns + ['gamma', 'beta']]
  33. # Number of classes of phase 2
  34. N = len(np.unique(y_train_phase_2))
  35. print(f"Number of classes: {N}")
  36. # For test
  37. X_test = pd.read_csv('../data/test_real_networks.csv', index_col=0)
  38. X_test = X_test[columns]
  39. # Normalization
  40. scaler_phase_1 = StandardScaler()
  41. scaler_phase_2 = StandardScaler()
  42. X_train_phase_1 = scaler_phase_1.fit_transform(X_train_phase_1)
  43. X_train_phase_2 = scaler_phase_2.fit_transform(X_train_phase_2)
  44. model_phase_1 = build_residual_mlp(input_dim=len(columns),
  45. hidden_layer_sizes=[32, 64, 64, 128, 256, 512, 1024, 1024, 512,
  46. 256, 128, 64, 64, 64, 32, 32, 16, 16, 16, 8, 8],
  47. output_dim=2, dropout_rate=0.5)
  48. model_phase_2 = build_residual_mlp(input_dim=len(columns) + 2,
  49. hidden_layer_sizes=[32, 64, 64, 128, 256, 512, 1024, 1024, 512,
  50. 256, 128, 64, 64, 64, 32, 32, 16, 16, 16, 8, 8],
  51. output_dim=N, dropout_rate=0.5, output_activation='linear')
  52. optimizer_phase_1 = keras.optimizers.AdamW(learning_rate=0.0005)
  53. model_phase_1.compile(optimizer=optimizer_phase_1, loss='mse', metrics=['mae'])
  54. early_stopping_phase_1 = EarlyStopping(monitor='val_loss', patience=20, restore_best_weights=True)
  55. history = model_phase_1.fit(X_train_phase_1, y_train_phase_1, epochs=200, batch_size=64, validation_split=0.2,
  56. callbacks=[early_stopping_phase_1], verbose=2)
  57. loss, mae = model_phase_1.evaluate(X_train_phase_1, y_train_phase_1)
  58. print(f"Train mae: {mae:.4f}")
  59. model_phase_1.save('base_NN_model_residual_phase_1.keras')
  60. # Train phase 2
  61. optimizer_phase_2 = keras.optimizers.AdamW(learning_rate=0.0005)
  62. model_phase_2.compile(optimizer=optimizer_phase_2, loss='sparse_categorical_crossentropy', metrics=['accuracy'])
  63. early_stopping_phase_2 = EarlyStopping(monitor='val_loss', patience=20, restore_best_weights=True)
  64. history = model_phase_2.fit(X_train_phase_2, y_train_phase_2, epochs=200, batch_size=64, validation_split=0.2,
  65. callbacks=[early_stopping_phase_2], verbose=2)
  66. loss, accuracy = model_phase_2.evaluate(X_train_phase_2, y_train_phase_2)
  67. print(f"Train accuracy: {accuracy:.4f}")
  68. model_phase_2.save('base_NN_model_residual_phase_2.keras')
  69. # Perform predictions
  70. X_test_phase_1 = scaler_phase_1.transform(X_test)
  71. predictions_phase_1 = model_phase_1.predict(X_test_phase_1)
  72. # Concatenate predictions with previous X_test on columns
  73. X_test_phase_2 = pd.concat([X_test, pd.DataFrame(predictions_phase_1, columns=['gamma', 'beta'])], axis=1)
  74. X_test_phase_2 = scaler_phase_2.transform(X_test_phase_2)
  75. predictions_phase_2 = model_phase_2.predict(X_test_phase_2)
  76. y_hat = np.argmax(predictions_phase_2, axis=1)
  77. y_hat = y_hat + 1
  78. test_networks = pd.read_csv('../data/test_real_networks.csv', index_col=0)
  79. for i, name in enumerate(test_networks['name']):
  80. print("Network "+name)
  81. print("Inferred dimension: "+str(y_hat[i]))
  82. print("Probability: "+format(predictions_phase_2[i][y_hat[i]-1], '.4f'))
  83. if __name__ == '__main__':
  84. main()

neural_network_training_two_phases.py at commit 870c695, no license · at the source

Overview

Authors: Aina Ferrà Marcús1, Robert Jankowski2,3,4, Meritxell Vila-Miñana5, Carles Casacuberta1, M Ángeles Serrano2,3,6
  1. Departament de Matèmatiques i Informàtica, Universitat de Barcelona, Barcelona, Spain
  2. Departament de Física de la Matèria Condensada, Universitat de Barcelona, Barcelona, Spain
  3. Universitat de Barcelona Institute of Complex Systems (UBICS), Universitat de Barcelona, Barcelona, Spain
  4. Faculty of Electrical Engineering, Mathematics and Computer Science, Delft University of Technology, Delft, Netherlands
  5. Center for Complex Networks and Systems Research, Luddy School of Informatics, Computing, and Engineering, Indiana University, Bloomington, IN USA
  6. ICREA, Barcelona, Spain
Journal: Nature communications, volume 17, issue 1, article 6105
Dates: received 16 September 2025; accepted 22 April 2026; published online 6 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-72687-z · PMID 42091870 · PMCID PMC13358065 · OpenAlex W4417065225
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: systems (subfield)
Methods: Graphs, Machine learning, Spectral & time-frequency
Keywords: Applied mathematics, Complex networks
Topic: Topological and Geometric Data Analysis (Computational Theory and Mathematics, Computer Science), according to OpenAlex
Funding: Agencia Estatal de Investigación de España, AEI
Citations: cited by 1 paper (Europe PMC); 73 references in the paper

Abstract

Many complex networks, ranging from social to biological systems, exhibit structural patterns consistent with an underlying hyperbolic geometry. Revealing the dimensionality of this latent space can disentangle the structural complexity of communities, impact efficient network navigation, and fundamentally shape connectivity and system behavior. We introduce a topological data analysis weighting scheme for graphs based on chordless cycles to estimate network dimensionality in a data-driven way. We further show that the resulting descriptors can effectively estimate network dimensionality using a neural network architecture trained on a synthetic graph database constructed for this purpose, which requires no retraining to transfer effectively to real-world networks. Thus, by combining cycle-aware filtrations, algebraic topology, and machine learning, our approach provides a robust and effective method for uncovering the hidden geometry of complex networks and guiding accurate modeling and low-dimensional embedding.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

networkgeometry/detecting-dimensionality-TDA-DimNN

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 870c69581f70a1503691efa8713f09b152136bd3, 8 April 2026
Languages: Python (30), Jupyter (7), C++ (5), C/C++ (3)
Size: 95 files, 45 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, environment (requirements.txt), 7 notebooks
Not found: license file, CITATION.cff, tests, continuous integration, documentation
Tools: pandas (21 files), NumPy (20 files), NetworkX (11 files), TensorFlow (10 files), Keras (9 files), Matplotlib (9 files), scikit-learn (8 files), seaborn (8 files), Numba (2 files), SciPy (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
46 files

Code availability

The open-source code generated in this work, along with the code to reproduce the figures, is available on GitHub at https://github.com/networkgeometry/detecting-dimensionality-TDA-DimNN.

Reproduced under the paper's license (CC BY), from the paper cited above.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 45 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

The real network datasets used in this study are available from the sources referenced in the manuscript and the Supplementary Information. The SYNNET dataset of 792 000 synthetic networks generated with the SD model used for neural network training, along with the neural network checkpoints, is available on Zenodo73.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 2 keywords, 1 funder, 29 references.

Cite

This paper

Ferrà Marcús, A., Jankowski, R., Vila-Miñana, M., Casacuberta, C., & Serrano, M. Á. (2026). Chordless cycle filtrations for dimensionality detection in complex networks via topological data analysis. Nature communications, 17(1), 6105. https://doi.org/10.1038/s41467-026-72687-z

BibTeX

@article{ferramarcus2026chordless,
author = {Ferrà Marcús, Aina and Jankowski, Robert and Vila-Miñana, Meritxell and Casacuberta, Carles and Serrano, M Ángeles},
title = {{Chordless cycle filtrations for dimensionality detection in complex networks via topological data analysis}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {6105},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-72687-z},
url = {https://doi.org/10.1038/s41467-026-72687-z},
pmid = {42091870},
pmcid = {PMC13358065}
}

RIS

TY - JOUR
AU - Ferrà Marcús, Aina
AU - Jankowski, Robert
AU - Vila-Miñana, Meritxell
AU - Casacuberta, Carles
AU - Serrano, M Ángeles
TI - Chordless cycle filtrations for dimensionality detection in complex networks via topological data analysis
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/05/06
VL - 17
IS - 1
SP - 6105
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-72687-z
UR - https://doi.org/10.1038/s41467-026-72687-z
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-72687-z",
"type": "article-journal",
"title": "Chordless cycle filtrations for dimensionality detection in complex networks via topological data analysis",
"container-title": "Nature communications",
"author": [
{
"family": "Ferrà Marcús",
"given": "Aina"
},
{
"family": "Jankowski",
"given": "Robert"
},
{
"family": "Vila-Miñana",
"given": "Meritxell"
},
{
"family": "Casacuberta",
"given": "Carles"
},
{
"family": "Serrano",
"given": "M Ángeles"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "6105",
"DOI": "10.1038/s41467-026-72687-z",
"PMID": "42091870",
"PMCID": "PMC13358065",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-72687-z",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
6
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41467-026-75959-w [code]
Charting higher-order models of brain function beyond pairwise interactions.
Journal: Nature communications
In common: Numba, NetworkX, seaborn, 5 other tools, 3 references
[2] doi:10.1073/pnas.2317608121 [code]
Unraveling the mesoscale organization induced by network-driven processes.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: NetworkX, seaborn, scikit-learn, 4 other tools, systems, 3 references
[3] doi:10.1007/s00429-021-02435-0 [code]
A hands-on tutorial on network and topological neuroscience.
Journal: Brain structure & function
In common: NetworkX, TensorFlow, seaborn, 5 other tools, 3 references
[4] doi:10.1016/j.isci.2024.111585 [code]
Heterogeneous and higher-order cortical connectivity undergirds efficient, robust, and reliable neural codes.
Journal: iScience
In common: NetworkX, seaborn, scikit-learn, 4 other tools, systems, 3 references
[5] doi:10.1126/sciadv.aed3650 [code]
Truthful visualizations for mass spectrometry imaging enable high-spatial-resolution interactive <i>m/z</i> mapping and exploration.
Journal: Science advances
In common: Numba, Keras, NetworkX, 6 other tools, 1 reference
[6] doi:10.1038/s41467-024-54472-y [code]
Higher-order connectomics of human brain function reveals local topological signatures of task decoding, individual identification, and behavior.
Journal: Nature communications
In common: NetworkX, seaborn, scikit-learn, 4 other tools, 3 references
[7] doi:10.1016/j.isci.2024.109370 [code]
Topological structure of population activity in mouse visual cortex encodes densely sampled stimulus rotations.
Journal: iScience
In common: NetworkX, seaborn, scikit-learn, 3 other tools, systems, 3 references
[8] doi:10.1073/pnas.2407997121 [code]
Tracking the topology of neural manifolds across populations.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Numba, Keras, TensorFlow, 5 other tools, 1 reference
[9] doi:10.1162/netn_a_00439 [code]
Metric structural human connectomes: Localization and multifractality of eigenmodes.
Journal: Network neuroscience (Cambridge, Mass.)
In common: Numba, NetworkX, seaborn, 5 other tools, 1 reference
[10] doi:10.1016/j.patter.2025.101427 [code]
Node persistence from topological data analysis reveals changes in brain functional connectivity.
Journal: Patterns (New York, N.Y.)
In common: NetworkX, seaborn, pandas, 3 other tools, systems, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z.svg)](https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-72687-z.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.