brewphone
brewphone

Reputation: 1366

Can OptaPlanner solve multiple problems concurrently

When OptaPlanner is used in web service, which means an OptaPlanner app is required to solve multiple problems in parallel threads, are there any limitations to prevent OptaPlanner from doing this? Is synchronization required in any OptaPlanner functions? Thanks

Upvotes: 1

Views: 185

Answers (1)

Geoffrey De Smet
Geoffrey De Smet

Reputation: 27312

OptaPlanner supports this: it's a common use case.

In a single JVM, look at SolverManager to solve mulitple datasets of the same use case in parallel. Even if the constraint weights differ per dataset (see ConstraintConfiguration). So even if some datasets disable/enable some of the constraints while others don't.

For different use cases in a single JVM, just create multiple SolverFactory or SolverManager instances. This is uncommon because usually each use case is a different app (= microservice?).

Across multiple JVMs (= pods), there are several good techniques. Our activemq quickstart scales beautifully horizontally. Read Radovan's blog about how the ActiveMQ is used to load balance the work across the solver pods.

Upvotes: 3

Related Questions