Hi @fedja, progress looks good. First I tried to run your program using
asymptote.ualberta.ca unfortunately always timeout, also with small n and m. So I converted your program to JavaScript, looks currently more like Fortran, but seams to work. And the first results are very good. I have test data with n=60 and m=7 and can compare: Test 1: brute force Segments: [8, 8, 8, 9, 9, 10, 8], Mean: 11.096, Squarediff: 1.083, Stddev: 3.8 %, runtime 30.13 s Test 2: dyn prog (fedja) Segments: [8, 8, 8, 9, 9, 10, 8], Mean: 11.096, Squarediff: 1.083, Stddev: 3.8 %, runtime 222.1 ms