Class Golomb


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

    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 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.List<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: 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​(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.