An optimal procedure for the resource-constrained project scheduling problem with discounted cash flows and generalized precedence relations