wiki:ModuleFunctionClustering

Version 1 (modified by bozo_i, 13 years ago) (diff)

draft

About clustering

The clustering algorithm sorts entities into groups, that are closely related from different point of view. The entities can be modules or functions and the relations between them are function calls and record usages. The created groups are called clusters.

Clustering in RefactorErl

Before using the clustering functionality of the tool, the source files have to be loaded to the database. The clustering algorithm will cluster all the modules and functions which are in the database. In the clustering options the user can choose the modules and functions that should be ignored during the clustering.

Types of clustering

There are two implemented clustering algorithms in RefactorErl:

  • Hierarchical algorithm (agglomerative)
  • Genetic algorithm

Agglomerative clustering

In the beginning, each entity forms a separate cluster. Then, in each step, the two closest clusters are selected and unified. This process continues until there is only one cluster. The intermediate states contain a possible clustering of the entities. The output of the algorithm is the list of these possible clusterings.

Genetic clustering

Genetic algorithms simulate the evolution of species. There are iterations of populations in which every entity figths for survival or for the survival of its genes. A fitness function is defined to determine the value of an entity. The fitter an entity is, the more likely it survives. The algorithm is expected to converge to the fittest possible entity, like evolution does.

Using the clustering functionality

The clustering functionality is available from Emacs and the console interface.

Parameters for agglomerative clustering

  • Modules to skip: list of modules that should be ignored in the clustering process
  • Functions to skip: list of functions that should be ignored in the clustering process
  • Transform function
  • Distance function
  • Antigravity
  • Merge function
    • smart

TODO

Parameters for genetic clustering

TODO