0

Rete Algorithm is an efficient pattern matching algorithm that compares a large collection of patterns to a large collection of objects. It is also used in one of the expert system shell that I am exploring right now: is drools.

What is the time complexity of the algorithm, based on the number of rules I have?

Here is a link for Rete Algorithm: http://www.balasubramanyamlanka.com/rete-algorithm/ Also for Drools: https://drools.org/

noxdafox
  • 14,439
  • 4
  • 33
  • 45
Emarlou
  • 1
  • 1
  • It would be nice to have links (at least) for helping contributors to know what is the context. Also, I would say that this question might be better in SE Computer Science . – Bentoy13 Sep 26 '19 at 16:07
  • Thank you. Okay I will add links for rete algorithm and also for drools expert system that I am exploring – Emarlou Sep 26 '19 at 16:11

1 Answers1

1

Estimating the complexity of RETE is a non-trivial problem.

Firstly, you cannot use the number of rules as a dimension. What you should look at are the single constraints or matches the rules have. You can see a rule as a collection of constraints grouped together. This is all what RETE reasons about.

Once you have a rough estimate of the amount of constraints your rule base has, you will need to look at those which are inter-dependent. Inter-dependent constraints are the most complex matches and are pretty similar in concept as JOINS in SQL queries. Their complexity varies based on their nature as well as the state of your working memory.

Then you will need to look at the size of your working memory. The amount of facts you assert within a RETE based expert system strongly influence its performance.

Lastly, you need to consider the engine conflict resolution strategy. If you have several conflicting rules, it might take a lot of time to figure out in which order to execute them.

Regarding RETE performance, there is a very good PhD dissertation I'd suggest you to look at. The author is Robert B. Doorenbos and the title is "Production matching for large learning systems".

noxdafox
  • 14,439
  • 4
  • 33
  • 45