Load forecasting is of crucial importance for smart grids and the electricity market in terms of the meeting the demand for and distribution of electrical energy. This research proposes a hybrid algorithm for improving the forecasting accuracy where a non-dominated sorting genetic algorithm II (NSGA II) is employed for selecting the input vector, where its fitness function is a multi-layer perceptron neural network (MLPNN). Thus, the output of the NSGA II is the output of the best-trained MLPNN which has the best combination of inputs. The result of NSGA II is fed to the Adaptive Neuro-Fuzzy Inference System (ANFIS) as its input and the results demonstrate an improved forecasting accuracy of the MLPNN-ANFIS compared to the MLPNN and ANFIS models. In addition, genetic algorithm (GA), particle swarm optimization (PSO), ant colony optimization (ACO), differential evolution (DE), and imperialistic competitive algorithm (ICA) are used for optimized design of the ANFIS. Electricity demand data for Bonneville, Oregon are used to test the model and among the different tested models, NSGA II-ANFIS-GA provides better accuracy. Obtained values of error indicators for one-hour-ahead demand forecasting are 107.2644, 1.5063, 65.4250, 1.0570, and 0.9940 for RMSE, RMSE%, MAE, MAPE, and R, respectively.