Mathematical Modeling with LPL : Explain and run a Model
Problem Statement
Modeling Description
||
Back to MatMod
model friends "Find Assignment"; set p:=[Anne Carl Eva Gustaf I]; r:=[French Sushi Pizzeria Greek Brauhaus]; w:=[Mon Tue Wed Thu Fri]; binary variable x{p,r,w}; constraint A{p}: sum{r,w} x = 1; B{r}: sum{p,w} x = 1; C{w}: sum{p,r} x = 1; M1{r}: ~x[5,r,5]; M2 : or{r} x[3,r,3]; M3 : or{p} x[p,5,5]; M4 : or{r|r<>2} x[2,r,1]; M5 : or{w} x[4,1,w]; M6{w|w>1}: x[4,1,w-1] -> or{p} x[p,3,w]; solve; Write{w,p,r|x}('On %s %s took us to the %s\n',w,p,r); end
Problem Statement
Modeling Description
Back to model
The solution is as follows:
The LOG-File output of LPL is as follows: