bcds.phison.clustering
Class NoackLinLog<V,E>

java.lang.Object
  extended by bcds.phison.clustering.ClustererBase<V,E>
      extended by bcds.phison.clustering.NoackLinLog<V,E>
All Implemented Interfaces:
Clusterer<V,E>, WithEnvParams

public class NoackLinLog<V,E>
extends ClustererBase<V,E>
implements Clusterer<V,E>

NoackLinLog is a wrapper on Andreas Noack's LinLogLayout. It uses the "edge cost" as the measure of interchange between nodes. The node's weight is the sum of the weights of its outgoing edges.

To use this class, the LinLogLayout Java library must be available. It is downloadable from http://code.google.com/p/linloglayout/. Its licence is LGPL.

Note that in Noack's implementation there is no easy way to extract the "convergence" of energy or the "modularity" obtained. To compensate that, this wrapper can enable displaying the debugging messages that Noack's implementation sends to System.out.

This wrapper pays little to no attention to the laying out of the resulting graph. Thus, the node position generated by LinLogLayout is inaccessible to the caller.

When visually displaying the results, remember that the node position is random (two different runs will produce the same clustering but different node positions).

Author:
Juan Segovia S.

Constructor Summary
NoackLinLog()
          Default constructor.
NoackLinLog(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost)
          Creates a new instance, assuming a null environment.
 
Method Summary
 java.lang.Object[] getEnvParams()
          Returns the environment parameter used by LingLogCluster.
 java.util.Map<V,java.lang.Integer> run()
          Calls run(int) with the number of iterations set to the value of the environment parameter NoackLinLog.iterations.
 java.util.Map<V,java.lang.Integer> run(int niter)
          Groups nodes in clusters through org.noak.graphlayout.MinimizerBarnesHut and returns the corresponding node-to-cluster mapping.
 void setup(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost, Environ env)
          Initializes this object.
 
Methods inherited from class bcds.phison.clustering.ClustererBase
dump, getEnviron, getName, getNodeMapping, groupByClusterId, setNodeMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.phison.clustering.Clusterer
getNodeMapping, groupByClusterId, setNodeMapping
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getName
 

Constructor Detail

NoackLinLog

public NoackLinLog()
Default constructor.


NoackLinLog

public NoackLinLog(SimGraph<V,E> g,
                   java.util.Map<E,? extends java.lang.Number> edge_cost)
Creates a new instance, assuming a null environment.

Method Detail

setup

public void setup(SimGraph<V,E> g,
                  java.util.Map<E,? extends java.lang.Number> edge_cost,
                  Environ env)
Initializes this object.

Specified by:
setup in interface Clusterer<V,E>
Overrides:
setup in class ClustererBase<V,E>

run

public java.util.Map<V,java.lang.Integer> run()
Calls run(int) with the number of iterations set to the value of the environment parameter NoackLinLog.iterations.

Specified by:
run in interface Clusterer<V,E>

run

public java.util.Map<V,java.lang.Integer> run(int niter)
Groups nodes in clusters through org.noak.graphlayout.MinimizerBarnesHut and returns the corresponding node-to-cluster mapping. MinimizerBarnesHut is run with the following parameters: These are the same values used in the author's LinLogLayout.java, and there is no way to change them here (they are fixed in in the source).

The number of iterations is specified by niter.


getEnvParams

public java.lang.Object[] getEnvParams()
Returns the environment parameter used by LingLogCluster. Their names, default values and purpose are as follows (the name prefix is NoackLinLog.):

Specified by:
getEnvParams in interface WithEnvParams
Overrides:
getEnvParams in class ClustererBase<V,E>