{"id":36425842,"url":"https://github.com/cwtsleiden/networkanalysis","last_synced_at":"2026-01-11T18:00:06.791Z","repository":{"id":49356200,"uuid":"153760626","full_name":"CWTSLeiden/networkanalysis","owner":"CWTSLeiden","description":"Java package that provides data structures and algorithms for network analysis.","archived":false,"fork":false,"pushed_at":"2023-12-19T08:55:56.000Z","size":608,"stargazers_count":151,"open_issues_count":6,"forks_count":34,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-01-11T10:26:09.294Z","etag":null,"topics":["clustering","clustering-algorithm","community-detection","java","layout","layout-algorithm","leiden-algorithm","louvain-algorithm","mapping","network-analysis","vos-technique"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CWTSLeiden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-19T09:41:56.000Z","updated_at":"2026-01-11T09:31:19.000Z","dependencies_parsed_at":"2025-09-10T05:35:13.595Z","dependency_job_id":"019bd382-a1da-421b-8277-a3e0040f7246","html_url":"https://github.com/CWTSLeiden/networkanalysis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/CWTSLeiden/networkanalysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CWTSLeiden%2Fnetworkanalysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CWTSLeiden%2Fnetworkanalysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CWTSLeiden%2Fnetworkanalysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CWTSLeiden%2Fnetworkanalysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CWTSLeiden","download_url":"https://codeload.github.com/CWTSLeiden/networkanalysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CWTSLeiden%2Fnetworkanalysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28316869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","clustering-algorithm","community-detection","java","layout","layout-algorithm","leiden-algorithm","louvain-algorithm","mapping","network-analysis","vos-technique"],"created_at":"2026-01-11T18:00:05.997Z","updated_at":"2026-01-11T18:00:06.762Z","avatar_url":"https://github.com/CWTSLeiden.png","language":"Java","readme":"# networkanalysis\n\n[![Build master branch](https://github.com/CWTSLeiden/networkanalysis/workflows/Build%20master%20branch/badge.svg?branch=master)](https://github.com/CWTSLeiden/networkanalysis/actions)\n[![License: MIT](https://badgen.net/github/license/CWTSLeiden/networkanalysis?label=License\u0026color=yellow)](https://github.com/CWTSLeiden/networkanalysis/blob/master/LICENSE)\n[![Latest release](https://badgen.net/github/release/CWTSLeiden/networkanalysis?label=Release)](https://github.com/CWTSLeiden/networkanalysis/releases)\n[![Maven Central version](https://badgen.net/maven/v/maven-central/nl.cwts/networkanalysis)](https://central.sonatype.com/artifact/nl.cwts/networkanalysis)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1466830.svg)](https://doi.org/10.5281/zenodo.1466830)\n\n## Introduction\n\nThis Java package provides algorithms and data structures for network analysis.\nCurrently, the package focuses on clustering (or community detection) and layout (or mapping) of networks.\nIn particular, the package contains an implementation of the [Leiden algorithm](https://arxiv.org/abs/1810.08473) and the [Louvain algorithm](https://arxiv.org/abs/0803.0476) for network clustering and the [VOS technique](https://arxiv.org/abs/1003.2551) for network layout.\nOnly undirected networks are supported.\n\nThe networkanalysis package was developed by [Nees Jan van Eck](https://orcid.org/0000-0001-8448-4521), [Vincent Traag](https://orcid.org/0000-0003-3170-3879), and [Ludo Waltman](https://orcid.org/0000-0001-8249-1752) at the [Centre for Science and Technology Studies (CWTS)](https://www.cwts.nl) at [Leiden University](https://www.universiteitleiden.nl/en).\n\n## Documentation\n\nDocumentation is provided in the source code in `javadoc` format.\nThe documentation is also available in a [compiled format](https://CWTSLeiden.github.io/networkanalysis).\n\n## Installation\n\n### Maven\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003enl.cwts\u003c/groupId\u003e\n    \u003cartifactId\u003enetworkanalysis\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```\nimplementation group: 'nl.cwts', name: 'networkanalysis', version: '1.3.0'\n```\n\n## Usage\n\nThe networkanalysis package requires Java 8 or higher.\nThe latest version of the package is available as a pre-compiled `jar` on [Maven Central](https://central.sonatype.com/artifact/nl.cwts/networkanalysis) and [GitHub Packages](https://github.com/CWTSLeiden/networkanalysis/packages).\nInstructions for compiling the source code of the package are provided [below](#development-and-deployment).\n\nTo run the clustering algorithms, the command-line tool `RunNetworkClustering` is provided.\nThe tool can be run as follows:\n\n```\njava -cp networkanalysis-1.3.0.jar nl.cwts.networkanalysis.run.RunNetworkClustering\n```\n\nIf no further arguments are provided, the following usage notice will be displayed:\n\n```\nRunNetworkClustering version 1.3.0\nBy Vincent Traag, Ludo Waltman, and Nees Jan van Eck\nCentre for Science and Technology Studies (CWTS), Leiden University\n\nUsage: RunNetworkClustering [options] \u003cfilename\u003e\n\nIdentify clusters (also known as communities) in a network using either the\nLeiden or the Louvain algorithm.\n\nThe file in \u003cfilename\u003e is expected to contain a tab-separated edge list\n(without a header line). Nodes are represented by zero-index integer numbers.\nOnly undirected networks are supported. Each edge should be included only once\nin the file.\n\nOptions:\n-q --quality-function {CPM|Modularity} (default: CPM)\n    Quality function to be optimized. Either the CPM (constant Potts model) or\n    the modularity quality function can be used.\n-n --normalization {none|AssociationStrength|Fractionalization} (Default: none)\n    Method for normalizing edge weights in the CPM quality function.\n-r --resolution \u003cresolution\u003e (default: 1.0)\n    Resolution parameter of the quality function.\n-m --min-cluster-size \u003cmin. cluster size\u003e (default: 1)\n    Minimum number of nodes per cluster.\n-a --algorithm {Leiden|Louvain} (default: Leiden)\n    Algorithm for optimizing the quality function. Either the Leiden or the\n    Louvain algorithm can be used.\n-s --random-starts \u003crandom starts\u003e (default: 1)\n    Number of random starts of the algorithm.\n-i --iterations \u003citerations\u003e (default: 10)\n    Number of iterations of the algorithm.\n--randomness \u003crandomness\u003e (default: 0.01)\n    Randomness parameter of the Leiden algorithm.\n--seed \u003cseed\u003e (default: random)\n    Seed of the random number generator.\n-w --weighted-edges\n    Indicates that the edge list file has a third column containing edge\n    weights.\n--sorted-edge-list\n    Indicates that the edge list file is sorted. The file should be sorted based\n    on the nodes in the first column, followed by the nodes in the second\n    column. Each edge should be included in both directions in the file.\n--input-clustering \u003cfilename\u003e (default: singleton clustering)\n    Read the initial clustering from the specified file. The file is expected to\n    contain two tab-separated columns (without a header line), first a column of\n    nodes and then a column of clusters. Nodes and clusters are both represented\n    by zero-index integer numbers. If no file is specified, a singleton\n    clustering (in which each node has its own cluster) is used as the initial\n    clustering.\n-o --output-clustering \u003cfilename\u003e (default: standard output)\n    Write the final clustering to the specified file. If no file is specified,\n    the standard output is used.\n```\n\nTo run the layout algorithm, the command-line tool `RunNetworkLayout` is provided.\nThe tool can be run as follows:\n\n```\njava -cp networkanalysis-1.3.0.jar nl.cwts.networkanalysis.run.RunNetworkLayout\n```\n\nIf no further arguments are provided, the following usage notice will be displayed:\n\n```\nRunNetworkLayout version 1.3.0\nBy Nees Jan van Eck and Ludo Waltman\nCentre for Science and Technology Studies (CWTS), Leiden University\n\nUsage: RunNetworkLayout [options] \u003cfilename\u003e\n\nDetermine a layout for a network using the gradient descent VOS layout\nalgorithm.\n\nThe file in \u003cfilename\u003e is expected to contain a tab-separated edge list\n(without a header line). Nodes are represented by zero-index integer numbers.\nOnly undirected networks are supported. Each edge should be included only once\nin the file.\n\nOptions:\n-q --quality-function {VOS|LinLog} (default: VOS)\n    Quality function to be optimized. Either the VOS (visualization of\n    similarities) or the LinLog quality function can be used.\n-n --normalization {none|AssociationStrength|Fractionalization} (Default: none)\n    Method for normalizing edge weights in the VOS quality function.\n-a --attraction \u003cattraction\u003e (Default: 2)\n    Attraction parameter of the VOS quality function.\n-r --repulsion \u003crepulsion\u003e (Default: 1)\n    Repulsion parameter of the VOS quality function.\n-s --random-starts \u003crandom starts\u003e (default: 1)\n    Number of random starts of the gradient descent algorithm.\n-i --max-iterations \u003cmax. iterations\u003e (default: 1000)\n    Maximum number of iterations of the gradient descent algorithm.\n--initial-step-size \u003cinitial step size\u003e (default: 1.0)\n    Initial step size of the gradient descent algorithm.\n--min-step-size \u003cmin. step size\u003e (default: 0.001)\n    Minimum step size of the gradient descent algorithm.\n--step-size-reduction \u003cstep size reduction\u003e (default: 0.75)\n    Step size reduction of the gradient descent algorithm.\n--required-quality-value-improvements \u003crequired quality value improvements\u003e\n        (default: 5)\n    Required number of quality value improvements of the gradient descent\n    algorithm.\n--seed \u003cseed\u003e (default: random)\n    Seed of the random number generator.\n-w --weighted-edges\n    Indicates that the edge list file has a third column containing edge\n    weights.\n--sorted-edge-list\n    Indicates that the edge list file is sorted. The file should be sorted based\n    on the nodes in the first column, followed by the nodes in the second\n    column. Each edge should be included in both directions in the file.\n--input-layout \u003cfilename\u003e (default: random layout)\n    Read the initial layout from the specified file. The file is expected to\n    contain three tab-separated columns (without a header line), first a column\n    of nodes, then a column of x coordinates, and finally a column of\n    y coordinates. Nodes are represented by zero-index integer numbers. If no\n    file is specified, a random layout (in which each node is positioned at\n    random coordinates) is used as the initial layout.\n-o --output-layout \u003cfilename\u003e (default: standard output)\n    Write the final layout to the specified file. If no file is specified,\n    the standard output is used.\n```\n\n### Example\n\nThe following example illustrates the use of the `RunNetworkClustering` and `RunNetworkLayout` tools.\nConsider this network:\n\n```text\n    0-----1\n     \\   /\n      \\ /\n       2\n       |\n       3\n      / \\\n     /   \\\n    4-----5\n```\n\nThe network is encoded as an edge list that is saved in a text file containing two tab-separated columns:\n\n```text\n0\t1\n1\t2\n2\t0\n2\t3\n3\t5\n5\t4\n4\t3\n```\n\nNodes must be represented by integer numbers starting from 0.\n\nAssuming that the edge list has been saved in the file `network.txt`, the `RunNetworkClustering` tool can be run as follows:\n\n```\njava -cp networkanalysis-1.3.0.jar nl.cwts.networkanalysis.run.RunNetworkClustering -r 0.2 -o clusters.txt network.txt\n```\n\nIn this case, clusters are identified using the Leiden algorithm.\nThe CPM (constant Potts model) quality function is used without normalizing edge weights.\nA value of `0.2` is used for the resolution parameter.\nThe resulting clustering is saved in the text file `clusters.txt` that contains two tab-separated columns:\n\n```text\n0\t0\n1\t0\n2\t0\n3\t1\n4\t1\n5\t1\n```\n\nThe file `clusters.txt` shows that two clusters have been identified.\nThe first column in the file represents a node, and the second column represents the cluster to which the node belongs.\nCluster 0 includes nodes 0, 1, and 2.\nCluster 1 includes nodes 3, 4, and 5.\n\nThe `RunNetworkLayout` tool can be run as follows:\n\n```\njava -cp networkanalysis-1.3.0.jar nl.cwts.networkanalysis.run.RunNetworkLayout -o layout.txt network.txt\n```\n\nIn this case, the default parameter values are used for the VOS layout technique.\nThe resulting layout is saved in the text file `layout.txt` containing three tab-separated columns:\n\n```text\n0\t-0.8690519467788094\t-0.04001496992603245\n1\t-0.8690620214452673\t0.040038034108640194\n2\t-0.4603890908313338\t-2.5793522310420543E-5\n3\t0.46031975105512185\t-1.6403462331212636E-5\n4\t0.8690853506388282\t0.04007029704233864\n5\t0.86909795736146\t-0.04005116424030402\n```\n\nThe first column in the file `layout.txt` represents a node, and the second and third column represent the x and y coordinates of the node.\n\nIn the above example, the edges in the file `network.txt` have not been sorted.\nTo provide a sorted edge list as input, include the edges in both directions and use the option ``--sorted-edge-list``.\nFurthermore, edge weights can be provided by adding a third column to the file `network.txt` and by using the option ``--weighted-edges``.\n\n## License\n\nThe networkanalysis package is distributed under the [MIT license](LICENSE).\n\n## Issues\n\nIf you encounter any issues, please report them using the [issue tracker](https://github.com/CWTSLeiden/networkanalysis/issues) on GitHub.\n\n## Contribution\n\nYou are welcome to contribute to the development of the networkanalysis package.\nPlease follow the typical GitHub workflow: Fork from this repository and make a pull request to submit your changes.\nMake sure that your pull request has a clear description and that your source code has been properly tested.\n\n## Development and deployment\n\nThe latest stable version of the source code is available in the [`master`](https://github.com/CWTSLeiden/networkanalysis/tree/master) branch on GitHub.\nThe most recent version of the source code, which may be under development, is available in the [`develop`](https://github.com/CWTSLeiden/networkanalysis/tree/develop) branch.\n\n### Compilation\n\nTo compile the source code of the networkanalysis package, a [Java Development Kit](https://jdk.java.net) needs to be installed on your system (version 8 or higher). Having [Gradle](https://www.gradle.org) installed is optional as the [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) is also included in this repository.\n\nOn Windows, the source code can be compiled as follows:\n\n```\ngradlew build\n```\n\nOn Linux and MacOS, use the following command:\n\n```\n./gradlew build\n```\n\nThe compiled `class` files will be output to the directory `build/classes`.\nThe compiled `jar` file will be output to the directory `build/libs`.\nThe compiled `javadoc` files will be output to the directory `build/docs`.\n\nThere are two `main` methods, one in the class `nl.cwts.networkanalysis.run.RunNetworkClustering` and one in the class `nl.cwts.networkanalysis.run.RunNetworkLayout`.\nAfter compiling the source code, the `RunNetworkClustering` tool can be run as follows:\n\n```\njava -cp build/libs/networkanalysis-\u003cversion\u003e.jar nl.cwts.networkanalysis.run.RunNetworkClustering\n```\n\nThe `RunNetworkLayout` tool can be run as follows:\n\n```\njava -cp build/libs/networkanalysis-\u003cversion\u003e.jar nl.cwts.networkanalysis.run.RunNetworkLayout\n```\n\n## References\n\n\u003e Traag, V.A., Waltman, L., \u0026 Van Eck, N.J. (2019). From Louvain to Leiden: Guaranteeing well-connected communities. *Scientific Reports*, 9, 5233. https://doi.org/10.1038/s41598-019-41695-z\n\n\u003e Van Eck, N.J., Waltman, L., Dekker, R., \u0026 Van den Berg, J. (2010). A comparison of two techniques for bibliometric mapping: Multidimensional scaling and VOS. *Journal of the American Society for Information Science and Technology*, 61(12), 2405-2416. https://doi.org/10.1002/asi.21421\n\n\u003e Waltman, L., Van Eck, N.J., \u0026 Noyons, E.C.M. (2010). A unified approach to mapping and clustering of bibliometric networks. *Journal of Informetrics*, 4(4), 629-635. https://doi.org/10.1016/j.joi.2010.07.002\n\n\u003e Van Eck, N.J., \u0026 Waltman, L. (2009). How to normalize co-occurrence data? An analysis of some well-known similarity measures. *Journal of the American Society for Information Science and Technology*, 60(8), 1635-1651. https://doi.org/10.1002/asi.21075\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwtsleiden%2Fnetworkanalysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwtsleiden%2Fnetworkanalysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwtsleiden%2Fnetworkanalysis/lists"}