[gecode-users] Problem with splitting Problem

Mohamed Rezgui kyo.alone at gmail.com
Wed Mar 27 16:16:19 CET 2013


Hi,

I give you the results when I make the fllowing changes
in createBranchers method:
           branch(*this, iv_sol, Gecode::INT_VAR_NONE(),
Gecode::INT_VAL_MIN());
           branch(*this, bv_sol, Gecode::INT_VAR_NONE(),
Gecode::INT_VAL_MIN());
instead of
           // branch(*this, iv_sol, INT_VAR_AFC_SIZE_MAX(0.99),
INT_VAL_MIN());
           // branch(*this, bv_sol, INT_VAR_AFC_MAX(0.99), INT_VAL_MIN());


and in choice method of AuxVarBranchers :
           branch(fzs,fzs.iv_aux,Gecode::INT_VAR_NONE(),
Gecode::INT_VAL_MIN());
           branch(fzs,fzs.bv_aux,Gecode::INT_VAR_NONE(),
Gecode::INT_VAL_MIN());
instead of
           // branch(fzs,fzs.iv_aux,INT_VAR_AFC_SIZE_MAX(),INT_VAL_MIN());
           // branch(fzs,fzs.bv_aux,INT_VAR_AFC_MAX(),INT_VAL_MIN());

The results are made with optimality proof. I decompose the problem into 80
suproblems

ENTIRE_PROBLEM :
=====UNSATISFIABLE=====
%%  instance:       sugiyama2_g5_7_7_7_7_2.fzn
%%  branch:       Gecode::INT_VAR_NONE(), Gecode::INT_VAL_MIN()
%%  add ub:       10
%%  runtime:       342.183 (342183 ms)
%%  solvetime:     342.159 (342159 ms)
%%  workers:     1
%%  solutions:     0
%%  type instance:     OPTIMISATION
%%  status:     UNSAT
%%  objective:     -1
%%  decision variables:     32
%%  variables:     791
%%  propagators:   837
%%  propagations:  1610969243
%%  nodes:         12386891
%%  failures:      6193446
%%  peak depth:    32
%%  peak memory:   771 KB

DECOMPOSITION_PROBLEM AND SOLVE ALL SUBPROBLEMS GENERATED
=====UNSATISFIABLE=====

%%  instance:       sugiyama2_g5_7_7_7_7_2.fzn
%%  branch:       Gecode::INT_VAR_NONE(), Gecode::INT_VAL_MIN()
%%  add ub:       10
%%  runtime:       877.188 (877188 ms)
%%  solvetime:     877.151 (877151 ms)
%%  workers:     1
%%  time decomposition:     0.008 (8 ms)
%%  solutions:     0
%%  type instance:     OPTIMISATION
%%  status:     UNSAT
%%  objective:     -1
%%  decision variables:     32
%%  variables:     791
%%  propagators:   837
%%  propagations:  3716058417
%%  nodes:         31126832
%%  failures:      15563456
%%  peak depth:    28
%%  peak memory:   727 KB
%%  depth decomposition:     5
%%  problems decomposition:     80
%%  nodes decomposition:         68
%%  failures decomposition:      1
%%  peak memory decomposition:   129 KB
%%  sum time problems:     877.136 (877136 ms)
%%  min time problems:     0.001 (1 ms)
%%  max time problems:     39.986 (39986 ms)
%%  time problems:     0.006 0.004 0.004 0.006 0.006 0.001 0.149 0.065
0.167 0.1
52 0.143 0.184 0.071 0.942 0.221 0.858 1.123 0.202 0.852 0.818 2.988 2.508
0.949
 3.16 2.596 0.78 6.419 2.923 7.218 4.022 3.852 6.93 3.031 14.584 5.063
10.064 11
.907 7.164 8.711 12.403 15.884 4.434 12.474 8.652 10.853 10.593 8.973
12.513 4.6
81 15.722 22.308 8.595 16.719 13.976 15.346 14.864 14.749 17.478 9.523
22.677 30
.464 14.172 22.169 19.844 20.718 19.951 20.451 21.455 14.463 30.439 39.986
20.43
4 28.129 26.596 25.985 24.996 27.071 27.233 20.379 37.941

All subproblems are distincts and I apply the constraint
Gecode::extensional(*space, iv, tuples) for each subproblem (that they are
a clone(false) of the flatzinc space.
iv are the variables I use for decomposition.

I give you all suproblems :

Problem 0
tuple[0, 0, 3, 1, 4]
tuple[0, 0, 3, 1, 5]
tuple[0, 0, 3, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 1
tuple[0, 0, 3, 1, 7]
tuple[0, 0, 4, 1, 3]
tuple[0, 0, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 2
tuple[0, 0, 4, 1, 6]
tuple[0, 0, 4, 1, 7]
tuple[0, 0, 5, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 3
tuple[0, 0, 5, 1, 4]
tuple[0, 0, 5, 1, 6]
tuple[0, 0, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 4
tuple[0, 0, 6, 1, 3]
tuple[0, 0, 6, 1, 4]
tuple[0, 0, 6, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 5
tuple[0, 0, 6, 1, 7]
tuple[0, 0, 7, 1, 3]
tuple[0, 0, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 6
tuple[0, 0, 7, 1, 5]
tuple[0, 0, 7, 1, 6]
tuple[1, 1, 3, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 7
tuple[1, 1, 3, 1, 5]
tuple[1, 1, 3, 1, 6]
tuple[1, 1, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 8
tuple[1, 1, 4, 1, 3]
tuple[1, 1, 4, 1, 5]
tuple[1, 1, 4, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 9
tuple[1, 1, 4, 1, 7]
tuple[1, 1, 5, 1, 3]
tuple[1, 1, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 10
tuple[1, 1, 5, 1, 6]
tuple[1, 1, 5, 1, 7]
tuple[1, 1, 6, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 11
tuple[1, 1, 6, 1, 4]
tuple[1, 1, 6, 1, 5]
tuple[1, 1, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 12
tuple[1, 1, 7, 1, 3]
tuple[1, 1, 7, 1, 4]
tuple[1, 1, 7, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 13
tuple[1, 1, 7, 1, 6]
tuple[2, 2, 3, 1, 4]
tuple[2, 2, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 14
tuple[2, 2, 3, 1, 6]
tuple[2, 2, 3, 1, 7]
tuple[2, 2, 4, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 15
tuple[2, 2, 4, 1, 5]
tuple[2, 2, 4, 1, 6]
tuple[2, 2, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 16
tuple[2, 2, 5, 1, 3]
tuple[2, 2, 5, 1, 4]
tuple[2, 2, 5, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 17
tuple[2, 2, 5, 1, 7]
tuple[2, 2, 6, 1, 3]
tuple[2, 2, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 18
tuple[2, 2, 6, 1, 5]
tuple[2, 2, 6, 1, 7]
tuple[2, 2, 7, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 19
tuple[2, 2, 7, 1, 4]
tuple[2, 2, 7, 1, 5]
tuple[2, 2, 7, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 20
tuple[3, 3, 3, 1, 4]
tuple[3, 3, 3, 1, 5]
tuple[3, 3, 3, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 21
tuple[3, 3, 3, 1, 7]
tuple[3, 3, 4, 1, 3]
tuple[3, 3, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 22
tuple[3, 3, 4, 1, 6]
tuple[3, 3, 4, 1, 7]
tuple[3, 3, 5, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 23
tuple[3, 3, 5, 1, 4]
tuple[3, 3, 5, 1, 6]
tuple[3, 3, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 24
tuple[3, 3, 6, 1, 3]
tuple[3, 3, 6, 1, 4]
tuple[3, 3, 6, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 25
tuple[3, 3, 6, 1, 7]
tuple[3, 3, 7, 1, 3]
tuple[3, 3, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 26
tuple[3, 3, 7, 1, 5]
tuple[3, 3, 7, 1, 6]
tuple[4, 4, 3, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 27
tuple[4, 4, 3, 1, 5]
tuple[4, 4, 3, 1, 6]
tuple[4, 4, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 28
tuple[4, 4, 4, 1, 3]
tuple[4, 4, 4, 1, 5]
tuple[4, 4, 4, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 29
tuple[4, 4, 4, 1, 7]
tuple[4, 4, 5, 1, 3]
tuple[4, 4, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 30
tuple[4, 4, 5, 1, 6]
tuple[4, 4, 5, 1, 7]
tuple[4, 4, 6, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 31
tuple[4, 4, 6, 1, 4]
tuple[4, 4, 6, 1, 5]
tuple[4, 4, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 32
tuple[4, 4, 7, 1, 3]
tuple[4, 4, 7, 1, 4]
tuple[4, 4, 7, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 33
tuple[4, 4, 7, 1, 6]
tuple[5, 5, 3, 1, 4]
tuple[5, 5, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 34
tuple[5, 5, 3, 1, 6]
tuple[5, 5, 3, 1, 7]
tuple[5, 5, 4, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 35
tuple[5, 5, 4, 1, 5]
tuple[5, 5, 4, 1, 6]
tuple[5, 5, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 36
tuple[5, 5, 5, 1, 3]
tuple[5, 5, 5, 1, 4]
tuple[5, 5, 5, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 37
tuple[5, 5, 5, 1, 7]
tuple[5, 5, 6, 1, 3]
tuple[5, 5, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 38
tuple[5, 5, 6, 1, 5]
tuple[5, 5, 6, 1, 7]
tuple[5, 5, 7, 1, 3]
iv[0, 1, 2, 3, 4]

Problem 39
tuple[5, 5, 7, 1, 4]
tuple[5, 5, 7, 1, 5]
tuple[5, 5, 7, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 40
tuple[6, 6, 3, 1, 4]
tuple[6, 6, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 41
tuple[6, 6, 3, 1, 6]
tuple[6, 6, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 42
tuple[6, 6, 4, 1, 3]
tuple[6, 6, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 43
tuple[6, 6, 4, 1, 6]
tuple[6, 6, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 44
tuple[6, 6, 5, 1, 3]
tuple[6, 6, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 45
tuple[6, 6, 5, 1, 6]
tuple[6, 6, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 46
tuple[6, 6, 6, 1, 3]
tuple[6, 6, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 47
tuple[6, 6, 6, 1, 5]
tuple[6, 6, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 48
tuple[6, 6, 7, 1, 3]
tuple[6, 6, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 49
tuple[6, 6, 7, 1, 5]
tuple[6, 6, 7, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 50
tuple[7, 7, 3, 1, 4]
tuple[7, 7, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 51
tuple[7, 7, 3, 1, 6]
tuple[7, 7, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 52
tuple[7, 7, 4, 1, 3]
tuple[7, 7, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 53
tuple[7, 7, 4, 1, 6]
tuple[7, 7, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 54
tuple[7, 7, 5, 1, 3]
tuple[7, 7, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 55
tuple[7, 7, 5, 1, 6]
tuple[7, 7, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 56
tuple[7, 7, 6, 1, 3]
tuple[7, 7, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 57
tuple[7, 7, 6, 1, 5]
tuple[7, 7, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 58
tuple[7, 7, 7, 1, 3]
tuple[7, 7, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 59
tuple[7, 7, 7, 1, 5]
tuple[7, 7, 7, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 60
tuple[8, 8, 3, 1, 4]
tuple[8, 8, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 61
tuple[8, 8, 3, 1, 6]
tuple[8, 8, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 62
tuple[8, 8, 4, 1, 3]
tuple[8, 8, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 63
tuple[8, 8, 4, 1, 6]
tuple[8, 8, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 64
tuple[8, 8, 5, 1, 3]
tuple[8, 8, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 65
tuple[8, 8, 5, 1, 6]
tuple[8, 8, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 66
tuple[8, 8, 6, 1, 3]
tuple[8, 8, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 67
tuple[8, 8, 6, 1, 5]
tuple[8, 8, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 68
tuple[8, 8, 7, 1, 3]
tuple[8, 8, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 69
tuple[8, 8, 7, 1, 5]
tuple[8, 8, 7, 1, 6]
iv[0, 1, 2, 3, 4]

Problem 70
tuple[9, 9, 3, 1, 4]
tuple[9, 9, 3, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 71
tuple[9, 9, 3, 1, 6]
tuple[9, 9, 3, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 72
tuple[9, 9, 4, 1, 3]
tuple[9, 9, 4, 1, 5]
iv[0, 1, 2, 3, 4]

Problem 73
tuple[9, 9, 4, 1, 6]
tuple[9, 9, 4, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 74
tuple[9, 9, 5, 1, 3]
tuple[9, 9, 5, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 75
tuple[9, 9, 5, 1, 6]
tuple[9, 9, 5, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 76
tuple[9, 9, 6, 1, 3]
tuple[9, 9, 6, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 77
tuple[9, 9, 6, 1, 5]
tuple[9, 9, 6, 1, 7]
iv[0, 1, 2, 3, 4]

Problem 78
tuple[9, 9, 7, 1, 3]
tuple[9, 9, 7, 1, 4]
iv[0, 1, 2, 3, 4]

Problem 79
tuple[9, 9, 7, 1, 5]
tuple[9, 9, 7, 1, 6]
iv[0, 1, 2, 3, 4]

>
>> 2013/3/27 Guido Tack <tack at gecode.org>
>>
>>> I couldn't find the attachment in the original mail so I can't verify
>>> this, but could you explain the difference between "decision variables" and
>>> "variables"? Are "decision variables" the ones you mention in the
>>> int_search annotation, and "variables" all variables in the model?
>>> If that is the case, then the problem could be that the search strategy
>>> on the 791-32=759 remaining variables is dynamic (it uses AFC-based
>>> search). The search tree of a smaller problem is therefore not necessarily
>>> smaller.  You could try to add more int_search annotations with static
>>> strategies to the FlatZinc so that all variables are covered and see if
>>> that changes the behaviour.
>>>
>>> Cheers,
>>> Guido
>>>
>>> On 27/03/2013, at 20:39 , Mohamed Rezgui <kyo.alone at gmail.com> wrote:
>>>
>>> Sorry,
>>>
>>> I forget about it. I choose the same search (lexicographic order) for
>>> all subproblems and for the entire problem.
>>> I used it for optimality proof. and I have the same thing. I verify all
>>> subproblems are distinct.
>>>
>>> That's my result with the optimality proof (obj = 11 so I set at obj-1):
>>>
>>> ENTIRE_PROBLEM :
>>> =====UNSATISFIABLE=====
>>> %%  instance:       sugiyama2_g5_7_7_7_7_2.fzn
>>> %%  search:       Gecode::INT_VAR_NONE(), Gecode::INT_VAL_MIN()
>>> %%  add ub:       10
>>> %%  runtime:       330.538 (330538 ms)
>>> %%  solvetime:     330.507 (330507 ms)
>>> %%  status:     UNSAT
>>> %%  objective:     -1
>>> %%  decision variables:     32
>>> %%  variables:     791
>>> %%  propagators:   837
>>> %%  propagations:  1610969243
>>> %%  nodes:         12386891
>>> %%  failures:      6193446
>>>
>>>
>>> DECOMPOSITION_PROBLEM AND SOLVE ALL SUBPROBLEMS GENERATED:
>>> =====UNSATISFIABLE=====
>>> %%  instance:       sugiyama2_g5_7_7_7_7_2.fzn
>>> %%  search:       Gecode::INT_VAR_NONE(), Gecode::INT_VAL_MIN()
>>> %%  add ub:       10
>>> %%  runtime:       833.92 (833920 ms)
>>> %%  status:     UNSAT
>>> %%  objective:     -1
>>> %%  decision variables:     32
>>> %%  variables:     791
>>> %%  propagators:   837
>>> %%  propagations:  3715375322
>>> %%  nodes:         31124812
>>> %%  failures:      15563406
>>> %%  time decomposition:     0.471 (471 ms)
>>> %%  nodes decomposition:         0
>>> %%  failures decomposition:      0
>>> %%  sum time problems:     833.404 (833404 ms)
>>> %%  min time problems:     0 (0 ms)
>>> %%  max time problems:     2.611 (2611 ms)
>>> %%  problems decomposition:     2000
>>>
>>> Best Regards,
>>> Mohammed REZGUI
>>>
>>> 2013/3/27 Christian Schulte <cschulte at kth.se>
>>>
>>>> Yes, please understand how branch and bound search works: there is no
>>>> guarantee that the decompositions need the same amount of search!****
>>>>
>>>> ** **
>>>>
>>>> C****
>>>>
>>>> ** **
>>>>
>>>> --****
>>>>
>>>> Christian Schulte, Professor of Computer Science, KTH,
>>>> www.ict.kth.se/~cschulte/****
>>>>
>>>> ** **
>>>>
>>>> *From:* Mohamed Rezgui [mailto:kyo.alone at gmail.com]
>>>> *Sent:* Wednesday, March 27, 2013 9:06 AM
>>>> *To:* cschulte at kth.se
>>>> *Cc:* users at gecode.org
>>>> *Subject:* Re: [gecode-users] Fwd: Problem with splitting Problem****
>>>>
>>>> ** **
>>>>
>>>> Thank you four your answer,****
>>>>
>>>> ** **
>>>>
>>>> I correct it with choosing only first variable for decomposition .  ***
>>>> *
>>>>
>>>> ** **
>>>>
>>>> But when I decomposed the problem into either 80 or 400, or 1000 or
>>>> 2000 sub problems and I resolve them ****
>>>>
>>>> (one after another and best solution is applied when it is found for
>>>> the next subproblem)****
>>>>
>>>> ** **
>>>>
>>>> I got 3 times more nodes and 3 times more failures with the same code
>>>> in my previous message !!!****
>>>>
>>>> ** **
>>>>
>>>> Can you help me about this problem please.****
>>>>
>>>> ** **
>>>>
>>>> Best Regards,****
>>>>
>>>> Mohammed REZGUI ****
>>>>
>>>> ** **
>>>>
>>>> 2013/3/22 Christian Schulte <cschulte at kth.se>****
>>>>
>>>> You might want to look at how much search is needed, just check the
>>>> statistics. The decomposition does not guarantee that you will use less
>>>> search.****
>>>>
>>>>  ****
>>>>
>>>> Christian****
>>>>
>>>>  ****
>>>>
>>>> --****
>>>>
>>>> Christian Schulte, www.ict.kth.se/~cschulte/****
>>>>
>>>>  ****
>>>>
>>>> *From:* users-bounces at gecode.org [mailto:users-bounces at gecode.org] *On
>>>> Behalf Of *Mohamed Rezgui
>>>> *Sent:* Friday, March 22, 2013 5:30 PM
>>>> *To:* users at gecode.org
>>>> *Subject:* [gecode-users] Fwd: Problem with splitting Problem****
>>>>
>>>>  ****
>>>>
>>>> Dear everybody,****
>>>>
>>>>  ****
>>>>
>>>> I have a problem with Gecode 4.0.0 (see the code below)****
>>>>
>>>> I can exhibit the issue on the following example****
>>>>
>>>>  ****
>>>>
>>>> I solve an optimization problem in the format flatzinc
>>>> "sugiyama2_g5_7_7_7_7_2.fzn" (it is attached). It takes 370s.****
>>>>
>>>> Then I cut the problem in two disjoint sub-problems P1 and P2 (Two
>>>> Spaces) ****
>>>>
>>>> P1 is P with (x3=1, x5=2, x30=30, x31=29) and
>>>>   ****
>>>>
>>>> P2 is P with (x3=1, x5=2, x30=29, x31=30)                        ****
>>>>
>>>>  ****
>>>>
>>>> First, I solve P1. This found a solution with a cost C1. Then I solve
>>>> P2 and add the cost constraint cost <C1 (ie constraint(c1) in gecode))*
>>>> ***
>>>>
>>>>  ****
>>>>
>>>> The issue is that P1 is solved in 355 seconds and P2 in 329 seconds !
>>>> The sum is 685s where the initial resolution takes 370s****
>>>>
>>>> I expected to have something close to 370s****
>>>>
>>>>  ****
>>>>
>>>> It seems that I have no problem if I add constraint on the first
>>>> variables (x0, x1,…) and that it does not work if I use any variables (like
>>>> here x3,x5,x30…)****
>>>>
>>>>  ****
>>>>
>>>> Thanks in advance for any remark****
>>>>
>>>>  ****
>>>>
>>>> Best Regards,****
>>>>
>>>> Mohammed REZGUI****
>>>>
>>>>  ****
>>>>
>>>> Here is my code:****
>>>>
>>>> <code>****
>>>>
>>>> //Init fg with sugiyama2_g5_7_7_7_7_2.fzn instance****
>>>>
>>>> FlatZincSpace* fg = FlatZinc::parse(...)****
>>>>
>>>> fg->createBranchers(...)****
>>>>
>>>> fg->shrinkArray(...)****
>>>>
>>>>  ****
>>>>
>>>> //vars_index[3, 5, 30, 31, ] => variables have the minimum doman size
>>>> in this problem****
>>>>
>>>> // it is fine If I use 4 first variables but it is not interesting for
>>>> me****
>>>>
>>>> //       ****
>>>>
>>>>  ****
>>>>
>>>>  ****
>>>>
>>>> //best solution used for P2 after****
>>>>
>>>> Space* best = NULL;****
>>>>
>>>> {****
>>>>
>>>>           FlatZincSpace* p1 =
>>>> static_cast<MyFlatZincSpace*>(fg->clone(false));****
>>>>
>>>>          ****
>>>>
>>>>           //vars_index[3, 5, 30, 31, ]                            ****
>>>>
>>>>           //tuple_val[1, 2, 29, 30, ]****
>>>>
>>>>           Gecode::rel(*p1, p1->iv[3], Gecode::IRT_EQ, 1);****
>>>>
>>>>           Gecode::rel(*p1, p1->iv[5], Gecode::IRT_EQ, 2);****
>>>>
>>>>           Gecode::rel(*p1, p1->iv[30], Gecode::IRT_EQ, 29);****
>>>>
>>>>           Gecode::rel(*p1, p1->iv[31], Gecode::IRT_EQ, 30);****
>>>>
>>>>             ****
>>>>
>>>>           Gecode::Search::Options opt;****
>>>>
>>>>           opt.threads = 1.0;****
>>>>
>>>>           Gecode::Search::Sequential::BAB bab(p1,
>>>> sizeof(MyFlatZincSpace), opt);****
>>>>
>>>>           Gecode::Space* s = bab.next();****
>>>>
>>>>           while(s) {****
>>>>
>>>>                       delete best;****
>>>>
>>>>                       best = s;****
>>>>
>>>>                       engine().solution(this);****
>>>>
>>>>                       s = bab.next();****
>>>>
>>>>           }****
>>>>
>>>>  ****
>>>>
>>>> }****
>>>>
>>>>  ****
>>>>
>>>> {****
>>>>
>>>>           FlatZincSpace* p2 =
>>>> static_cast<MyFlatZincSpace*>(fg->clone(false));****
>>>>
>>>>          ****
>>>>
>>>>           //vars_index[3, 5, 30, 31, ]                            ****
>>>>
>>>>           //tuple_val[1, 2, 30, 29, ]****
>>>>
>>>>           Gecode::rel(*p2, p2->iv[3], Gecode::IRT_EQ, 1);****
>>>>
>>>>           Gecode::rel(*p2, p2->iv[5], Gecode::IRT_EQ, 2);****
>>>>
>>>>           Gecode::rel(*p2, p2->iv[30], Gecode::IRT_EQ, 30);****
>>>>
>>>>           Gecode::rel(*p2, p2->iv[31], Gecode::IRT_EQ, 29);****
>>>>
>>>>     ****
>>>>
>>>>           if (best) {****
>>>>
>>>>                     p2->constrain(*best);****
>>>>
>>>>           }****
>>>>
>>>>          ****
>>>>
>>>>           Gecode::Search::Options opt;****
>>>>
>>>>           opt.threads = 1.0;****
>>>>
>>>>           Gecode::Search::Sequential::BAB bab(p2,
>>>> sizeof(MyFlatZincSpace), opt);****
>>>>
>>>>           Gecode::Space* s = bab.next();****
>>>>
>>>>           while(s) {****
>>>>
>>>>                       delete best;****
>>>>
>>>>                       best = s;****
>>>>
>>>>                       engine().solution(this);****
>>>>
>>>>                       s = bab.next();****
>>>>
>>>>           }****
>>>>
>>>>  ****
>>>>
>>>> }****
>>>>
>>>> </code>****
>>>>
>>>>
>>>>
>>>> ****
>>>>
>>>> ** **
>>>>
>>>> --
>>>> Cordialement,****
>>>>
>>>> Mohamed REZGUI
>>>>
>>>  _______________________________________________
>>> Gecode users mailing list
>>> users at gecode.org
>>> https://www.gecode.org/mailman/listinfo/gecode-users
>>>
>>>
>>>     --
>>> Guido Tack,
>>> http://www.csse.monash.edu/~guidot/
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Cordialement,
>> Mohamed REZGUI
>>
>
>
>
> --
> Cordialement,
> Mohamed REZGUI
>



-- 
Cordialement,
Mohamed REZGUI



-- 
Cordialement,
Mohamed REZGUI
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20130327/cc1358ae/attachment-0001.html>


More information about the users mailing list