Unfortunately there is really nothing you can do to end her affair or convince her to come back to you, she has to decide that for herself. Your living arrangements trying to make this work long distance were obviously a big part of your undoing, so if you get a chance to put this back together you're going to have to fix that.
In the meantime, I recommend you set up an appointment with a DB Coach on this site, they will help you a lot. Secondly, buy and read the book "The Divorce Remedy" and follow the guidance. Finally, look up "Sandy's 37 Rules" and start using those to guide your actions immediately.
You want to avoid begging, pleading, shaming, or argument. None of it will work. Your best bet right now is to give her space and start building a lift for yourself. You need her to see you as stable, confident, emotionally healthy and happy, a guy with a life worth sharing.
Let us know if you have specific questions or need specific guidance.
Acc
Married 18, Together 20, Now Divorced M: 48, W: 50, D: 18, S: 16, D: 12 Bomb Dropped (EA, D): 7/13/11 Start Reconcile: 8/15/11 Bomb Dropped (EA, D): 5/1/2014 (Divorced) In a New Relationship: 3/2015