A Novel Gate Resource Allocation Method Using Improved PSO-Based QEA