Christmas Word Search

DMCommunity.org offered a relatively simple challenge “Christmas Word Search” for holidays. My first inclination was to ask an LLM to solve it. I certainly was impressed that Copilot (or another LLM-based tool) could quickly build a code to find a correct solution. But then I thought: “Can I, a human, do better than LLM preferably without coding?” Below I describe my experiments from this morning.

Continue reading

Integrating Rule Engine and Constraint Solver

OpenRules Rule Solver is an open-source tool that adds the power of Constraint and Linear Programming to Business Decision Modeling. It extends OpenRules Decision Manager to support Declarative Decision Modeling and Decision Optimization.

You may look at multiple decision models from Simple Arithmetic Problems to Smart Investments to see how Rule Solver helps define business optimization problems and produce their optimal solutions. One such decision model was created by our intern to ponder the DMCommunlity Challenge “Rental Boats“.

Continue reading

Solutions for Challenge “Soldier Payment Rules”

The DMCommunity’s Aug-2023 Challenge brought serious discussions at LinkedIn about the integrated use of SQL and Rule Engines. Instead of making generic statements about which technology is better, I prefer to answer this question for a concrete problem. My colleague Alex Mirtsyn has already provided a pure rules-based solution. As I was asked to provide a solution with OpenRules RuleDB, I extended Alex’s solution with access to a relational database directly from business rules. I will describe the resulting decision model in this post.  

Continue reading

Rules as Preferences (Miss Manners Advanced)

DMCommunity Challenge July-2023 deals with a rules-based decisioning problem when not all rules can be satisfied and thus should be considered as preferences. It offers an advanced version of “Miss Manners” (see OpenRules solution) with not equal numbers of males and females at each party. So, the seating arrangement “boy-girl-boy-girl and each guest has someone on the left or right with a common hobby” becomes not a Rule but a Preference. It makes the problem much more difficult to represent and solve especially if we want to find an optimal seating. In this post I will demonstrate how to build the corresponding business decision model using the latest version of OpenRules Rule Solver.

Continue reading

Declarative Decision Model “Flight Rebooking”

Rule Solver can be used to build a real declarative decision model for one of the most complex decision modeling challenges “Flight Rebooking” offered by DMCommunity.org: “A flight was cancelled, and we need to re-book passengers to other flights considering their frequent flyer status. miles, and seat availability“. Most of the submitted solutions were based on a procedural approach and used different implementations of a greedy algorithm where decision models concentrate on “HOW” to make flight assignments. We suggested and implemented a decision model that concentrate on Problem Definition (“WHAT”) instead of Problem Resolution. The complete model is described here. Link

Declarative Decision Model “Miss Manners”

This problem used to be one of the popular benchmarks for rule engines 20 years ago. And now DMCommunity.org brings it back to see how modern decision engines can represent and solve this problem today. I will demonstrate it in this post with the latest OpenRules Rule Solver.

Continue reading

Decision Model “Permit Eligibility”

In this post we describe an OpenRules decision model that addresses DMCommunity.org Mar-2023 Challenge “Permit Eligibility”. The Challenge asks to implement this rule: “An applicant is eligible for a resident permit if the applicant has lived at an address while married and in that time period, they have shared the same address at least 7 of the last 10 years.” There is already 2 DMN-based solutions published by Bruce Silver who explained that this simply sounding rule requires to address several not so simple considerations. There is also an attempt to create a decision model with ChatGPT, which I analyzed and converted to a working Java code. I asked an OpenRules developer Alex Mirtsyn to look at this problem, and together we came up with a solution described in this post.

Continue reading

Christmas Model in JavaSolver

DMCommunity.org offered the Dec-2022 Challenge “Christmas Model” created with ChatGPT. This nice model defines a set of people, a set of gifts, the happiness level, and costs of each gift. The objective is to maximize the total happiness, subject to the budget constraint that the total cost of the gifts must be less than or equal to the budget, and the constraint that each person can only receive one gift. As a holiday exercise, I tried to implement it using a free and open-sourced JavaSolver.com. Here is my solution:

Continue reading

Using Templates to Create Domain-Specific Decision Tables

While DMN-like decision tables are powerful enough to represent business logic for many practical problems, in the real world our customers frequently define new types of decision tables that are specific to their business domains. For example, OpenRules was chosen for a large project that in particular dealt with spatial business rules. Their customers, suppliers, and operations vary by region, and the distances between them were important considerations for making decisions. They already used a Geospatial Information System (GIS) to explore spatial relationships that leveraged the industry-standard Java Topology Suite (JTS) with a powerful Java API.

However, they wanted their business (!) users to natively define and maintain complex spatial rules without becoming experts in specific Java API. This 2014 presentation describes how OpenRules helped this customer to create a Spatial Decision Table template allowing stakeholders with no GIS training to use plain English in familiar Decision Model spreadsheets to define spatially aware business rules without any additional software.

Continue reading

Solution for DMCommunity Challenge “Pay-As-You-Go Pricing Rules”

There are already 3 solutions to DMCommunity May-2020 Challenge. I especially like how Carol-Ann Berlioz created her solution using a test-driven approach when test cases prompt her which rules should be added. So, I’ve tried to reproduce her solution but instead of a product specific GUI I decided to use OpenRules decision tables defined in Excel. So, here are our test-cases with input data and expected results: Continue reading

Building a Live Worker Scheduler

There are already several good responses to the DMCommunity’s April-2020 Challenge “Doctor Planning”. Below I am describing how I tried to use this challenge to create a complete decision optimization service. I ended up with a working Worker Scheduler that shows a solution for this particular challenge in Fig. 1 (click to open):

Continue reading

Nim Game

DMCommunity’s Jan-2020 challenge “Nim Rules” offers to find a winning strategy for this game: “There is a number of red balls in the row below (it could be 15, 16, or 17 balls). Two players take turns removing balls from the row, but only 1, 2 or 3 balls at a time. The player who removes the last ball loses.”

People play different versions of the Nim game since ancient times. First time I played this game with 15 parrots against a clown at a children’s party when I was 7. Later on during my first university’s year my math professor challenged me to play this game instead of answering my exam questions. Continue reading