Coder Social home page Coder Social logo

most-inesctec / i2bplus-tree Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 539 KB

:evergreen_tree: Improved Interval B+ tree implementation, in TS :evergreen_tree:

Home Page: https://www.npmjs.com/package/i2bplustree

License: MIT License

Python 14.57% TypeScript 85.43%
tree valida-time-data temporal-data data-indexing indexing-structure b-plus-tree interval-tree logarithmic-complexity complexity i2b-tree

i2bplus-tree's Introduction

Improved Interval B+ tree implementation (I2B+ tree)

npm npm NPM

BCH compliance Build Status Coverage Status

The Interval B+ tree (IB+ tree) is a valid-time indexing structure, first introduced by Bozkaya and Ozsoyoglu. This indexing structure appears as a time-efficient indexing structure for the management of valid-time/ intervals.

In this repository, we present the Improved Interval B+ tree (I2B+ tree), an indexing structure based on the IB+ tree, but with minor structural changes to improve the performance of the deletion operation. For a more detailed analysis of the I2B+ tree, refer to the paper published in the CISTI'2020 Conference, available at IEEE.

This structure performs all operations (insertion, search and deletion) with logarithmic performance (O (log n)). Documentation is available here.

Insertion Range Search Deletion
I var dataset a0 3 RS var dataset a0 3 D var dataset a0 3

For an in-depth analysis of both the parameter tuning (such as the tree's order or the time-splits alpha value) and the conclusions obtained from the performance analysis of the I2B+ tree, check the benchmarks folder.

Usage

To suit the I2BplusTree to your needs, implement a class that extends the FlatInterval class, defining the information that will be stored on leaves there. One might also want to override the equals method, thus allowing the incorporation of the extra information stored in the Intervals in comparisons.

Example:

import { IBplusTree, FlatInterval } from 'i2bplustree';

// Create a class that inherits from the FlatInterval
class MyInterval extends FlatInterval {

    // This is just an example property
    // Like this there could be many more
    private myProperty: any;

    constructor(val1: number, val2: number, myPropertyValue: any) {
        super(val1, val2);
        this.myProperty = myPropertyValue;
    }

    // This is just an example method
    public exampleMethod(): void {
        // Do stuff
    }

    // Overriding equals method to take into account the new property
    equals(int: MyInterval): boolean {
        return this.upperBound == int.getUpperBound() &&
            this.lowerBound == int.getLowerBound() &&
            this.myProperty == int.getProperty();
    }
}

// Now we create our I2BplusTree object and insert a `MyInterval` object
const threshold = 30;
const alpha = 0.2;
const tree: IBplusTree<MyInterval> = new IBplusTree<MyInterval>(threshold, alpha);
// Introduce an object
tree.insert(new MyInterval(0, 2, "example-property"));

/**
And do many other operations such as:
- Delete an interval from the tree
- Delete all intervals contained in a range
- Verify if a interval exists in the tree
- Search all intervals with equal bounds to the ones provided
- Find the first interval that intersects the given bounds
- Find all intervals intersecting the given range
- Find all intervals contained in the given range
*/

Acknowledgements

This work was financed by the ERDF – European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciência e a Tecnologia within project PTDC/CCI-INF/32636/2017 (POCI-01-0145-FEDER-032636).

This work is also part of MOST.

Citation

E. Carneiro, A. V. d. Carvalho and M. A. Oliveira, "I2B+tree: Interval B+ tree variant towards fast indexing of time-dependent data," 2020 15th Iberian Conference on Information Systems and Technologies (CISTI), Sevilla, Spain, 2020, pp. 1-7, doi: 10.23919/CISTI49556.2020.9140897.

OR

Carneiro, Edgar, Alexandre Valle de Carvalho, and Marco Amaro Oliveira. "A Comparative Study on the Performance of the IB+ Tree and the I2B+ Tree." Journal of Information Systems Engineering and Management 6.3 (2021): em0142.

Acknowledgments

This work is financed by the ERDF – European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT – Fundação para a Ciência e a Tecnologia within project PTDC/CCI-INF/32636/2017 (POCI-01-0145-FEDER-032636).

i2bplus-tree's People

Contributors

alexandrevalle avatar alxhotel avatar dependabot[bot] avatar edgaracarneiro avatar piotr-oles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

i2bplus-tree's Issues

Fix `equals` method not allowing override

The current implementation does not allow the overriding of the FlatInterval.equals method since internally some FlatInterval objects are created to optimise data handling. As such, if one does override the equals method with the new properties, the search method brakes.

Possible solutions:

  • Stop creating FlatInterval objects inside the I2BplusTree and just use/ move around the valid times;
  • Create a new method (e.g. intervalEquals) that just makes the comparison of the intervals. Then, this method is used for comparison with the FlatInterval objects inside the tree, while the equals method is used for comparison between objects introduced by the user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.