2
$\begingroup$

I have a problem that I need to solve, and I'm looking for which area of computer science (algorithms. etc) would be appropriate to solve this problem.

In the system we have a list of actions that a user has previously taken. The possible actions are:

  • User creates item of type A.
  • User creates item of type B.
  • User creates item of type C.

The date and time the action was taken is also recorded.

We have a function passesRules which takes the list of all actions the user has previously taken as input, and applies a set of rules and returns a boolean. The boolean is true if any of the rules are true, and false if none of the rules are true.

There are many possible rules, but in general they take the form of:

  • Has user created 5 items of type A in the last 10 days?
  • Has user created 2 items of type B in the last 3 days?
  • Has user created more than 6 items of type C in last 5 days, AND created 3 items of type A in the last 10 days?

What I want to do is to create a function predictActions which predicts the actions the user must take so that passesRules returns true.

Obviously with the rules described above there are multiple different sets of actions that could make passesRules return true. I would like predictActions to return an array where each element in the array is a list of actions the user could take to make passesRules return true.

predictActions should take the following parameters:

  • The list of actions the user has previously taken.
  • The list of rules.
  • The current date.

I'm not asking for a solution, but I don't know what area of computer science to investigate further to model and solve this problem. Something from graph theory, or some type of constraint solver?

Thanks!

$\endgroup$
0
$\begingroup$

It depends on what the rules are. For your particular rules, this can be handled very simply by counting the number of events of each type seen in the given time window; then predictActions can easily compute the additional number of each type of action needed.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.