Mathematical Modeling with LPL : Explain and run a Model
Problem Statement
Modeling Description
||
Back to MatMod
model golomb "Golomb Ruler"; parameter n := 9 "order"; set i,j,k := 1..n; integer variable mark{i} [0..70]; constraint A{i|i
j}(mark[i]-mark[j])); C: mark[1]=0 and mark[2]=1; minimize obj: mark[n]; integer parameter D{i,j|i>j}:=mark[i]-mark[j]; Draw.Scale(20,20); Draw.Text('A Golomb Ruler of order '&n,0,-1); Draw.Line(0,0,mark[n],0,0,2); {i} Draw.Line(mark,1,mark,-.5,0,2); {i} Draw.Text(mark&'',mark+.1,1); parameter y:=2; m:=0; {i,j|D} (m:=m+1, {i1 in i,j1 in j|D} (if(D[i1,j1]=m, (Draw.Line(m&'',mark[i1],y,mark[j1],y), y:=y+.8)) ) ); end
Problem Statement
Modeling Description
Back to model
The solution is as follows:
The LOG-File output of LPL is as follows: