Mods please don't delete this as it is a 100% serious thread.
An ex and I dated about three years back. He was a nice guy but I felt that he was not challenging me enough and seemed to have a general lack of interest in anything. This was what eventually lead me to break up with him. I tried to do it nicely but I felt bad because I knew it upset him a lot (this was his first serious relationship, even though it never got "super" serious, like towards marriage).
Anyway, the only time we have been in the same setting since then was a year later, where we were both at a get together. He messaged me asking if I needed a ride, I said thanks but I was okay and got there on my own. We ended up not talking at all the whole time there, mainly because we just talked to other groups of people and never got into a conversation ourselves. Afterwards he texted me saying he was sorry we couldn't say hi before I left, and he was really hoping it wouldn't be awkward.
That's the last we communicated. Right around when I broke up with him was when I started a PhD and life has been good since then. Well, it turns out he started a masters at my school this year. I didn't realize it until I saw him sitting in the lobby of where my office is, and then I saw he had updated this information. He was sitting in the far side of the lobby, so if I had to walk out I would just go straight out and not look that way, but I think he saw me and this means he knows where my office is.
It seems inevitable that we will probably run into each other soon. What's the best way to react when this happens? Sometimes when I walk past people it doesn't register who they are and I don't always recognize them but that seems like it could be rude here. I was planning to just say hi and congratulate him on getting in, and then going my own way. But it seems like we may run into each other many times over the course of the next year or two.
tl;dr: Dated a guy 3 years back, we broke up and he was upset. Now he goes to the same school as me and seems to hang out or be around the same area that I was. How to react when seeing him?