sets
P /A,B,C/
se /1,2,3/;

table R(p,se) route sequence of each part
         1       2       3
A        1       3       4
B        1       2       4
C        2       3         ;


parameters
a(p);

a(p)=smax(se,R(p,se));

display a;