Computing a transaction matrix from the history.