Ok. Yes, it is correct that we can directly use
```python
scored_pairs = numpy.asarray(adjacency_matrix(sub_graph))
```
just by changing connected_components to connected_component_subgraphs
But, I would like to highlight a few points, which took me a lot of time to think over : -
1. First of all, and one of the major problem is adjacency_matrix() function. I thought that it worked correctly. But it isn't the case. This is because adjacency_matrix does not generate the correct kind of cost matrix which we require for Hungarian algorithm, as the Adjacency_matrix works on the node_list. So, if suppose the following edges exist [(1,5),(2,6),(3,7),(4,8)], it would generate a 8x8 matrix, instead of a 4x4 matrix. I thought earlier that only for the edges, the value would be set in the matrix, but the value is also set for (5,1),(6,2),(7,3) and (8,4). So, the Hungarian Algorithm is not able to correctly find the pairs. I have searched enough to find a coo_matrix kind of function which could be used instead of adjacency_matrix but could not find any.
2. Secondly, even if there is a function similar to coo_matrix which we could use in place of the adjacency_matrix, there would be another problem. Since the Id can be of any type, for the non-integer type ids also, the adjacency matrix indices's would be integer and hence the Hungarian Algorithm would return the pairs of integers, which would be difficult to map to the original ids.

So, I propose to use the original coo_matrix solution