1

I struggle with the understanding of this algorithm. Is there anybody willing to explain me how the tree is built in RETE and how it helps with concrete inputs?

BanikPyco
  • 111
  • 2

1 Answers1

1

The RETE algorithm creates an efficient rule-based production expert system (often visualized as a tree) to represent rules in a way that reduces redundant operations by sharing common conditions among different rules, allowing for efficient processing of new data or facts against the existing rules set.

It reduces or eliminates certain types of redundancy through the use of node sharing.
It stores partial matches when performing joins between different fact types. This, in turn, allows production systems to avoid complete re-evaluation of all facts each time changes are made to the production system's working memory.
The Rete algorithm is widely used to implement matching functionality within pattern-matching engines that exploit a match-resolve-act cycle to support forward chaining and inferencing.

The "left" (alpha) side of the node graph forms a discrimination network responsible for selecting individual WMEs based on simple conditional tests that match WME attributes against constant values... The "right" (beta) side of the graph chiefly performs joins between different WMEs. It is optional, and is only included if required. It consists of 2-input nodes where each node has a "left" and a "right" input. Each beta node sends its output to a beta memory.

So to pass and forward a single fact with its type and value, an Alpha node is created corresponding to individual condition related to the said fact in the entire rules set to filter this fact. A Beta node is created for condition that involve multiple facts which takes inputs from the Alpha nodes or other Beta nodes and tests if the joined facts satisfy the condition. In this way, the Alpha nodes and Beta nodes are connected in a tree based on the parsed rules set structure. The tree structure is designed to minimize the amount of work needed as new facts are introduced, making it highly efficient in systems with many rules and facts.

Rete algorithm also uses memory nodes to store partial matches from Alpha and Beta networks during facts processing to avoid re-evaluating facts unnecessarily and scale well with the number of rules and facts .

cinch
  • 310
  • 2
  • 10