Example: Finding optimal Golomb rulers More...
Public Types | |
enum | { SEARCH_BAB, SEARCH_RESTART } |
Search variants. More... |
Public Member Functions | |
GolombRuler (const SizeOptions &opt) | |
Actual model. | |
virtual IntVar | cost (void) const |
Return cost. | |
virtual void | print (std::ostream &os) const |
Print solution. | |
GolombRuler (bool share, GolombRuler &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
![]() | |
ScriptBase (void) | |
Default constructor. | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. | |
virtual void | compare (const Space &, std::ostream &os) const |
Compare with s. |
Protected Attributes | |
IntVarArray | m |
Array for ruler marks. |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. |
Additional Inherited Members | |
![]() | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt) |
Example: Finding optimal Golomb rulers
The script makes use of two lower bounds taken from: Barbara Smith, Kostas Stergiou, Toby Walsh, Modelling the Golomb Ruler Problem. In IJCAI 99 Workshop on Non-binary Constraints, 1999.
See also problem 6 at http://www.csplib.org/.
The upper bound used is from the trivial construction where distances between consecutive marks are increasing powers of two.
Note that "Modeling and Programming with Gecode" uses this example as a case study.
Definition at line 66 of file golomb-ruler.cpp.
anonymous enum |
Search variants.
Definition at line 72 of file golomb-ruler.cpp.
|
inline |
Actual model.
Definition at line 77 of file golomb-ruler.cpp.
|
inline |
Constructor for cloning s.
Definition at line 122 of file golomb-ruler.cpp.
|
inlinevirtual |
Return cost.
Definition at line 111 of file golomb-ruler.cpp.
|
inlinevirtual |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 117 of file golomb-ruler.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 128 of file golomb-ruler.cpp.
|
related |
Main-function.
Definition at line 137 of file golomb-ruler.cpp.
|
protected |
Array for ruler marks.
Definition at line 69 of file golomb-ruler.cpp.