Flow behaviors of a downstream object can be affected significantly by an upstream object in close proximity. This concept is used for flow control in this study to maximize the lift/drag ratio on a NACA0012 airfoil. A cylinder with cross-flow translational motion is placed upstream of the airfoil. Numerical simulations are carried out with an immersed-boundary method to solve the incompressible, viscous flow at the Reynolds number of 2000. Control parameters that influence the dynamics of flow around the airfoil are systematically investigated, including the oscillating frequency and amplitude of the upstream cylinder, the distances between the cylinder and the airfoil, and the diameter of the cylinder. To obtain sample data properly and efficiently for carrying out the neural network study, the idea of the orthogonal test method is used to set the control parameters in the numerical simulation. The combination of the back-propagation neural network algorithm and the genetic algorithm is applied to find the optimal value of the lift/drag ratio and the corresponding control parameters. The results show that when the cylinder oscillating frequency increases, the ratio increases until negative coefficients occur; when the distance between the cylinder and the airfoil increases or the amplitude of oscillating cylinder increases, the ratio decreases first and then increases; and when the cylinder diameter increases, the ratio increases. Compared to the reference case, the optimized lift/drag ratio increases 178%.