On 10/24/12 2:56 PM, nathanmarz wrote:
I'm looking into rewriting Storm's resource scheduler using
core.logic. I want to be able to say constraints like:

1. Topology A's slots should be <= 10 and as close to 10 as possible
(minimize the delta between assigned slots and 10)
2. All topologies should use less than 200 CPU's and less than 600 GB
of memory
3. Topology B should run at most 2 workers on each host
4. Each worker for topology C should run at most one task for
component X and one task for component Y
5. Should minimize the amount of reassignment to running topologies in
order to satisfy constraints
6. Should only be allowed to reassign workers for an individual
topology whose individual constraints are satisfied once every 10
minutes

And so on. I have two questions:

1. How good is core.logic at culling the search space using arithmetic
logic? For example, if it knows that x + y <= 5, x>=0, and y>=0, it
should never bother with areas of the search space where x or y are
=5.
2. Can core.logic do things like search the space for which my
evaulation criteria are minimized? Or is what we're trying to do a
better fit for different techniques like linear programming?

I don't know enough about core.logic to comment on that, but my first impression upon reading your problem description is that integer programming would solve the problem (core.logic may be a better fit though). However, I'm not sure how you would model in your last requirement (but I don't have too much experience with LP/IP modelling). In the past I've used GLPK[1] for these types of problems which has java bindings [2].

This (older) paper[3] discusses the difference between mathematical programming (LP/IP) and constraint programming. If you jump to the summary it provides some guidelines on when each approach makes more sense than the other. I just reread the summary and it seems like constraint-based or perhaps a hybrid solution would be best. So, in my unqualified opinion, if you can make core.logic work that may be the best fit and may simplify your life (GLPK is a big dep).

-Ben

1. http://www.gnu.org/software/glpk/
2. http://glpk-java.sourceforge.net/
3. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.153.6862

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to