For two-dimensional inviscid compressible flows the stream function may be used as the field variable. Although the relevant equation is nonlinear, it can be linearized for flows around slender bodies, such as airfoils. In multiply connected flow domains the boundary stream function values are not known a priori. In the present paper, an optimization approach is adopted to find these unknown values, as well as the entire solution field. In the proposed method of solution, the adjoins variable method of optimization is used to find the sensitivity coefficients of the objective function, which is constructed by using the Kutta condition. The boundary element method is used to discretize the flow and adjoint equations at each iteration of the optimization procedure. Numerical solutions are provided for two example problems for flows in a channel with one and two airfoils. (C) 1999 Elsevier Science Ltd. All rights reserved.