# aggregating multiple shortest-path networks

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.

If your program is self consistent in how it assigns neighbor degrees (e.g. A is a first degree neighbor of B and B is a first degree neighbor of A) you can simply represent your network as an adjacency matrix of first degree neighbors. E.g. if you have three nodes, A, B & C, and A is a first degree neighbor of B and a second degree neighbor of C, this would imply the adjacency matrix below:
  A B C