Skip to content
Merging of set-containing Intervals Efficiently with a Directed-graph Algorithm
Jupyter Notebook Scilab Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples tweaks and code cleanup Dec 3, 2019
mieda tweaks and code cleanup Dec 3, 2019
notebooks tweaks and code cleanup Dec 3, 2019
tests tweaks and code cleanup Dec 3, 2019
license.txt initial commit Nov 18, 2019


Merging of Set-Containing Intervals Efficiently with a Directed-Graph Algorithm

License PyPi Build Status Coverage Status

MIEDA can be used to merge overlapping intervals, dependent on the intersection of sets contained within the intervals themselves. MIEDA utilizes a directed-graph algorithm for merging the intervals rapidly and with scalability.



  • Python 3.5 - 3.8
  • NetworkX >= 2.4.0

How To

First install the package locally:

pip install mieda # or pip3 install ... if you're using both Python 3 and 2.

To merge intervals containing sets, pass a list of dictionaries as shown in the below example:

import datetime
from mieda.intervals import Merge

intervals = [
    {"start": datetime.datetime(2020, 1, 1, 1, 0, 0), "finish": datetime.datetime(2020, 1, 4, 1, 0, 0),
     "set_items": {"1"}},
    {"start": datetime.datetime(2020, 1, 1, 1, 0, 0), "finish": datetime.datetime(2020, 1, 3, 1, 0, 0),
     "set_items": {"2"}}



If you would like to contribute, please fork the repository and make any changes locally prior to submitting a pull request. Feel free to open an issue if you notice any erroneous behavior.


Semantic versioning is used for this project. If contributing, please conform to semantic versioning guidelines when submitting a pull request.


This project is licensed under the Apache 2.0 license.


If citing mieda in your research, please use the following:

  doi = {},
  url = {},
  year  = {},
  month = {},
  publisher = {},
  volume = {},
  number = {},
  pages = {},
  author = {Valentino Constantinou, Asitang Mishra},
  title = {},
  journal = {}


Tests are contained within the tests directory. To run tests for MIEDA, call pytest and pytest-cov via the command line:

python3 -m pytest --cov=mieda -vv

Setting up a virtual environment for testing and development is recommended.

You can’t perform that action at this time.