Skip to content

Commit

Permalink
fix info
Browse files Browse the repository at this point in the history
  • Loading branch information
koteth committed Sep 16, 2014
1 parent efc8df2 commit 255ae74
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 38 deletions.
78 changes: 42 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# MCL Clustering
# MCL algorithm

This module implements the Markov Cluster algorithm created by Stijn van Dongen and
described in http://www.library.uu.nl/digiarchief/dip/diss/1895620/inhoud.htm.

Python implementation of Markov Clustering technique.
This implementation si not yet optimized for large networks.

## Installation:

python setup.py install
python setup.py install

##Usage:

###Command line:

Usage: ./mcl_clustering.py [options] <input_file> <output_file>

Usage: mcl_clustering.py [options] <input_matrix>

Options:
-h, --help show this help message and exit
Expand All @@ -21,49 +22,55 @@ This implementation si not yet optimized for large networks.
-i INFLATE_FACTOR, --inflate_factor=INFLATE_FACTOR
inflate factor (default: 2)
-m MULT_FACTOR, --mult_factor=MULT_FACTOR
multiply factor (default: 1)
multiply factor (default: 2)
-l MAX_LOOP, --max_loops=MAX_LOOP
max loops (default: 60)
-o FILE, --output=FILE
output (default: stdout)
-v, --verbose verbose (default: True)
-d, --draw-graph show graph with networkx (default: False)


The input matrix must be as comma separated value file representing the
adjacency matrix.

An example is the file example.csv.
try mcl_clustering.py -e 3 example.csv


###Code:

numpy adjacency matrix

from mcl_clustering import mcl

A = <your matrix>
####Using numpy adjacency matrix

M, clusters = mcl(A, expand_factor = options.expand_factor,
inflate_factor = options.inflate_factor,
max_loop = options.max_loop,
mult_factor = options.mult_factor)
from mcl_clustering import mcl

networkx graph
A = <your matrix>

from mcl_clustering import networkx_mcl
M, clusters = mcl(A, expand_factor = options.expand_factor,
inflate_factor = options.inflate_factor,
max_loop = options.max_loop,
mult_factor = options.mult_factor)

G = <your graph>

M, clusters = networkx_mcl(G, expand_factor = options.expand_factor,
inflate_factor = options.inflate_factor,
max_loop = options.max_loop,
mult_factor = options.mult_factor)
Output:
M = otuput matrix
clusters = dict with keys = [<cluster id>] values = [<vertex id>]
####Using a networkx graph

##Requirements

numpy
networkx
from mcl_clustering import networkx_mcl

G = <your graph>

##Example:
M, clusters = networkx_mcl(G, expand_factor = options.expand_factor,
inflate_factor = options.inflate_factor,
max_loop = options.max_loop,
mult_factor = options.mult_factor)


Output:
M = otuput matrix
clusters = dict with keys = [<cluster id>] values = [<vertex id>]

##Requirements

numpy
networkx


##Parameters:
Expand All @@ -75,14 +82,13 @@ This implementation si not yet optimized for large networks.
-s --show-graph show graph with networkx



## References

Stijn van Dongen, Graph Clustering by Flow Simulation.
[1] Stijn van Dongen, Graph Clustering by Flow Simulation.
PhD thesis, University of Utrecht, May 2000.
( http://www.library.uu.nl/digiarchief/dip/diss/1895620/inhoud.htm )

Stijn van Dongen. A cluster algorithm for graphs. Technical Report
[2] Stijn van Dongen. A cluster algorithm for graphs. Technical Report
INS-R0010, National Research Institute for Mathematics and Computer
Science in the Netherlands, Amsterdam, May 2000.
( http://www.cwi.nl/ftp/CWIreports/INS/INS-R0010.ps.Z )
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
author='koteth',
install_requires = ['numpy', 'networkx'],
keywords = "MCL markov clustering graph",
author_email='[email protected]',
author='Gabriele Lami',
packages=['mcl'],
)
)

0 comments on commit 255ae74

Please sign in to comment.