Welcome to NetworkX-METIS’s documentation!

Contents:

Overview

NetworkX-METIS is an add-on for the NetworkX python package using METIS for graph partitioning.

NetworkX is a Python package for the creation, manipulation and study of the structure, dynamics, and functions of complex networkx. METIS 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.

Free software

NetworkX-METIS is free software; you can redistribute it and/or modify it under the terms of the :doc:`Apache License </reference/legal>`_. We welcome contributions from the community. Information on NetworkX development is found at the NetworkX Developer Zone at Github https://github.com/networkx/networkx-metis

History

NetworkX-METIS was born in 2014. The original version of the wrapper was designed and written by Yingchong Situ. The first public release as an add-on for NetworkX was made after a Google Summer of Code 2015 project, Implementing Add-on system of NetworkX.

Download

Software

Source and binary releases: https://pypi.python.org/pypi/networkx-metis/

Github (latest development): https://github.com/networkx/networkx-metis/

Installing

Before installing NetworkX-METIS, you need to have setuptools , Cython and NetworkX installed.

Quick install

Get NetworkX-METIS from the Python Package Index at http://pypi.python.org/pypi/networkx-metis

or install it with

pip install networkx-metis

and an attempt will be made to find and install an appropriate version that matches your operating system and Python version.

You can install the development version (at github.com) with manully checking out

https://github.com/networkx/networkx-metis

Installing from source

You can install from source by downloading a source archive file (tar.gz or zip) or by checking out the source files from the git source code repository.

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.

Source archive file

  1. Download the source (tar.gz or zip file) from https://pypi.python.org/pypi/networkx-metis/ or get the latest development version from https://github.com/networkx/networkx-metis/

  2. Unpack and change directory to the source directory (it should have the setup.py on top level).

  3. Run

    python setup.py build
    

    to build, and

    python setup.py install
    

    to install.

  4. (Optional) Run nosetests to execute the tests if you have nose installed.

GitHub

  1. Clone the networkx-metis repostitory

    git clone https://github.com/networkx/networkx-metis.git
    
  1. Change directory to networkx-metis

  2. Run

    python setup.py build
    

    to build, and

    python setup.py install
    

    to install.

  3. (Optional) Run nosetests to execute the tests if you have nose installed.

If you don’t have permission to install software on your system, you can install into another directory using the --user, --prefix, or --home flags to setup.py.

For example

python setup.py install --prefix=/home/username/python

or

python setup.py install --home=~

or

python setup.py install --user

If you didn’t install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. See http://docs.python.org/2/install/index.html#search-path for further details.

Requirements

Python

To use NetworkX-METIS you need Python 2.7, 3.2 or later.

NetworkX

To use NetworkX-METIS you need NetworkX 2.0 or later installed.

Cython

For NetworkX-METIS to work, you need Cython installed.

The easiest way to get Python and most optional packages is to install the Enthought Python distribution “Canopy”.

There are several other distributions that contain the key packages you need for scientific computing. See http://scipy.org/install.html for a list.

Reference

Contents:

METIS Wrapper

METIS

Wrappers of METIS graph partitioning functions.

node_nested_dissection(G[, weight, options]) Compute a node ordering of a graph that reduces fill when the Laplacian matrix of the graph is LU factorized.
partition(G, nparts[, node_weight, ...]) Partition a graph using multilevel recursive bisection or multilevel multiway partitioning.
vertex_separator(G[, weight, options]) Compute a vertex separator that bisects a graph.

Enums

MetisPType Partitioning method.
MetisObjType Type of objective.
MetisCType Catching scheme to be used during coarsening.
MetisIPType Algorithm used during initial partitioning.
MetisRType Algorithm used for refinement.
MetisNumbering Numbering scheme is used for the adjacency structure of a graph or the element-node structure of a mesh.
MetisDbgLvl Amount of progress/debugging information will be printed during the execution of the algorithms.

Types

MetisOptions(**kwargs) Options controlling behaviors of METIS algorithms.

Bibliography

[Langtangen04]H.P. Langtangen, “Python Scripting for Computational Science.”, Springer Verlag Series in Computational Science and Engineering, 2004.
[Martelli03]A. Martelli, “Python in a Nutshell”, O’Reilly Media Inc, 2003.

Indices and tables