Question

Suppose a database schedule SS involves transactions T1,…,TnT_1, \dots, T_n. Construct the precedence graph of SS with vertices representing the transactions and edges representing the conflicts. If SS is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2016 answer key

Solution

Relate conflict serializability of a database schedule to the topological sort of its precedence graph.

The precedence graph (or serialization graph) for a schedule SS is a directed graph G=(V,E)G = (V, E) where:

  • The vertices VV represent the committed transactions {T1,…,Tn}\{T_1, \dots, T_n\}.
  • A directed edge Ti→TjT_i \to T_j exists if there is a conflict operation in TiT_i that precedes a conflicting operation in TjT_j.

By the Conflict Serializability Theorem, schedule SS is conflict serializable if and only if its precedence graph GG is acyclic (a DAG).

A topological sort of a DAG produces a linear ordering of its vertices such that for every directed edge (u,v)(u, v), vertex uu comes before vertex vv in the ordering.

Executing the transactions sequentially in topological order preserves the order of all conflicting operations in SS, thereby yielding an equivalent serial schedule.

Therefore, a Topological order is guaranteed to yield a valid serial schedule (option A).

Final answer

A

Common trap

Choosing ascending index order, which is completely arbitrary and ignores the conflict edges.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 2
Question
32 of 65, printed as CS Q.22
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.