Whilst algorithms for discrete-time simulations are not complex, some simple implementation techniques (arising from the observation that most networks of epidemiological interest are sparse) can significantly enhance software performance. In a directed network with N nodes, there are N(N −1) possible edges; in a sparse network with mean node degree k, there are Nk N(N − 1) edges. Accordingly, rather than representing the network as an N by N array, where the element in each array is 0 if the edge is absent, nonzero otherwise, it is usually more efficient to maintain a list of the neighbours of each node. Then, if a list of infected nodes is maintained during a simulation run, it is straightforward to consider each susceptible neighbour of an infected node in turn and test if infection is transmitted to that node. Additionally, a fast high-quality pseudorandom number generator such as the Mersenne Twister should be used [108] . The "contagion" software package implements these techniques (amongst others) and is freely available [109] .