In this paper, the binary gravitational search algorithm and support vector machines have been used to diagnose epilepsy. At first, features are extracted from EEG signals by using wavelet transform and fast fractional Fourier transform. Then, the binary gravitational search algorithm is used to perform feature selection, instance selection and parameters optimization of support vector machines, and finally constructed models are used to classify normal subjects and epilepsy patients. The appropriate choice of instances, features and classifier parameters; considerably affects the recognition results. In addition, the dimension reduction of the features and instances is important in terms of required space to store data and required time to execute the classification algorithms. Feature selection, instance selection and parameters optimization of support vector machines have been implemented both simultaneously and stepwise. The performance metrics in this study are accuracy, sensitivity, specificity, number of selected features, number of selected instances and execution time. The results of experiments indicate that the simultaneous implementation of feature selection, instance selection and support vector machines parameters optimization leads to better results in terms of execution time in comparison with the stepwise implementation. In the stepwise implementation, performing instance selection process before feature selection leads to better results in terms of accuracy, sensitivity and specificity, as well as reduction of execution time. The results show that the proposed methods achieve noteworthy accuracy in comparison with other methods that were used to diagnose epilepsy.