Multiple choice

Suppose the adjacency relation of vertices in a graph is represented in a table Adj (X,Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length?

  1. List all vertices adjacent to a given vertex.

  2. List all vertices which have self loops.

  3. List all vertices which belong to cycles of less than three vertices.

  4. List all vertices reachable from a given vertex.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The database contains the adjacency list of the graph. So relation algebra will face problems while calculating the length of cycle. The query would execute in one tuple only.