You can't prevent people from having relationships. It's not realistic. My company has specific rules about this. Typically, "problematic" relationships need to be disclosed to HR and leadership, but they're not forbidden per se.