### Vector Clock

 The Fidge/Mattern's Vector Clock makes it possible to imply the happened-before relation by comparing the timestamps of the events and vice versa.`e → f ⇔ C(e) < C(f)` Where C(i) is the vector clock timestamp of event i.`V = V' iff <∀i: V[i] = V'[i]> V < V' iff <∀i: V[i] ≤ V'[i]> ∧ <∃i: V[i] < V'[i]> `To implement vector clock, each process has to have its own vector clock. The protocol for process Pi is as follows:``````* On executing an interval event:     C````i``[i] := C``i````[i] + 1 * On sending a message m:     C````i``[i] := C``i````[i] + 1     piggyback C````i```` on m *On receiving a message m:     let t````m```` be the timestaqmp piggybacked on m     ∀k C````i``[k] := max{C``i``[k], t``m````[k]}     C````i``[i] := C``i``[i] + 1````Comparison complexity is order of n where n is the number of processes. The following is a property of vector clock where e and f are events on processes pi and pj, respectively.``e → f iff (i = j) ∧ (C(e)[i] < C(f)[i]) ∨ (i ≠ j) ∧ (C(e)[i] ≤ C(f)[i])``