FLAGR exposes a set of C functions through an extern "C" statement allowing their linkage from other C programs. These are the dynamic library references to which a client C code can link to. At first, FLAGR must be compiled as a shared/dynamic link library. Then, the client C program can link to that shared library and include a typical C header file that contains just the declaration of these functions. The called function is able to access the C++ FLAGR core through the Execution Driver. The following diagram depicts this scenario:

FLAGR Shared Library

The FLAGR architecture and the possibility of building it as a shared library allows its usage not only in 3rd party C programs, but also in programs written in other languages. PyFLAGR is an example of such case. PyFLAGR is a Python library that enables the execution of the algorithm C++ implementations of FLAGR from standard Python programs. The Python program must be able to successfully import the modules of PyFLAGR.

The exposed C functions of FLAGR exist in two files: cflagr.cpp and dllflagr.cpp. These files are almost identical: they contain the same functions with exactly the same arguments and bodies. What changes is the usage of several special keywords in the function declarations of dllflagr.cpp which enable the building of FLAGR as a DLL for Windows-based systems. These functions are:

  • void Linear(): It executes one of the supported linear combination methods (CombSUM and CombMNZ, each one with 5 variants).
  • void Condorcet(): It executes the Condorcet Winners method.
  • void Copeland(): It executes the Copeland Winners method.
  • void OutrankingApproach(): It executes the Outranking Approach of Farah and Vanderpooten, 2007.
  • void Kemeny(): It executes the optimal Kemeny aggregation algorithm (brute force implementation).
  • void RobustRA(): It executes the Robust Rank Aggregation (RRA) method of Kolde et al., 2012.
  • void DIBRA(): It executes the distance-based iterative rank aggregation method of Akritidis et al., 2022.
  • void PrefRel(): It executes the preference relations method of Desarkar et al., 2016.
  • void Agglomerative(): It executes the agglomerative rank aggregation method of Chatterjee et al., 2018.
  • void MC(): It executes the Markov Chain-based rank aggregation method of Dwork et al., 2001.