I understood, you trying to prefix the two sets of nodes with a and b respectively to distinguish that they belong from different sets. But I don't understand how would it help in solving our problem. The adjacency_matrix would still create the matrix from all the node_list.
Searching more, I found that networkx provides various functions for bipartite graph. Since our dupe_graph is bipartite, I checked that all its connected components subgraphs are also bipaprtite. So, why not use biadjacency_matrix http://networkx.github.io/documentation/latest/reference/generated/networkx.algorithms.bipartite.basic.biadjacency_matrix.html#networkx.algorithms.bipartite.basic.biadjacency_matrix
I have checked it. It is giving us the required cost_matrix