Suppose a database schedule involves transactions . Construct the precedence graph of with vertices representing the transactions and edges representing the conflicts. If is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
View worked solution
Answer: A
A schedule is conflict-serializable if and only if its precedence graph (also known as the serialization graph) is acyclic (i.e., a Directed Acyclic Graph or DAG).
In the precedence graph:
- Vertices represent the transactions .
- A directed edge exists if there is a conflict between an operation in and a subsequent operation in , meaning must execute before in any equivalent serial schedule.
For any DAG, a topological sort produces a linear ordering of its vertices such that for every directed edge , vertex appears before in the ordering. Therefore, the topological order of the precedence graph is guaranteed to yield a conflict-equivalent serial schedule.
Why the other options are incorrect:
- Depth-first order (B) and Breadth-first order (C): These are graph traversal strategies. The order in which they visit vertices depends on the starting node and the graph structure, and they do not guarantee that for every edge , is output before .
- Ascending order of transaction indices (D): The transaction indices (like ) are arbitrary labels and do not reflect the actual conflict dependencies of the schedule.
Free practice · Your answers on this page are not saved.
