matlab-igraph: bringing igraph to MATLAB

matlab-igraph: bringing igraph to MATLAB - Published in JOSS (2025)

https://github.com/davidrconnell/matlab-igraph

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

graph graph-algorithms matlab network-analysis
Last synced: 3 months ago · JSON representation ·

Repository

Igraph bindings for matlab

Basic Info
Statistics
  • Stars: 3
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 17
Topics
graph graph-algorithms matlab network-analysis
Created over 2 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

DOI

matlab-igraph

A toolbox that brings the power of the igraph C library to MATLAB.

See The documentation for a more thorough introduction.

The igraph C library provides efficient graph analysis functions including graph generation, reading/writing graphs to file, and community detection.

This toolbox aims to provide a consistent API to perform graph analyses inside MATLAB while following MATLAB's conventions.

In MATLAB, graphs can be stored as adjacency matrices or using MATLAB's builting graph class. By using standard matrices, it's easy to produce and process graphs using builtin functions. Both full and sparse adjacency matrices are supported along with different data types (doubles and logicals). This allows flexibility and easy integration into preexisting projects.

See the getting started live script in the toolbox for basic usage.

For File Exchange users if downloading from the File Exchange or using MATLAB's Add-ons manager, you may want to run igraph.postinstall() after the installation to remove files that are not required on your system.

Citation

If you publish results generated with the help of this package, make sure to cite igraph:

Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research. InterJournal, Complex Systems, 1695.

Installation

See The installation guide for a more in-depth instructions and error resolution.

Pre-compiled toolbox (recommended)

You can use MATLAB Add-ons manager. This will track toolbox updates. It's also possible to download the toolbox directly from the release page, however, this will need to be manually updated. If manually downloading the toolbox, double click on the file (ending in .mltbx) in MATLAB to install.

Building the toolbox

In addition to MATLAB this toolbox depends on cmake, bison, flex, and libxml2. On Windows, you will need to install the msys environment and download the dependencies using the provided pacman package manager. To build, start in the root directory of this git repo and run:

bash mkdir build cd build cmake .. cmake --build .

See cmake's docs for more options, using the Ninja generator (depends on the ninja build tool) instead of the default make is faster.

You can build the package target to get a toolbox with all the files in the correct place:

bash cmake --build . --target package

Then unzip the package and add the contained toolbox to MATLAB's path.

Development

Since the toolbox is a mix of MATLAB source files and compiled files that end up in build directory, the easiest approach for development (on Linux and macOS) is to add the source directory to MATLAB's path, build the default target, and link the compiled files to the correct location in the source directory. From the build directory:

bash cd ../toolbox/+igraph/private ln -s ../../../build/mex/*.mexa64 . cd ../../../tests/mxIgraph/private ln -s ../../../build/tests/*.mexa64 .

Where mexa64 is the Linux mex extension. Now MATLAB will automatically reload compiled files when they are rebuilt. There will also be a compile_commands.json in the build directory that can be linked to the root of the repository.

Unfortunately, this will not work on Windows since the compiled files will not be able to find their dynamic libraries. Instead, add a '--install-prefix' to the cmake config command then running cmake --install build will install all files needed to that location. Add the install path to MATLAB's path. In this case, the install command will need to be rerun whenever m files are changed.

Testing

Tests can be run using ctest with the --test-dir being set to the build directory. For interactive development, it's faster to run buildtool in a running MATLAB instance since it doesn't require repeatedly starting MATLAB. To run all tests:

matlab buildtool test

Test can be replaced with testMxIgraph or testToolbox.

See also

Owner

  • Name: David R. Connell
  • Login: DavidRConnell
  • Kind: user

Research Engineer studying Alzheimer's disease at Rush University.

JOSS Publication

matlab-igraph: bringing igraph to MATLAB
Published
September 05, 2025
Volume 10, Issue 113, Page 8622
Authors
David R. Connell ORCID
Independent Researcher, United States
Editor
Daniel S. Katz ORCID
Tags
matlab graph algorithms

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Connell
  given-names: David R.
  orcid: "https://orcid.org/0000-0002-4841-6756"
doi: 10.5281/zenodo.17064969
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Connell
    given-names: David R.
    orcid: "https://orcid.org/0000-0002-4841-6756"
  date-published: 2025-09-05
  doi: 10.21105/joss.08622
  issn: 2475-9066
  issue: 113
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 8622
  title: "matlab-igraph: bringing igraph to MATLAB"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.08622"
  volume: 10
title: "matlab-igraph: bringing igraph to MATLAB"

GitHub Events

Total
  • Create event: 6
  • Release event: 3
  • Issues event: 10
  • Delete event: 5
  • Issue comment event: 30
  • Push event: 40
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Pull request event: 2
Last Year
  • Create event: 6
  • Release event: 3
  • Issues event: 10
  • Delete event: 5
  • Issue comment event: 30
  • Push event: 40
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Pull request event: 2

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 10
  • Total pull requests: 1
  • Average time to close issues: 19 days
  • Average time to close pull requests: about 6 hours
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 4.1
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 1
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 6 hours
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 5.71
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • platipodium (5)
  • DavidRConnell (3)
  • szhorvat (1)
  • gartavanis (1)
Pull Request Authors
  • danielskatz (1)
Top Labels
Issue Labels
Pull Request Labels