Initialization process is so much slow

176 views
Skip to first unread message

Bora SAYINER

unread,
Apr 17, 2017, 1:25:08 PM4/17/17
to OptaPlanner development
Hi guys. We are working a project that use optaplanner for curriculum planning. My entities like below. When i start solving its take so much time. I cant solve this problem. Is my approach wrong? Thanks.

@PlanningEntity
SyllabusStructure (Lecture) : => Element Size: 741

@PlanningVariable
Room (Place) : => Element Size: 72

@PlanningVariable
Period (Place) : => Element Size: 600

@PlanningVariable
AcademicStaff (Teacher) : => Element Size: 135

I'm using default settings for optaplanner configuration xml;

<solver>
<!-- Domain model configuration -->
<solutionClass>com.intestech.resourceplanner.planner.CourseSchedule</solutionClass>
<entityClass>com.intestech.resourceplanner.model.entity.impl.SyllabusStructure</entityClass>

<!-- Score configuration -->
<scoreDirectorFactory>
<scoreDefinitionType>HARD_SOFT</scoreDefinitionType>
  <scoreDrl>solver/config/resourcePlannerScoreRules.drl</scoreDrl>
</scoreDirectorFactory>

<!-- Optimization algorithms configuration -->
<termination>
<secondsSpentLimit>600</secondsSpentLimit>
</termination>
</solver>

// DEBUG
2017-04-17 20:16:04,820 [main] INFO  Solving started: time spent (130), best score (2223uninitialized/0hard/0soft), environment mode (REPRODUCIBLE), random (JDK with seed 0).
2017-04-17 20:17:47,280 [main] DEBUG     CH step (0), time spent (102591), score (0hard/0soft), selected move count (5832000), picked move ([com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@82 {null -> com.intestech.resourceplanner.model.entity.impl.AcademicStaff@20}, com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@82 {null -> com.intestech.resourceplanner.planner.Period@1f}, com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@82 {null -> com.intestech.resourceplanner.model.entity.impl.Place@2f}]).
2017-04-17 20:19:04,689 [main] DEBUG     CH step (1), time spent (180000), score (0hard/0soft), selected move count (4154603), picked move ([com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@83 {null -> com.intestech.resourceplanner.model.entity.impl.AcademicStaff@20}, com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@83 {null -> com.intestech.resourceplanner.planner.Period@1f}, com.intestech.resourceplanner.model.entity.impl.SyllabusStructure@83 {null -> com.intestech.resourceplanner.model.entity.impl.Place@20}]).

Geoffrey De Smet

unread,
Apr 18, 2017, 5:36:46 AM4/18/17
to optapla...@googlegroups.com

This is because of the Construction Heuristics trying 72 * 600 * 135 combinations for each of the 741 entities.

There's a few ways that could deal with this:


1) Basically, it's this "if (true)" would be false:
  https://github.com/kiegroup/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/config/constructionheuristic/placer/QueuedEntityPlacerConfig.java#L86
then it would try 72 + 600 + 135 combinations for each of the 741 entities, which is far more scalable (but reduces solution quality of the CH).

Unfortunately, that configuration property is not yet exposed in QueuedEntityPlacerConfig.java
(if it were, it would be a matter of copy pasting the advanced CH config from the docs and adding that flag).


2) Partitioned Search (use 7.0.0.CR1) heavily speeds up CH's, but you'll need to write a Partitioner, see the 7.x docs.
With 4 out of 8 cores we've seen a speed up of 30 times for cloud balancing CH's.


3) Limited selection CH's.


4) Write a custom phase to replace the CH, see *Initializer classes in examples.


HTH

With kind regards,
Geoffrey De Smet

--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To post to this group, send email to optapla...@googlegroups.com.
Visit this group at https://groups.google.com/group/optaplanner-dev.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages