Conflict serializability orders any conflicting operations in the same way as some serial execution. A pair of operations is said to conflict if they operate on the same data item and one of them is a write operation.
That means,
Readi(x) readj(x) - non conflict read-read operation
Readi(x) writej(x) - conflict read-write operation.
Writei(x) readj(x) - conflict write-read operation.
Writei(x) writej(x) - conflict write-write operation.
Where, I and j denote two different transactions Ti and Tj.
Now consider a precedence graph for testing conflict serializability. It is used to check conflict serializability.
For each transaction T, put a node or vertex in the graph.
For each conflicting pair, put an edge from Ti to Tj.
If there is a cycle in the graph then schedule is not conflict serializable else schedule is conflict serializable.
Let us consider some examples.
Cycle is present so it is not conflict serializable.
Cycle is not present, so it is conflict serializable.
Cycle is not present, so it is conflict serializable.