Sounds perfect!


On Tue, Jul 30, 2013 at 6:25 PM, nikitsaraf <notifications@github.com>wrote:

> In dedupe/clustering.py:
>
> > @@ -94,3 +96,39 @@ def cluster(dupes, threshold=.5):
> >      clusters = [set(l) for l in clustering.values() if len(l) > 1]
> >
> >      return clusters
> > +
> > +
> > +def clusterConstrained(dupes,threshold=.6):
> > +
> > +    dupe_graph = networkx.Graph()
> > +    dupe_graph.add_weighted_edges_from((x[0], x[1], y) for (x, y) in dupes)
>
> 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
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/open-city/dedupe/pull/132/files#r5492079>
> .
>



-- 
773.888.2718
2231 N. Monticello Ave
Chicago, IL 60647