mostar
mostar

Reputation: 4841

Ideal Topology of Rete Tree for Rule Engine

As you know many rule engines use Rete algorithm when processing rules and this algorithm constructs a tree so called Rete tree.

What is the ideal topology for Rete tree to ensure better rule processing performance? In other words, I want to know the tree topology a rule set should better correspond to for better performance.

Upvotes: 0

Views: 376

Answers (2)

André Dias
André Dias

Reputation: 11

Simply put, if you would like to use the RetePlus algorithm in your orchestration, use only Decision Trees business rules.

It's much faster when used this way. Although you may used in combination with other algorithms as well as Sequential (for Action Rules, in this case).

So your solution could be part of Action Rules (with Sequential) and part with Decision Tables (with RetePlus).

Hope this helps.

Upvotes: 0

z_blue
z_blue

Reputation: 360

The short answer is that the performance is affected by the number of rules and objects, the number of tests, how you order the tests in your rules, and how many tests/conditions are shared between rules.

You should rewrite rules for optimal performance by:

  • Reordering tests and conditions so that the most discriminating conditions are moved to the beginning of the rule
  • Sharing conditions

See the Adjusting conditions IBM ODM documentation.

You should also reduce the number of objects that need to be evaluated by rules, and the number of tests.

For your reference regarding Rete and IBM ODM:

RetePlus is designed to optimize the evaluation of large numbers of rules across large numbers of objects. RetePlus filters the tests such that irrelevant tests are not evaluated. Tests can be shared between rules that use similar tests so that they do not need to be re-evaluated for all the rules.

For the best results:

  • Common tests on different objects are shared.

  • The number of tests carried out are minimized.

  • Performance degrades when a single evaluation contains too many variable definitions and conditions.

  • The test uses less memory.

Upvotes: 2

Related Questions