GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 1.24

Reachability beyond fixed relational algebra

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2001 paper

GATE 2001, Q1.24 1 mark · MCQ
Report issue

Relational Algebra & Calculus

Question 1.24, GATE 2001: Given an adjacency relation Adj(X,Y), which query cannot be expressed by a fixed-length ordinary relational-algebra expression: neighbors of a vertex, vertices with self-loops, vertices in cycles with fewer than three vertices, or all vertices reachable from a vertex?
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: Adjacency and self-loops require selection/projection on Adj. A cycle of a fixed bounded length can be described by a fixed number of renamed joins and equality tests.

Step 2: Reachability permits paths of arbitrarily large length as the graph grows. Ordinary nonrecursive relational algebra has no transitive-closure operation; one fixed expression cannot supply an unbounded chain of joins.

Thus D cannot be expressed by a constant-length ordinary relational-algebra expression over all finite input graphs. Recursive query extensions or a fixed maximum graph size change that setting.

Original paper, page 3