Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Rete Algorithm

How can i use Rete Algorithm in java?

Do i need to write my own algorithm implementation?

Or is there already implemented library available?

like image 803
sabbir Avatar asked Sep 18 '12 10:09

sabbir


People also ask

How does the Rete algorithm work?

The Rete algorithm is an example of an algorithm that matches production rules. The Rete algorithm uses a knowledge base to check production rules and provide outcomes accordingly. It uses a complex node system to return results. Tools such as joins determine the algorithm's behavior in terms of analysis.

What is Rete network used for?

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.

How do I create a Rete network?

The Rete network is constructed when you compile a rules project — only once when you start that service (or class for simpler designs) — and then shared across all invocations. The discrimination tree is the first part of the Rete network.

How is Rete algorithm implemented in Java?

The Rete algorithm is implemented by building a network of nodes, each of which represents one or more tests found on a rule LHS. Facts that are being added to or removed from the knowledge base are processed by this network of nodes. At the bottom of the network are nodes representing individual rules.


1 Answers

So this is a pretty old question, but ranks highly if you're googling for Rete Implementations, so I'll leave some info here.

The wikipedia entry is pretty good and here is a paper about Rete/UL which is according to Doorenbos more efficient than ReteII Doorenbos, 1995.

Some Implementations include:

  • Drools for java
  • Jess also java
  • Wongi-Engine for ruby (I use this one) based on the same paper as listed above.
  • Ruleby also ruby but defunct
  • Mirmir clojure
  • Clara Rules also clojure (added 4/20/15)
  • Rete for Triples clojure (maybe defunct?)
  • kongra's Rete haskell (wow) based on the same paper as listed above.
  • and all of these

Its a really useful algorithm if you need to make decisions based on patterns of facts, and as a bonus, you'll have to learn some cool things about graphs and pattern matching.

Hope this is helpful!

like image 144
Chase Avatar answered Sep 18 '22 00:09

Chase