Skip to main content
QUICK REVIEW

[Paper Review] Nested Intervals with Farey Fractions

Vadim Tropashko|ArXiv.org|Jan 18, 2004
Advanced Database Systems and QueriesComputer Science7 citations
TL;DR

This paper proposes a scalable nested intervals model for representing trees in relational databases using Farey fractions, overcoming the exponential growth issue of binary rational encoding. By leveraging the density and ordering properties of Farey sequences, the method efficiently encodes tree structures and demonstrates linear scalability up to 1 million nodes.

ABSTRACT

Relational Databases are universally conceived as an advance over their predecessors Network and Hierarchical models. Superior in every querying respect, they turned out to be surprisingly incomplete when modeling transitive dependencies. Almost every couple of months a question how to model a tree in the database surfaces at comp.database.theory newsgroup. This article completes a series of articles exploring Nested Intervals Model. Previous articles introduced tree encoding with Binary Rational Numbers. However, binary encoding grows exponentially, both in breadth and in depth. In this article, we'll leverage Farey fractions in order to overcome this problem. We'll also demonstrate that our implementation scales to a tree with 1M nodes.

Motivation & Objective

  • To address the limitations of binary rational encoding in nested intervals models, which grow exponentially in depth and breadth.
  • To explore alternative number systems that maintain the benefits of nested intervals while improving space and performance efficiency.
  • To develop a tree encoding method that scales efficiently to large databases, such as those with 1 million nodes.
  • To demonstrate that Farey fractions provide a more compact and efficient representation than binary rationals for nested intervals.

Proposed method

  • The method uses Farey sequences to generate rational numbers that maintain the nested interval property for tree nodes.
  • Each node is assigned a unique Farey fraction based on its position in the tree, ensuring parent-child relationships are preserved through interval containment.
  • The algorithm traverses the tree in in-order, assigning Farey fractions using mediant insertion to maintain ordering and density.
  • The encoding ensures that descendants of a node are represented by subintervals within the interval of the parent.
  • The approach avoids exponential growth by using the dense, ordered structure of Farey fractions instead of binary fractions.
  • The implementation is validated through performance benchmarks on a 1M-node tree, confirming linear scalability.

Experimental results

Research questions

  • RQ1Can Farey fractions be used to represent nested intervals in a way that avoids the exponential growth seen in binary rational encoding?
  • RQ2How does the use of Farey fractions improve the scalability of nested intervals for large tree structures?
  • RQ3What is the performance and space efficiency of the Farey-based encoding compared to binary rational encoding?
  • RQ4Can the Farey-based method maintain correct parent-child relationships and interval containment in large-scale tree representations?

Key findings

  • The Farey fraction-based nested intervals model successfully avoids the exponential growth problem inherent in binary rational encoding.
  • The method scales linearly to trees with up to 1 million nodes, demonstrating practical feasibility for large databases.
  • The use of Farey sequences ensures dense, ordered rational number assignments that preserve interval containment for parent-child relationships.
  • The encoding maintains efficient querying capabilities similar to binary rational methods but with significantly improved space efficiency.
  • Performance benchmarks confirm that the Farey-based approach is viable for real-world database applications involving large hierarchical data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.