Page 1 of 1

Langford's Problem

Posted: Mon Jun 16, 2003 5:02 am
by Observer
Background:
Link: http://www.lclark.edu/~miller/langford.html
In short:
1. The sequence contains 2N integers, where N = 4x or 4x-1 .
2. Each of the integers between 1 and N appears twice in the sequence.
3. The two integers K in the sequence are separated by exactly K other numbers.
e.g. Solution for N = 3 is "3 1 2 1 3 2"

Now, I have to write a Pascal program to generate a single solution for any valid N(3 <= N <= 200). However, my program is extremely slow when N > 64 ... >_<

So, could anyone help me? Thx in advance!

Posted: Sat Jul 12, 2003 12:11 pm
by raymond85
I am interested in how people solve this problem too.
My friend told me that an algorithm called local search can be used.
However, I dont know what is local search and no one explained to me. Hope someone can help. Many thanks!