I have a dataset of 500 observations (firms) and for each firm I know how they are directly and indirectly related based on some characteristics. I can therefore construct a network of connectivity across all stocks. For each firm I compute the shortest path to all other firms. I end up with 500 networks of degree of separation. For instance firm A is directly related to B and C and indirectly connected to D and E through B. Firm B and C belong to the first set of degree separation and D and E to the second degree of separation.
How can I aggregate all these 500 networks into one? Is there a mathematical / statistical methodology where I can aggregate all these networks? For instance, I would construct a network with a node (say A) representing a group of firms that are all directly connected and this node A is connected to another node, B. Firms in node B are also firms that directly connected but what connects B and A is that firms in A and B are often connected at the second degree of separation.