Title: IGraph/M: a Mathematica interface for igraph
Date: 2016-05-03 20:00
Tags: mathematica, networks
Description: IGraph/M is a package that integrates the igraph network analysis library with Mathematica.
IGraph/M is a [Mathematica](http://www.wolfram.com/) package for use in complex networks and graph theory research. It started out as a well-integrated Mathematica interface to [igraph](http://igraph.org/), one of the most popular open source network analysis packages available. In addition to exposing igraph functionality to Mathematica, the current version of IGraph/M contains many other functions for working with graphs.
IGraph/M is a bit different from the official igraph interfaces (for C, Python and R). Mathematica already has extensive graph theory and network analysis functionality, and IGraph/M does not aim to replace this. Instead it is meant to complement it and integrate with it, so functions from both systems can be used seamlessly together. It also provides many functions that are not present in the core igraph library. Thus it works directly with Mathematica's [`Graph`](http://reference.wolfram.com/language/ref/Graph.html) datatype. Trivial functionality that is already present in Mathematica, such as adding or removing edges, converting to/from an adjacency matrix, etc., is not exposed. The focus is on functionality that is not already present in Mathematica, and functionality that complements Mathematica's builtins in a meaningful way.
IGraph/M comes pre-packaged and ready to use on Windows, OS X and Linux (64-bit Intel), as well as the [Raspberry Pi computer](https://www.raspberrypi.org/). The code is open source and can be compiled on other platforms as well (such as 32-bit Windows).
***[A PDF version of the documentation notebook (20 MB)][1] is available for preview purposes.***
**To be notified of new releases, or to discuss IGraph/M, join [the Gitter chatroom](https://gitter.im/IGraphM/Lobby)!**
### Installation
The simplest way to automatically download and install the latest release of IGraph/M is to evaluate the following line in _Mathematica_:
:::mma
Get["https://raw.githubusercontent.com/szhorvat/IGraphM/master/IGInstaller.m"]
To install IGraph/M manually, or to install a different version than the latest one, download the `.paclet` file from [the GitHub releases page](https://github.com/szhorvat/IGraphM/releases), and install it using the `PacletInstall` Mathematica function. For example, if `IGraphM-0.3.107.paclet` was downloaded into the directory `~/Downloads`, then evaluate
:::mma
Needs["PacletManager`"]
PacletInstall["~/Downloads/IGraphM-0.3.107.paclet"]
If the `.paclet` file was downloaded to a different location, adjust the path above accordingly.
It is not necessary to uninstall old versions before installing a new one.
A more detailed guide for installing packages distributed in the paclet format is available [on StackExchange](http://mathematica.stackexchange.com/q/141887/12).
Once installed, test that it works with a few simple commands:
:::mma
< Directive[Thick, Opacity[1]], VertexStyle -> Black
] // IGEdgeMap[ColorData[109], EdgeStyle -> IGEdgeColoring]
### Usage and documentation
To get started, load the package with
:::mma
< `IGCommunitiesEdgeBetweenness[graph]` finds communities using the Girvan–Newman algorithm.
For a more detailed description, look up the function in the documentation notebook (`IGDocumentation[]`). Mathematica-specific details are usually described here.
For an even more detailed description of the functionality, or to learn about the implementation of various functions, check the official [C/igraph documentation](http://igraph.org/c/doc/igraph-Community.html#igraph_community_edge_betweenness). It usually includes references to the papers describing the implemented algorithms.
All IGraph/M function names start with the prefix `IG`, and related functions use a consistent naming. For example, all community detection functions are named as `IGCommunities...`
:::mma
?IGCommunities*
All graph layout functions are named as `IGLayout...`, all random graph generators are called `IG...Game`, etc.
### Feature highlights
As of IGraph/M 0.4 beta, not all of the igraph functionality is exposed. [Contributions are welcome](https://github.com/szhorvat/IGraphM/blob/master/Development.md), and feature requests are accepted ([just open a new issue](https://github.com/szhorvat/IGraphM/issues)).
- Interruption support: using Evaluate → Abort Evaluation in Mathematica works with most IGraph/M functions.
- Network analysis
- *Weighted* centrality measures; fast centrality estimation in large graphs; centralization.
- Community detection algorithms.
- Count graph motifs (3- and 4-motifs); find triangles.
- Randomly rewire graphs while keeping their density or degree sequence.
- Many random graph models (including uniform random tree and random spanning tree sampling).
- Fast shortest path finding and histogramming (weighted and unweighted).
- Additional layout algorithms: most work with weighted graphs and can continue the layout optimization starting from a given set of vertex positions.
- Random walks on graphs.
- Many other functions ...
- Graph theory
- Many graph generators.
- Isomorphism
- Several algorithms: Bliss, VF and LAD; faster than the builtin for hard problems.
- Multigraph isomorphism.
- Isomorphism of simple graphs with coloured vertices and edges.
- Subgraph isomorphism, including induced subgraphs with LAD.
- Homeomorphism.
- Vertex and edge colouring, including minimum colouring and computation of the chromatic number; Mycielski construction.
- Planar graphs and combinatorial embeddings.
- Minimum feedback arc set (weighted and unweighted).
- Degree sequences: check graphicality; realize degree sequences (optionally as a connected graph); multiple methods for random sampling with given degree sequence; rewire while keeping degre sequence.
- Find all cliques (not just maximal ones); count cliques of different sizes without storing them; work with weighted cliques.
- Biconnected components, articulation points, bridges, find all minimum vertex cuts.
- Replacement for much of the Combinatorica functionality not yet available as Mathematica built-ins.
- Geometrical computation
- Convert between geometric meshes and graphs
- Proximity graphs (Delaunay graph, Gabriel graph, β-skeleton, etc.)
- Utility functions for working with graphs in Mathematica:
- Quick and easy graph styling based on computed properties.
- Property handling and transformations, also useful for quick visualization.
- Bipartite incidence matrices.
- Fast functions for handling weighted graphs.
- Adjacency matrix visualization.
- Many other specialized functions not mentioned here ...
The documentation contains many examples and can be accessed using the `IGDocumentation[]` command.
Changes in recent versions are listed [on IGraph/M's GitHub page](https://github.com/szhorvat/IGraphM#revision-history).
### Feedback, bugs and troubleshooting
If you find a problem with the package, first check [the Troubleshooting section of the README](https://github.com/szhorvat/IGraphM/blob/master/README.md#troubleshooting) file on GitHub. If the information there does not help resolve the problem, you can [ask in the chatroom](https://gitter.im/IGraphM/Lobby), email me, or open a new issue in the bug [tracker](https://github.com/szhorvat/IGraphM/issues). Be sure to include the output of ``IGraphM`Developer`GetInfo[]`` in your report.
For any other type of feedback, just send an email. Remember that the project is open to [contributions](https://github.com/szhorvat/IGraphM/blob/master/Development.md)!
### Uninstalling
To remove all traces of IGraph/M from your system, evaluate the following in _Mathematica_:
Needs["PacletManager`"]
PacletUninstall["IGraphM"]
### Contributions
IGraph/M is currently looking for contributors. Mathematica users of all levels of expertise can contribute. Help is most needed with editing the documentation and writing simple tests that will be used in automated testing. Of course, contributing new functionality is also very welcome. If you are interested in helping with any of these tasks, please send me an email.
[1]: {static}/files/IGDocumentation.pdf