Simulation of an epidemic on a random graph of choice according to discrete-time SIR and SIRV models and estimation of parameters by gradient descent