ExamplesJaCoP
Class Golomb

java.lang.Object
  extended by ExamplesJaCoP.Example
      extended by ExamplesJaCoP.Golomb

public class Golomb
extends Example

It models a Golomb ruler problem.

Author:
Radoslaw Szymanek and Krzysztof Kuchcinski Golomb ruler is a special sequence of natural numbers an example is 0 1 4 6 a sequence is a Golomb ruler if all differences are different (1-0), (4-0), (6-0), (4-1), (6-1), (6-4) 1 4 6 3 5 2 All differences above have different values A Golomb ruler is optimal if the length of it (the last mark) has the smallest possible value The presented ruler with 4 marks of length 6 is optimal

Field Summary
 int bound
          It specifies the upper bound of the optimal solution.
 int noMarks
          It specifies the number of marks (number of natural numbers in the sequence).
 java.util.ArrayList<IntVar> subs
          It contains all differences between all possible pairs of marks.
 
Fields inherited from class ExamplesJaCoP.Example
cost, search, store, vars
 
Constructor Summary
Golomb()
           
 
Method Summary
static void main(java.lang.String[] args)
          It executes the program which computes the optimal Golomb ruler.
 void model()
          It specifies a standard way of modeling the problem.
 boolean searchOptimalInfo()
          It specifies specific search for the optimal solution search procedure, which printouts intermediate search results and shows how the search is progressing.
static void test(java.lang.String[] args)
          It executes the program which first computes the optimal Golomb ruler.
 
Methods inherited from class ExamplesJaCoP.Example
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noMarks

public int noMarks
It specifies the number of marks (number of natural numbers in the sequence).


bound

public int bound
It specifies the upper bound of the optimal solution.


subs

public java.util.ArrayList<IntVar> subs
It contains all differences between all possible pairs of marks.

Constructor Detail

Golomb

public Golomb()
Method Detail

model

public void model()
Description copied from class: Example
It specifies a standard way of modeling the problem.

Specified by:
model in class Example

searchOptimalInfo

public boolean searchOptimalInfo()
It specifies specific search for the optimal solution search procedure, which printouts intermediate search results and shows how the search is progressing.

Returns:
true if the (optimal) solution is found, false if no solution found.

main

public static void main(java.lang.String[] args)
It executes the program which computes the optimal Golomb ruler.

Parameters:
args - the first argument specifies the number of marks, the second argument specifies the upper bound of the optimal solution.

test

public static void test(java.lang.String[] args)
It executes the program which first computes the optimal Golomb ruler. Afterwards, it computes all the optimal solutions but it does not use previously established cost of the optimal solution.

Parameters:
args - the first argument specifies the number of marks, the second argument specifies the upper bound of the optimal solution.