  Federated learning (FL) provides a privacy-preserving approach for
collaborative training of machine learning models. Given the potential data
heterogeneity, it is crucial to select appropriate collaborators for each FL
participant (FL-PT) based on data complementarity. Recent studies have
addressed this challenge. Similarly, it is imperative to consider the
inter-individual relationships among FL-PTs where some FL-PTs engage in
competition. Although FL literature has acknowledged the significance of this
scenario, practical methods for establishing FL ecosystems remain largely
unexplored. In this paper, we extend a principle from the balance theory,
namely ``the friend of my enemy is my enemy'', to ensure the absence of
conflicting interests within an FL ecosystem. The extended principle and the
resulting problem are formulated via graph theory and integer linear
programming. A polynomial-time algorithm is proposed to determine the
collaborators of each FL-PT. The solution guarantees high scalability, allowing
even competing FL-PTs to smoothly join the ecosystem without conflict of
interest. The proposed framework jointly considers competition and data
heterogeneity. Extensive experiments on real-world and synthetic data
demonstrate its efficacy compared to five alternative approaches, and its
ability to establish efficient collaboration networks among FL-PTs.
