Comparison

Chris Angelico rosuav at gmail.com
Mon Sep 22 13:45:16 EDT 2014


On Tue, Sep 23, 2014 at 3:38 AM, LJ <luisjosenovoa at gmail.com> wrote:
> At some point in my algorithm I am looping through some subset of nodes and through the labels in each node and I perform some "joining" checks with the labels of each node in another subset of nodes. To clarify I check for a feasibility condition in a pairwise manner for every label in one node and every label of another. This nested loop is taking time.
>

Okay, that's where the issue is - you're doing a cross-match, that's
going to be comparing every label against every other.

You might be able to cache some references to part-way into the tree,
depending on how your code is written, but ultimately, you still need
to do all of those checks.

What's the definition of feasibility? Can you optimize that? Maybe
there's a way to do a rough check that cuts down the number you have
to do the exact check on.

ChrisA



More information about the Python-list mailing list