This article presents a novel methodology for designing double-ridged waveguides by numerically optimizing their geometric shape such that they sustain the two prescribed lowest order modes. The field solution to the problem is obtained by using the finite element method. The performance of the microgenetic algorithm and the quasi-Newton methods is studied for carrying out geometry optimization. This generalized formulation is capable of handling inhomogeneous material fillings in the guide, and computational results are presented to demonstrate the versatility of the proposed technique. (C) 2002 Wiley Periodicals, Inc.