Show up early to the airport and see if the Check-in agent will take pity on you and give you a seat with good legroom so you can stretch out & avoid having your foot hit by others.
What airline are you traveling on? Do they have a premium economy section, assuming you're traveling in economy, or an extra legroom section that can be purchased at a reasonable rate?
Speak with your doctor to find out if taking an NSAID (Ibuprofen/naproxen/aspirin) before and during the flight to make sure it's appropriate for with any medications you're on and/or your current situation. NSAIDs reduce inflammation and can also thin blood which can help with the swelling but aren't appropriate for everyone in every situation.