Class Golomb


public class Golomb extends ExampleFD
It models a Golomb ruler problem.
Version:
4.9

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 Details

    • 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 List<IntVar> subs
      It contains all differences between all possible pairs of marks.
  • Constructor Details

    • Golomb

      public Golomb()
  • Method Details

    • model

      public void model()
      Description copied from class: ExampleFD
      It specifies a standard way of modeling the problem.
      Specified by:
      model in class ExampleFD
    • 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(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(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.