The single-item discrete lotsizing and scheduling problem: optimization by linear and dynamic programming