0

I have a Directed Acyclic Graph, arcs are Entities and Weights associated do each Arc are the PlanningVariables. I use:

@ValueRangeProvider(id = "bufferRange")
public CountableValueRange<Integer> getDelayRange() {
    return ValueRangeFactory.createIntValueRange(1, 1000);
}

to assign values to my variables. Also, i've come across this issue: Exhaustive Search in OptaPlanner does not work on very simple example, which is now solved by setting variables from int to Integer and checking null values in the score calculation.

Now the problem is that the solver seems not to be backtraking when assigning values. I've used a print to check values being attributed to each arc. In the beginning of the solving process i can see values being set to different arcs. But after some time attributions the solver stucks in assigning values to the same arc. Checking the prints I see the attributions going from 1 to 1000 and then starting again. Since all values from the domain are tested one time, why the solver does not backtrack instead of assigning the same values again?

I tested with all the <nodeExplorationType> options and created a class to use the <entitySorterManner> with the same results.

Thanks in advance.

Community
  • 1
  • 1
the_grandson
  • 15
  • 10
  • Are you using DEBUG or TRACE logging? A debug log without trace log might false give the false impression that it's stuck in infinite loop. – Geoffrey De Smet Apr 22 '16 at 07:05
  • How many entities do you have? I see you have 999 planning values per variable and I presume 1 variable per entity. Do you see the same behaviour if you reduce the entity count and planning value count to a handful? – Geoffrey De Smet Apr 22 '16 at 07:06
  • Activated it to TRACE level so variable setting is shown. Lets consider this problem instance: I am using 5 entities, consequently there are 5 variables. If the range is reduced to 1 - 5 the solution is found the best solution is found in 0.685s. If I change the range to 1 - 50, the same behaviour happens. Solver keeps setting the same entity with redudundant values [link](http://pastebin.com/wQQvE0qz) (log result). – the_grandson Apr 22 '16 at 10:12
  • Could give you an example of a trace line that's redundant and show why it's redundant? As far as I know, although many nodes try the same variable range, each one starts from a different working solution. – Geoffrey De Smet Apr 22 '16 at 14:10
  • The previous comment has a link pointing to the trace using 5 entities and values in range 1 - 50. This link [Trace File](http://pastebin.com/NMe4jZc4) is from a run with 5 entities and value range 1 - 15. – the_grandson Apr 22 '16 at 16:14
  • If you compare lines 1 and 2 of the attached file `2539 [main] TRACE org.optaplanner.core.impl.exhaustivesearch.decider.ExhaustiveSearchDecider - Move treeId (4-10355), score (-2147483648hard/-2147483648soft), expandable (true), move (Edge to: p2 from: s3, BufferSzie: null {null -> 6}).` with lines 32 and 33 `2539 [main] TRACE org.optaplanner.core.impl.exhaustivesearch.decider.ExhaustiveSearchDecider - Move treeId (4-10370), score (-2147483648hard/-2147483648soft), expandable (true), move (Edge to: p2 from: s3, BufferSzie: null {null -> 6}).` seems to exist a cycle. – the_grandson Apr 22 '16 at 16:15
  • That's probably not a cycle, but 2 different working solutions (probably with the same score) that have the same score after that particular move. – Geoffrey De Smet Apr 22 '16 at 18:05

1 Answers1

1

I supose you are right Geoffrey, deactivated the log and let the program run for almost 48h and it came up with an answer. The way logs are printed mislead the analysis. Just for remark, if logger is deactivated the performance is considerably superior.

Community
  • 1
  • 1
the_grandson
  • 15
  • 10