This repository contains a Rust implementation of the FLOP causal discovery algorithm available from Python and R.
In Python, flopsearch can be installed via pip:
pip install flopsearchIn R, flopsearch can be installed directly from Github:
install.packages("https://github.com/CausalDisco/flopsearch/releases/download/v0.1.2/flopsearch.tar.gz")This requires a working installation of the Rust toolchain.
The name of the installed package is flopsearch and it can be loaded with:
library(flopsearch)If you use FLOP in your scientific work, please cite this paper:
@article{cifly2025,
  author  = {Marcel Wien{"{o}}bst and Leonard Henckel and Sebastian Weichwald},
  title   = {{Embracing Discrete Search: A Reasonable Approach to Causal Structure Learning}},
  journal = {{arXiv preprint arXiv:2510.04970}},
  year    = {2025}
}In Python, as a simple example, FLOP can be called by
flopsearch.flop(X, 2.0, restarts=20)with X being the data matrix, 2.0 the BIC penalty parameter and the number of ILS restarts being set to 20.
Similary, in R, one can call:
flopsearch::flop(X, 2.0, restarts=20)Instead of the number of restarts, it is also possible to set a timeout in seconds after which the search terminates and returns the best-scoring graph found thus far.