https://github.com/networkx/networkx-metis
NetworkX Addon to allow graph partitioning with METIS
https://github.com/networkx/networkx-metis
Last synced: 8 months ago
JSON representation
NetworkX Addon to allow graph partitioning with METIS
- Host: GitHub
- URL: https://github.com/networkx/networkx-metis
- Owner: networkx
- License: other
- Archived: true
- Created: 2015-05-22T19:02:43.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-03-31T12:37:25.000Z (almost 3 years ago)
- Last Synced: 2025-04-20T06:26:27.663Z (9 months ago)
- Language: C
- Size: 265 KB
- Stars: 78
- Watchers: 17
- Forks: 21
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
### NOTE: NetworkX-METIS isn't maintained actively, there won't be any new releases anytime soon. Please open an issue if you are interested in helping with maintaining this project.
# NetworkX-METIS
[](https://travis-ci.org/networkx/networkx-metis)
[](https://landscape.io/github/networkx/networkx-metis/master)
[](https://networkx-metis.readthedocs.org/en/latest/)
* [What is NetworkX-METIS?](#what-is-networkx-metis)
* [Installation](#installation)
* [Contribute](#contribute-to-networkx-metis)
## What is NetworkX-METIS?
NetworkX-METIS is a NetworkX addon that enables graph partitioning with METIS.
[NetworkX](https://github.com/networkx/networkx) is a Python package for the creation,
manipulation and study of the structure, dynamics, and functions of complex networkx.
[METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) is a C library written for
partitioning graphs, partitioning finite element meshes, and producing
fill reducing orderings for sparse matrices. NetworkX-METIS uses Cython to wrap the
METIS library to make it available in Python.
Documentation of NetworkX-METIS is available at
[http://networkx-metis.readthedocs.org/en/latest](http://networkx-metis.readthedocs.org/en/latest).
## Installation
### Linux/Mac
#### Requirements
```sh
pip install Cython
```
#### Installation from PyPI
```sh
pip install networkx-metis
```
#### Installation from GitHub
```sh
git clone https://github.com/networkx/networkx-metis.git
cd networkx-metis
python setup.py install
```
### Windows
Installation on Windows is largely the same as on Linux/Mac except that no "platform compiler" is
pre-installed. So, an extra `--compiler` flag may be necessary to specify a compiler. A simple guide
for installing and setting up the compiler is available [here](https://github.com/cython/cython/wiki/CythonExtensionsOnWindows).
Here is an example:
```sh
git clone https://github.com/networkx/networkx-metis.git
cd networkx-metis
python setup.py build --compiler=msvc
python setup.py install
```
provided that Cython and NetworkX have been installed as described in above sections.
Example
-
```python
>>> import networkx as nx
>>> import nxmetis
>>> G = nx.complete_graph(10)
>>> nxmetis.partition(G, 2)
(25, [[0, 1, 2, 3, 6], [4, 5, 7, 8, 9]])
```
## Contribute to NetworkX-METIS
For a summary of all the coding guidelines and development workflow, please refer to the
[Developer Guide](https://networkx.readthedocs.org/en/latest/developer/index.html) of NetworkX.
- [Report Bugs and Issues](https://github.com/networkx/networkx-metis/issues)
- [Resolve Bugs and Issues](https://github.com/networkx/networkx-metis/issues?page=1&state=open)
- Write tutorials, examples and documentation