in reply to Algorithm To Select Lines Based On Attributes
Having said that, if you have many rules of the form "specific_attribute equals X" or "specific_attribute falls between Y and Z", you can preprocess the rule data. For exact matches, build hash; for ranged matches, use something like a segment tree. That would reduce your algorithm from O(A*R) to O((A+R)*log2(R)), where A is the total number of attributes (of all defects together) and R the number of rules.
|
|---|