top | item 40490333

(no title)

bollu | 1 year ago

I have a very well documented implementation of rete, that also produces nice looking SVGs of the state of the rete algorithm here: https://github.com/bollu/rete

It's a really interesting algorithm, and allows one to get O(1) incremental pattern matching (ie, when one adds a pattern, one is told of a matching pattern in O(1) time) at the cost of O(npattern * nitems) memory usage. I was trying to use it in the context of pattern matching within a compiler, but I never went anywhere since I had COVID, then a PhD to get to :)

discuss

order

aitchnyu|1 year ago

I used Drools Planner for generating a timetable. The rules scores the state of domain objects (teachers, periods etc) like "10 violations, 15000 points" and the algorithm (simulated annealing in my case) randomly swaps states and backtracks the swap so it becomes "0 violations, 9000 points".

ryjo|1 year ago

> rete0.cpp is a faithful implementation from the thesis, to the extent that it has page number markings in the source code to refer to the thesis

Music to my ears :) thanks for sharing this!

mark_l_watson|1 year ago

Wow, that is so cool! I love the diagrams showing the internal state.