Replies: 5 comments 14 replies
-
You can use Cbc's lotsize object for this: https://github.com/coin-or/Cbc/blob/master/examples/lotsize.cpp |
Beta Was this translation helpful? Give feedback.
-
@SanTanBan the repo link to Sudoku seems to be broken. |
Beta Was this translation helpful? Give feedback.
-
I don't understand the formulation. Valid values of the variables seem to be 0,1,3,7,15 etc but if I set x_1_4 in size 3 to 7 the problem is infeasible - just as an lp without lotsizing. |
Beta Was this translation helpful? Give feedback.
-
As I said in previous comment, I don't really understand what filtering means as all variables seem to be in. I think it sensible to try and get a simple formulation working - so I have uploaded sudoku3.cpp. This would be compiled from a Cbc/examples directory. If I solve a more difficult 9x9 one I get |
Beta Was this translation helpful? Give feedback.
-
One major flaw is that if a variable is fixed say to 31, this can not easily influence other variables. The most you can say is that another variable must be between 0 and 15 OR 63 and ... There is no easy cut to do that. You could try branching on smallest values first (and down) so that is a variable was 0 then other variables could have their lower bounds changed to 1 etc. This would mean having CbcLotsizeBranchingObjectAlt inheriting from Cbc....Object and writing specific code. I have written an example sudoku3.cpp (and the coding is far too hurried) which solves sudoku by all different, lotsizing and brute force backtracking. For a 9x9 sudoku All different 108 rows, 810 columns took 0.1800 seconds but for a 16x16 one |
Beta Was this translation helpful? Give feedback.
-
I earnestly request you to kindly guide me regarding the process of creating a new type of variable in the CBC Solver.
I have been requesting repeatedly for the introduction of a new variable which is necessary for me to show proof of something new which I have stumbled upon regarding a novel( possibly much faster) way of solving a specific type of problems.
This is presently possible using multiple Binary variables but I wish to use a novel method.
The concept of this new variable (which I shall hence refer to as Bucket Variables) is similar to the Binary Variables.
Binary Variables take only 0 and 1
Bucket Variables will take its values from among any value provided by the user, i.e. it may take values from [3,6,9] or from [0,1] as well. (This may also be extended to float; but I am in extreme need of integer Buckets only.)
I shall be extremely grateful to you.
Beta Was this translation helpful? Give feedback.
All reactions