26 26 votes Let $\textit{R}_{i}(z)$ and $\textit{W}_{i}(z)$ denote read and write operations on a data element $z$ by a transaction $\textit{T}_{i},$ respectively. Consider the schedule $\textit{S}$ with four transactions. $S: \; R_{4}(x) R_{2}(x) R_{3}(x)R_{1}(y) W_{1}(y) W_{2}(x) W_{3}(y) R_{4}(y)$ Which one of the following serial schedules is conflict equivalent to $\textit{S}?$ $T_{1} \rightarrow T_{3} \rightarrow T_{4} \rightarrow T_{2}$ $T_{1} \rightarrow T_{4} \rightarrow T_{3} \rightarrow T_{2}$ $T_{4} \rightarrow T_{1} \rightarrow T_{3} \rightarrow T_{2}$ $T_{3} \rightarrow T_{1} \rightarrow T_{4} \rightarrow T_{2}$ Databases gatecse-2022 databases transaction-and-concurrency conflict-serializable two-marks + – Arjun 18.9k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments Raj_Dev_Verma commented Aug 14 reply Follow flag option A is correct 0 0 replyShare Jayvijay Chauhan commented Sep 17 reply Follow flag follow this simple step !! and find topological order of graph 0 0 replyShare legend_of_cse commented Sep 23 reply Follow flag Note : A schedule $S$ is conflict serializable if and only if its precedence graph $G(S)$ contains no directed cycles.Every valid Topological Sort of the Precedence Graph $G(S)$ corresponds to a unique conflict-equivalent serial schedule.Any transaction $T_k$ with an in-degree of 0 can be chosen as the first transaction in the serial execution order.Recursive formula : $\text{TopologicalSorts}(G) =\sum_{v \in V \text{ where } \text{in-degree}(v) = 0} \text{TopologicalSorts}(G \setminus \{v\})$ , Base Case: $\text{TopologicalSorts}(\emptyset) = 1$.$$\text{Number of Conflict-Equivalent Serial Schedules} = \text{Total Topological Sorts of } G(S)$$For Finding Topological Sort use Kahn's Algorithms Maintain an indegree array for all vertices.Find all vertices with indegree == 0.Pick one such vertex, add it to the path, decrement the indegree of its outgoing neighbors, and recurse.Backtrack by restoring the indegree state. 0 0 replyShare Please log in or register to add a comment.
Best answer 25 25 votes Answer : Option A Conflict operations: Transaction $T_i$ reading data item K, after that Transaction $T_j$ writing data item K Transaction $T_i$ writing data item K, after that Transaction $T_j$ reading data item K Transaction $T_i$ writing data item K, after that Transaction $T_j$ writing data item K. Note that, Transaction $T_i$ writing data item ‘K’, after that Transaction $T_j$ writing data item ‘P’ are not conflict operations due to those are different data items. Tabular representation of given schedule is : If you observe, Line 1 and Line 6 are conflict operations. So in Serial schedule Transaction $T_4$ must be before $T_2$ Line 3 and Line 6 are conflict operations. So in Serial schedule Transaction $T_3$ must be before $T_2$ Line 4 and Line 7 are conflict operations. So in Serial schedule Transaction $T_1$ must be before $T_3$ Line 5 and Line 8 are conflict operations. So in Serial schedule Transaction $T_1$ must be before $T_4$ Line 7 and Line 8 are conflict operations. So in Serial schedule Transaction $T_3$ must be before $T_4$ Accumulating all these points and running Topological sort, $T_1$ should be first followed by $T_3,T_4$ and $T_2$ in order. Shaik Masthan answered Feb 15, 2022 • selected Apr 16, 2022 by Arjun Shaik Masthan comment Share Follow See all 7 Comments 7 7 Comments reply Show 4 previous comments Satoshi Nakamoto commented Oct 16, 2025 reply Follow flag doubt clrs 2 2 replyShare Yash_Pachkhede commented Aug 23 reply Follow flag I didn't get why T1 , T4, T3, T2 is not possible can anyone please tell me like how can we conclude that T3 will come before T4 by line 7 and 8 their is no direct connection. 0 0 replyShare Shaik Masthan commented Aug 24 reply Follow flag In line 7, T3 writing Y and in line 8, T4 reading that value. If T4 comes prior to T3, that will not read the Y value wrote by T3 anymore. 0 0 replyShare Please log in or register to add a comment.
30 30 votes Precedence graph from the schedule : Argharupa Adhikary answered Apr 20, 2022 Argharupa Adhikary comment Share Follow See all 5 Comments 5 5 Comments reply Show 2 previous comments Shashwat Pandey commented Aug 11, 2022 reply Follow flag T1,T3,T2,T4 is also possible 1 1 replyShare ani0135 commented Oct 1, 2022 reply Follow flag @Shashwat Pandey T1, T3, T2, T4 topological order not possible because in finding for topological order from precedence graph, when T3 deleted after T1, in-order of T4 is 0 but T2 in-order is non-zero, so T4 will be deleted first then T2. 2 2 replyShare Abhrajyoti00 commented Oct 8, 2022 reply Follow flag @Shashwat Pandey No. T2 is depending upon T4. Hence T4 must be completed before T2.Correct ordering is only Option A $T1->T3->T4->T2$. 1 1 replyShare Please log in or register to add a comment.
1 1 vote Option A T1−>T3−>T4−>T2 Loser_27 answered Sep 23 Loser_27 comment Share Follow 0 reply Please log in or register to add a comment.