We present a novel optimization problem for discrete event control, similar in spirit to the optimal parametric control problem common in statistical process control. In our problem, we assume a known finite state machine plant model G defined over an event alphabet Σ- so that the plant model language L = ℒM(G) is prefix closed. We further assume the existence of a base control structure MK, which may be either a finite state machine or a deterministic pushdown machine. If K = ℒM(M K), we assume K is prefix closed and that K ⊆ L. We associate each controllable transition of MK with a binary variable X 1,...,Xn indicating whether the transition is enabled or not. This leads to a function MK(X1,...,Xn), that returns a new control specification depending upon the values of X 1,...,Xn. We exhibit a branch-and-bound algorithm to solve the optimization problem minX1,...,Xn maxw∈K C(w) such that MK(X1,...,Xn) |= Π and ℒM(MK(X1,...,Xn)) ∈ C(L). Here Π is a set of logical assertions on the structure of M K(X1,...,Xn), and MK(X 1,...,Xn) |= Π indicates that MK(X 1,...,Xn) satisfies the logical assertions; and, C(L) is the set of controllable sublanguages of L1.