Here's something that's helped tremendously for me. I started running again after my ex broke up with me. I run two miles at a time which takes me about 16-17 minutes which is 16-17 that I don't think about my ex at all. I've done this probably twenty times now since she broke up with me so the way I figure it I've run at least 40 miles away from her. It hasn't been far enough just yet but it has helped and I'll lace up again tomorrow so I can put another couple of miles between my heart and her.
Edit - Here I am almost a month later and I've run 64 miles since she broke up with me. I find myself thinking of her for an hour or more at a time and I run on those days to clear my head again.