In an embodiment, a method comprises: receiving pre-planting data representing a lower bound date value and an upper bound date value of dates for a pre-planting application of fertilizer to an agricultural field; side-dressing data representing a lower bound date value and an upper bound date value of dates for a side-dressing application; fertilizer cost data representing a cost of a fertilizer application; labor cost data representing a cost of applying fertilizer to the field; and expected profit data. Based on the received data, one or more penalty constraints are determined. Based on the received data, a fertilizing schedule is generated. The schedule comprises the one or more valid calendar dates on which fertilizing the agricultural field is recommended and the one or more valid fertilizer amounts to be applied to the agricultural field on the one or more valid calendar dates to maximize a yield from the agricultural field.