We flew cheaply from Granada to Barcelona on Vueling airlines. Took 1.5 hours in the air which beats the 11 hour day or night train from Granada to Barcelona; total travel time to airport, being in airport, being in air, getting your bags (if you carry on) about roughly 5 hours, maybe 6. We were up by 5, cab by 6, at airport before 7am, flight by 9, in Barcelona before 11, in the city center by noon. We could have gotten to the airport a tad later as we had to wait 45 min for employees to arrive to check us into our flight. Fly into Madrid and out of Barcelona. Go the route of Madrid->Seville->Granada->Barcelona. Besides the train trip from Madrid to Sevilla, I found train and bus travel in Spain affordable. The train travel from Madrid to Sevilla on Renfee AVE was a reservation necessary train ride that can be cheap if you book ahead and commit to a time and date (the more cheap, the more non-refundable or changeable).
Hopefully you can go at a more relaxed pace. I would recommend 3-4 nights in Madrid (if 4, take a day trip; you have plenty of options). 2-3 nights in Sevilla (if 3, might be able to slip in a day trip to Cordoba, fitting it in when you are taking the AVE from Madrid to Sevilla). 2-3 nights in Granada (could easily be done in 2 nights but I really like to just roam around this cool place and chill out. You have to go to the Hamman Arab baths; bring a swim suit). 3-4 nights in Barcelona.