either an adjacency matrix of a graph or a Markov transition matrix
the strength of expansion
the strength of inflation
Add self-loops by setting the main diagonal to the weight parameter.
Add self-loops by setting the main diagonal to the weight parameter.
the edge weight on self-loops to be added.
This clustering method is not applicable to graph clustering.
This clustering method is not applicable to graph clustering.
unused parameter
Cluster the nodes in the graph by interpreting the processed matrix t.
Cluster the nodes in the graph by interpreting the processed matrix t. Nodes not clustered will be in group 0; otherwise, they will be grouped with their strongest positive attractor.
Expansion tends to grow clusters (flow along path in graph).
Expansion tends to grow clusters (flow along path in graph). Expand by raising the matrix t to the k-th power.
Show the flaw by printing the error message.
Show the flaw by printing the error message.
the method where the error occurred
the error message
Get the name of the i-th cluster.
Get the name of the i-th cluster.
Inflation tends to strenthen strong connections and weaken weak ones.
Inflation tends to strenthen strong connections and weaken weak ones. Inflate by raising each cell to the r-th power and normalize column-by-column. If a cell is close to zero, set it to zero (prune). Also, detect convergence by making sure that the variance in each column is small enough.
Set the names for the clusters.
Normalize the matrix t so that each column sums to 1, i.e.0, convert the adjacency matrix of a graph into a Markov transition matrix.
Return the processed matrix t.
Return the processed matrix t. The matrix is processed by repeated steps of expansion and inflation until convergence is detected.
The
MarkovClustering
class implements a Markov Clustering Algorithm (MCL) and is used to cluster nodes in a graph. The graph is represented as an edge-weighted adjacency matrix (a non-zero cell indicates nodes i and j are connected).The primary constructor takes either a graph (adjacency matrix) or a Markov transition matrix as input. If a graph is passed in, the normalize method must be called to convert it into a Markov transition matrix. Before normalizing, it may be helpful to add self loops to the graph. The matrix (graph or transition) may be either dense or sparse. See the MarkovClusteringTest object at the bottom of the file for examples.