Resource allocation algorithms in stochastic systems