graph – P2P network implementation: how to avoid “orphan” groups of nodes


As the title says, in a P2P decentralized network implementation how do you ensure that all your nodes are actually connected and you never have a subset of “orphan” nodes at any time (e.g. nodes connected to each others but “disconnected” from the rest of the graph)?

Looking for ideas/suggestions/algorithms/strategies…