The objective with the present paper is to find a solution method for the inventory routing problem, in which have been added several characteristics that resemble their behavior to the current companies’ reality. Between them the hard time windows, a dynamic component and a success probability applied to the routes between the nodes. In that case we use the dynamic programming with finite stages in order to optimize the routing of vehicles in each period, taking into account the dynamical changes implicit in the nodes and the other IRP characteristics.