Compile with g++: g++ -O2 -o ruzsa ruzsa.cpp g++ -O2 -o ruzsa-reconstruct rusza-reconstruct.cpp ------------------------------------------------------------- To generate a ruler using ruzsa's construction: Let's say you need a ruler with 20 marks. You need the next prime number larger than 20, which is 23. Next, run ruzsa 20 23 It will produce a number of parameters for constructing rulers with 20 to 22 marks: 20 321 23 5 7 21 362 23 5 7 22 392 23 5 1 The output format is To get the actual ruler that was found for 20 marks, run ruzsa-reconstruct with the above parameters (use the 1st, 3rd, 4th and 5th as arguments, omit the second one): ruzsa-reconstruct 20 23 5 7 This will produce the actual golomb ruler with 20 marks and length 321 --------------------------------------------------------- There is another program called bose-fast.cpp. This can potentially generate shorter rulers since it uses a more advanced construction. It is however a bit harder to compile and will need some updates to get up to date. If you'd like to run it, let me know and I can help you with that. If you still have problems, email me.