GolombRuler Class Reference
[Scripts for problems]
Inherits Example.
Detailed Description
Example: Finding optimal Golomb rulersThe 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/.
Definition at line 57 of file golomb-ruler.cc.
Public Types | |
enum | { MODEL_NONE, MODEL_SUM, MODEL_RULER } |
Model variants. More... | |
enum | { SEARCH_DFS, SEARCH_BAB, SEARCH_RESTART } |
Search variants. More... | |
Public Member Functions | |
int | diag (int i, int j) |
Return index for mark difference between mark i and mark j. | |
GolombRuler (const SizeOptions &opt) | |
Actual model. | |
void | constrain (Space *s) |
Add constraint for next better solution. | |
virtual void | print (std::ostream &os) |
Print solution. | |
GolombRuler (bool share, GolombRuler &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
Protected Attributes | |
const int | n |
Number of marks. | |
IntVarArray | m |
Array for ruler marks. |
Member Enumeration Documentation
anonymous enum |
Model variants.
- Enumerator:
-
MODEL_NONE No lower bound. MODEL_SUM Use sum of ticks as lower bound. MODEL_RULER Use size of smaller rulers as lower bound.
Definition at line 65 of file golomb-ruler.cc.
anonymous enum |
Search variants.
- Enumerator:
-
SEARCH_DFS Use depth first search to find the smallest tick. SEARCH_BAB Use branch and bound to optimize. SEARCH_RESTART Use restart to optimize.
Definition at line 71 of file golomb-ruler.cc.
Constructor & Destructor Documentation
GolombRuler::GolombRuler | ( | const SizeOptions & | opt | ) | [inline] |
GolombRuler::GolombRuler | ( | bool | share, | |
GolombRuler & | s | |||
) | [inline] |
Member Function Documentation
int GolombRuler::diag | ( | int | i, | |
int | j | |||
) | [inline] |
Return index for mark difference between mark i and mark j.
Definition at line 78 of file golomb-ruler.cc.
void GolombRuler::constrain | ( | Space * | s | ) | [inline] |
virtual void GolombRuler::print | ( | std::ostream & | os | ) | [inline, virtual] |
virtual Space* GolombRuler::copy | ( | bool | share | ) | [inline, virtual] |
Member Data Documentation
const int GolombRuler::n [protected] |
IntVarArray GolombRuler::m [protected] |
The documentation for this class was generated from the following file:
- examples/golomb-ruler.cc (Revision: 5524)