Skip to main content

MHT-X: offline multiple hypothesis tracking with algorithm X


An efficient and versatile implementation of offline multiple hypothesis tracking with Algorithm X for optimal association search was developed using Python. The code is intended for scientific applications that do not require online processing. Directed graph framework is used and multiple scans with progressively increasing time window width are used for edge construction for maximum likelihood trajectories. The current version of the code was developed for applications in multi-phase hydrodynamics, e.g., bubble and particle tracking, and is capable of resolving object motion, merges and splits. Feasible object associations and trajectory graph edge likelihoods are determined using weak mass and momentum conservation laws translated to statistical functions for object properties. The code is compatible with n-dimensional motion with arbitrarily many tracked object properties. This framework is easily extendable beyond the present application by replacing the currently used heuristics with ones more appropriate for the problem at hand. The code is open-source and will be continuously developed further.

Graphical abstract

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20

Data availability

Both input for and output of MHT-X, as well as associated visuals are available on demand – please contact the corresponding authors.

Code availability

The MHT-X code is open source and is currently available on GitHub: It is frequently updated and a comprehensive documentation is also currently in the works.


Download references


This research is a part of the ERDF project “Development of numerical modelling approaches to study complex multiphysical interactions in electromagnetic liquid metal technologies” (No. Neutron images were acquired at the Swiss spallation neutron source SINQ, Paul Scherrer Institute (PSI). The authors are grateful to Pavel Trtik (PSI), Jevgenijs Telicko (UL), Jan Hovind (PSI) and Knud Thomsen (PSI) for invaluable support in the neutron radiography experiments, and express gratitude to Natalia Shevchenko (HZDR) for her key role in the X-ray radiography experiments. The authors would like to acknowledge the user Watercrystal for pointing out that the association optimization problem can be treated as an exact cover problem. Her involvement, while in the form of a single comment, was crucial to the development of this algorithm:

Author information

Authors and Affiliations



Peteris Zvejnieks is the main developer of MHT-X and has written all parts of the Python implementation. Both Peteris Zvejnieks and Mihails Birjukovs contributed to algorithm and method development. Martins Klevs performed the bubble flow simulations and provided the data for analysis. Megumi Akashi processed the X-ray radiography images and provided the data for analysis. Neutron radiography images were processed by Mihails Birjukovs. Visualization was done by Peteris Zvejnieks and Mihails Birjukovs, both of whom also came up with the original manuscript draft. Sven Eckert and Andris Jakovics were responsible for funding acquisition and research supervision. All co-authors contributed to manuscript editing and review prior to submission.

Corresponding authors

Correspondence to Peteris Zvejnieks or Mihails Birjukovs.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Zvejnieks, P., Birjukovs, M., Klevs, M. et al. MHT-X: offline multiple hypothesis tracking with algorithm X. Exp Fluids 63, 55 (2022).

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: