Vector clock

Denote ${\displaystyle VC_{i}}$ as the vector clock maintained by process i, the clock updates proceed as follows:[1]
• Each time a process experiences an internal event, it increments its own logical clock in the vector by one. For instance, upon an event at process i, it updates ${\displaystyle VC_{i}[i]\leftarrow VC_{i}[i]+1}$.
• Each time a process receives a message, it increments its own logical clock in the vector by one and updates each element in its vector by taking the maximum of the value in its own vector clock and the value in the vector in the received message (for every element). For example, if process Pj receives a message m from Pi, it updates by setting ${\displaystyle VC_{j}\leftarrow max(VC_{j}[k]+1,VC_{i}[k]),\forall k}$.