0

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.

mostar
  • 4,723
  • 2
  • 28
  • 45

2 Answers2

2

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.

z_blue
  • 350
  • 3
  • 20
  • I want to point out that although the references are to IBM ODM, the same concepts would apply to any other implementation of the Rete algorithm – z_blue Nov 26 '15 at 20:54
  • z_blue is right, but you should also bear in mind that 99% of the time, if using ODM, you will use the Sequential or Fastpath execution mode. RetePlus is really only used if you rule chaining. In fact in ODM 8.7 onwards, RetePlus was no longer the default execution mode for rule tasks. Fastpath is now the default. – Justin Phillips Dec 21 '15 at 23:33
0

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.