I have a connection graph which is generated by adding all immediate connections to a graph and sending that to all immediate connections. They in turn will add all their connections, and if any are added, will broadcast that in turn.
A problem that has been bugging me for a while is how to do subgraphs. Suppose you have a ring topology where each node on the ring is a server to a large number of clients. You want all clients to know about each other on the graph and the parent server to know about all its clients. However, you don’t want a particular server to know about the clients of a different server. Limiting which groups know about whom is pretty essentially for very large networks.
The way I did it was to modify the nodes in the graph to also contain a group id. Each node then subscribes to one or more group ids. For each node / edge in the graph, if that new node’s group id is not in your list of subscribed group ids, you ignore it.
It was a design decision to not forward connections which you ignore. This means that systems that are not chained in the graph won’t know about each other but without it you wouldn’t get the bandwidth savings.