Jsun Yui Wong
Like Drezner [1], Heragu and Kusiak [2], and Heragu [3], but unlike Hillier [4] and Nugent, Vollmann, and Ruml [5], the present paper considers a layout problem with locations of sites not given. Specifically the problem of the computer program listed below is the n=30 problem of Nugent et al. [5] with an unknown plant shape, instead of the 5 by 6 plant shape [5, p. 158]. The computer program below attempts to find a cost minimizing shape and assignment (of facilities to locations).
Line 561 through line 995 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [2] and on page 140 of Heragu [3].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [6].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(522)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
45 FOR IOC=1 TO 90
46 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 90
53 N(IOCTT)=5
57 NEXT IOCTT
58 REM
59 REM
60 REM
61 FOR KLQ=1 TO 90
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 90
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 90
128 FOR I=1 TO 20
129 FOR KKQQ=1 TO 90
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 90
133 IF RND<=.5 THEN 298 ELSE 230
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*270)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+90*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 90
364 X(I222)=CINT(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<5/2 THEN 471 ELSE 491
471 IOCT1=1+FIX(RND*90)
474 IOCT2=1+FIX(RND*90)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=31+FIX(RND*30)
494 IOCT7=31+FIX(RND*30)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 REM
514 REM
517 REM
520 REM
522 REM
531 FOR IOCX=1 TO 90
533 IF X(IOCX)>5 THEN X(IOCX)=3
535 NEXT IOCX
537 REM
538 REM
539 REM
541 FOR IOCY=1 TO 90
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(31)-X(32))+ABS(X(61)-X(62))
562 P(12)=ABS(X(1)-X(3))+ABS(X(31)-X(33))+ABS(X(61)-X(63))
563 P(13)=ABS(X(1)-X(4))+ABS(X(31)-X(34))+ABS(X(61)-X(64))
564 P(14)=ABS(X(1)-X(5))+ABS(X(31)-X(35))+ABS(X(61)-X(65))
565 P(15)=ABS(X(1)-X(6))+ABS(X(31)-X(36))+ABS(X(61)-X(66))
566 P(16)=ABS(X(1)-X(7))+ABS(X(31)-X(37))+ABS(X(61)-X(67))
567 P(17)=ABS(X(1)-X(8))+ABS(X(31)-X(38))+ABS(X(61)-X(68))
568 P(18)=ABS(X(1)-X(9))+ABS(X(31)-X(39))+ABS(X(61)-X(69))
569 P(19)=ABS(X(1)-X(10))+ABS(X(31)-X(40))+ABS(X(61)-X(70))
570 P(20)=ABS(X(1)-X(11))+ABS(X(31)-X(41))+ABS(X(61)-X(71))
571 P(21)=ABS(X(1)-X(12))+ABS(X(31)-X(42))+ABS(X(61)-X(72))
572 P(22)=ABS(X(1)-X(13))+ABS(X(31)-X(43))+ABS(X(61)-X(73))
573 P(23)=ABS(X(1)-X(14))+ABS(X(31)-X(44))+ABS(X(61)-X(74))
574 P(24)=ABS(X(1)-X(15))+ABS(X(31)-X(45))+ABS(X(61)-X(75))
575 P(25)=ABS(X(1)-X(16))+ABS(X(31)-X(46))+ABS(X(61)-X(76))
576 P(26)=ABS(X(1)-X(17))+ABS(X(31)-X(47))+ABS(X(61)-X(77))
577 P(27)=ABS(X(1)-X(18))+ABS(X(31)-X(48))+ABS(X(61)-X(78))
578 P(28)=ABS(X(1)-X(19))+ABS(X(31)-X(49))+ABS(X(61)-X(79))
579 P(29)=ABS(X(1)-X(20))+ABS(X(31)-X(50))+ABS(X(61)-X(80))
580 P(30)=ABS(X(1)-X(21))+ABS(X(31)-X(51))+ABS(X(61)-X(81))
581 P(31)=ABS(X(1)-X(22))+ABS(X(31)-X(52))+ABS(X(61)-X(82))
582 P(32)=ABS(X(1)-X(23))+ABS(X(31)-X(53))+ABS(X(61)-X(83))
583 P(33)=ABS(X(1)-X(24))+ABS(X(31)-X(54))+ABS(X(61)-X(84))
584 P(34)=ABS(X(1)-X(25))+ABS(X(31)-X(55))+ABS(X(61)-X(85))
585 P(35)=ABS(X(1)-X(26))+ABS(X(31)-X(56))+ABS(X(61)-X(86))
586 P(36)=ABS(X(1)-X(27))+ABS(X(31)-X(57))+ABS(X(61)-X(87))
587 P(37)=ABS(X(1)-X(28))+ABS(X(31)-X(58))+ABS(X(61)-X(88))
588 P(38)=ABS(X(1)-X(29))+ABS(X(31)-X(59))+ABS(X(61)-X(89))
589 P(39)=ABS(X(1)-X(30))+ABS(X(31)-X(60))+ABS(X(61)-X(90))
590 P(40)=ABS(X(2)-X(3))+ABS(X(32)-X(33))+ABS(X(62)-X(63))
591 P(41)=ABS(X(2)-X(4))+ABS(X(32)-X(34))+ABS(X(62)-X(64))
592 P(42)=ABS(X(2)-X(5))+ABS(X(32)-X(35))+ABS(X(62)-X(65))
593 P(43)=ABS(X(2)-X(6))+ABS(X(32)-X(36))+ABS(X(62)-X(66))
594 P(44)=ABS(X(2)-X(7))+ABS(X(32)-X(37))+ABS(X(62)-X(67))
595 P(45)=ABS(X(2)-X(8))+ABS(X(32)-X(38))+ABS(X(62)-X(68))
596 P(46)=ABS(X(2)-X(9))+ABS(X(32)-X(39))+ABS(X(62)-X(69))
597 P(47)=ABS(X(2)-X(10))+ABS(X(32)-X(40))+ABS(X(62)-X(70))
598 P(48)=ABS(X(2)-X(11))+ABS(X(32)-X(41))+ABS(X(62)-X(71))
599 P(49)=ABS(X(2)-X(12))+ABS(X(32)-X(42))+ABS(X(62)-X(72))
600 P(50)=ABS(X(2)-X(13))+ABS(X(32)-X(43))+ABS(X(62)-X(73))
601 P(51)=ABS(X(2)-X(14))+ABS(X(32)-X(44))+ABS(X(62)-X(74))
602 P(52)=ABS(X(2)-X(15))+ABS(X(32)-X(45))+ABS(X(62)-X(75))
603 P(53)=ABS(X(2)-X(16))+ABS(X(32)-X(46))+ABS(X(62)-X(76))
604 P(54)=ABS(X(2)-X(17))+ABS(X(32)-X(47))+ABS(X(62)-X(77))
605 P(55)=ABS(X(2)-X(18))+ABS(X(32)-X(48))+ABS(X(62)-X(78))
606 P(56)=ABS(X(2)-X(19))+ABS(X(32)-X(49))+ABS(X(62)-X(79))
607 P(57)=ABS(X(2)-X(20))+ABS(X(32)-X(50))+ABS(X(62)-X(80))
608 P(58)=ABS(X(2)-X(21))+ABS(X(32)-X(51))+ABS(X(62)-X(81))
609 P(59)=ABS(X(2)-X(22))+ABS(X(32)-X(52))+ABS(X(62)-X(82))
610 P(60)=ABS(X(2)-X(23))+ABS(X(32)-X(53))+ABS(X(62)-X(83))
611 P(61)=ABS(X(2)-X(24))+ABS(X(32)-X(54))+ABS(X(62)-X(84))
612 P(62)=ABS(X(2)-X(25))+ABS(X(32)-X(55))+ABS(X(62)-X(85))
613 P(63)=ABS(X(2)-X(26))+ABS(X(32)-X(56))+ABS(X(62)-X(86))
614 P(64)=ABS(X(2)-X(27))+ABS(X(32)-X(57))+ABS(X(62)-X(87))
615 P(65)=ABS(X(2)-X(28))+ABS(X(32)-X(58))+ABS(X(62)-X(88))
616 P(66)=ABS(X(2)-X(29))+ABS(X(32)-X(59))+ABS(X(62)-X(89))
617 P(67)=ABS(X(2)-X(30))+ABS(X(32)-X(60))+ABS(X(62)-X(90))
618 P(68)=ABS(X(3)-X(4))+ABS(X(33)-X(34))+ABS(X(63)-X(64))
619 P(69)=ABS(X(3)-X(5))+ABS(X(33)-X(35))+ABS(X(63)-X(65))
620 P(70)=ABS(X(3)-X(6))+ABS(X(33)-X(36))+ABS(X(63)-X(66))
621 P(71)=ABS(X(3)-X(7))+ABS(X(33)-X(37))+ABS(X(63)-X(67))
622 P(72)=ABS(X(3)-X(8))+ABS(X(33)-X(38))+ABS(X(63)-X(68))
623 P(73)=ABS(X(3)-X(9))+ABS(X(33)-X(39))+ABS(X(63)-X(69))
624 P(74)=ABS(X(3)-X(10))+ABS(X(33)-X(40))+ABS(X(63)-X(70))
625 P(75)=ABS(X(3)-X(11))+ABS(X(33)-X(41))+ABS(X(63)-X(71))
626 P(76)=ABS(X(3)-X(12))+ABS(X(33)-X(42))+ABS(X(63)-X(72))
627 P(77)=ABS(X(3)-X(13))+ABS(X(33)-X(43))+ABS(X(63)-X(73))
628 P(78)=ABS(X(3)-X(14))+ABS(X(33)-X(44))+ABS(X(63)-X(74))
629 P(79)=ABS(X(3)-X(15))+ABS(X(33)-X(45))+ABS(X(63)-X(75))
630 P(80)=ABS(X(3)-X(16))+ABS(X(33)-X(46))+ABS(X(63)-X(76))
631 P(81)=ABS(X(3)-X(17))+ABS(X(33)-X(47))+ABS(X(63)-X(77))
632 P(82)=ABS(X(3)-X(18))+ABS(X(33)-X(48))+ABS(X(63)-X(78))
633 P(83)=ABS(X(3)-X(19))+ABS(X(33)-X(49))+ABS(X(63)-X(79))
634 P(84)=ABS(X(3)-X(20))+ABS(X(33)-X(50))+ABS(X(63)-X(80))
635 P(85)=ABS(X(3)-X(21))+ABS(X(33)-X(51))+ABS(X(63)-X(81))
636 P(86)=ABS(X(3)-X(22))+ABS(X(33)-X(52))+ABS(X(63)-X(82))
637 P(87)=ABS(X(3)-X(23))+ABS(X(33)-X(53))+ABS(X(63)-X(83))
638 P(88)=ABS(X(3)-X(24))+ABS(X(33)-X(54))+ABS(X(63)-X(84))
639 P(89)=ABS(X(3)-X(25))+ABS(X(33)-X(55))+ABS(X(63)-X(85))
640 P(90)=ABS(X(3)-X(26))+ABS(X(33)-X(56))+ABS(X(63)-X(86))
641 P(91)=ABS(X(3)-X(27))+ABS(X(33)-X(57))+ABS(X(63)-X(87))
642 P(92)=ABS(X(3)-X(28))+ABS(X(33)-X(58))+ABS(X(63)-X(88))
643 P(93)=ABS(X(3)-X(29))+ABS(X(33)-X(59))+ABS(X(63)-X(89))
644 P(94)=ABS(X(3)-X(30))+ABS(X(33)-X(60))+ABS(X(63)-X(90))
645 P(95)=ABS(X(4)-X(5))+ABS(X(34)-X(35))+ABS(X(64)-X(65))
646 P(96)=ABS(X(4)-X(6))+ABS(X(34)-X(36))+ABS(X(64)-X(66))
647 P(97)=ABS(X(4)-X(7))+ABS(X(34)-X(37))+ABS(X(64)-X(67))
648 P(98)=ABS(X(4)-X(8))+ABS(X(34)-X(38))+ABS(X(64)-X(68))
649 P(99)=ABS(X(4)-X(9))+ABS(X(34)-X(39))+ABS(X(64)-X(69))
650 P(100)=ABS(X(4)-X(10))+ABS(X(34)-X(40))+ABS(X(64)-X(70))
651 P(101)=ABS(X(4)-X(11))+ABS(X(34)-X(41))+ABS(X(64)-X(71))
652 P(102)=ABS(X(4)-X(12))+ABS(X(34)-X(42))+ABS(X(64)-X(72))
653 P(103)=ABS(X(4)-X(13))+ABS(X(34)-X(43))+ABS(X(64)-X(73))
654 P(104)=ABS(X(4)-X(14))+ABS(X(34)-X(44))+ABS(X(64)-X(74))
655 P(105)=ABS(X(4)-X(15))+ABS(X(34)-X(45))+ABS(X(64)-X(75))
656 P(106)=ABS(X(4)-X(16))+ABS(X(34)-X(46))+ABS(X(64)-X(76))
657 P(107)=ABS(X(4)-X(17))+ABS(X(34)-X(47))+ABS(X(64)-X(77))
658 P(108)=ABS(X(4)-X(18))+ABS(X(34)-X(48))+ABS(X(64)-X(78))
659 P(109)=ABS(X(4)-X(19))+ABS(X(34)-X(49))+ABS(X(64)-X(79))
660 P(110)=ABS(X(4)-X(20))+ABS(X(34)-X(50))+ABS(X(64)-X(80))
661 P(111)=ABS(X(4)-X(21))+ABS(X(34)-X(51))+ABS(X(64)-X(81))
662 P(112)=ABS(X(4)-X(22))+ABS(X(34)-X(52))+ABS(X(64)-X(82))
663 P(113)=ABS(X(4)-X(23))+ABS(X(34)-X(53))+ABS(X(64)-X(83))
664 P(114)=ABS(X(4)-X(24))+ABS(X(34)-X(54))+ABS(X(64)-X(84))
665 P(115)=ABS(X(4)-X(25))+ABS(X(34)-X(55))+ABS(X(64)-X(85))
666 P(116)=ABS(X(4)-X(26))+ABS(X(34)-X(56))+ABS(X(64)-X(86))
667 P(117)=ABS(X(4)-X(27))+ABS(X(34)-X(57))+ABS(X(64)-X(87))
668 P(118)=ABS(X(4)-X(28))+ABS(X(34)-X(58))+ABS(X(64)-X(88))
669 P(119)=ABS(X(4)-X(29))+ABS(X(34)-X(59))+ABS(X(64)-X(89))
670 P(120)=ABS(X(4)-X(30))+ABS(X(34)-X(60))+ABS(X(64)-X(90))
671 P(121)=ABS(X(5)-X(6))+ABS(X(35)-X(36))+ABS(X(65)-X(66))
672 P(122)=ABS(X(5)-X(7))+ABS(X(35)-X(37))+ABS(X(65)-X(67))
673 P(123)=ABS(X(5)-X(8))+ABS(X(35)-X(38))+ABS(X(65)-X(68))
674 P(124)=ABS(X(5)-X(9))+ABS(X(35)-X(39))+ABS(X(65)-X(69))
675 P(125)=ABS(X(5)-X(10))+ABS(X(35)-X(40))+ABS(X(65)-X(70))
676 P(126)=ABS(X(5)-X(11))+ABS(X(35)-X(41))+ABS(X(65)-X(71))
677 P(127)=ABS(X(5)-X(12))+ABS(X(35)-X(42))+ABS(X(65)-X(72))
678 P(128)=ABS(X(5)-X(13))+ABS(X(35)-X(43))+ABS(X(65)-X(73))
679 P(129)=ABS(X(5)-X(14))+ABS(X(35)-X(44))+ABS(X(65)-X(74))
680 P(130)=ABS(X(5)-X(15))+ABS(X(35)-X(45))+ABS(X(65)-X(75))
681 P(131)=ABS(X(5)-X(16))+ABS(X(35)-X(46))+ABS(X(65)-X(76))
682 P(132)=ABS(X(5)-X(17))+ABS(X(35)-X(47))+ABS(X(65)-X(77))
683 P(133)=ABS(X(5)-X(18))+ABS(X(35)-X(48))+ABS(X(65)-X(78))
684 P(134)=ABS(X(5)-X(19))+ABS(X(35)-X(49))+ABS(X(65)-X(79))
685 P(135)=ABS(X(5)-X(20))+ABS(X(35)-X(50))+ABS(X(65)-X(80))
686 P(136)=ABS(X(5)-X(21))+ABS(X(35)-X(51))+ABS(X(65)-X(81))
687 P(137)=ABS(X(5)-X(22))+ABS(X(35)-X(52))+ABS(X(65)-X(82))
688 P(138)=ABS(X(5)-X(23))+ABS(X(35)-X(53))+ABS(X(65)-X(83))
689 P(139)=ABS(X(5)-X(24))+ABS(X(35)-X(54))+ABS(X(65)-X(84))
690 P(140)=ABS(X(5)-X(25))+ABS(X(35)-X(55))+ABS(X(65)-X(85))
691 P(141)=ABS(X(5)-X(26))+ABS(X(35)-X(56))+ABS(X(65)-X(86))
692 P(142)=ABS(X(5)-X(27))+ABS(X(35)-X(57))+ABS(X(65)-X(87))
693 P(143)=ABS(X(5)-X(28))+ABS(X(35)-X(58))+ABS(X(65)-X(88))
694 P(144)=ABS(X(5)-X(29))+ABS(X(35)-X(59))+ABS(X(65)-X(89))
695 P(145)=ABS(X(5)-X(30))+ABS(X(35)-X(60))+ABS(X(65)-X(90))
696 P(146)=ABS(X(6)-X(7))+ABS(X(36)-X(37))+ABS(X(66)-X(67))
697 P(147)=ABS(X(6)-X(8))+ABS(X(36)-X(38))+ABS(X(66)-X(68))
698 P(148)=ABS(X(6)-X(9))+ABS(X(36)-X(39))+ABS(X(66)-X(69))
699 P(149)=ABS(X(6)-X(10))+ABS(X(36)-X(40))+ABS(X(66)-X(70))
700 P(150)=ABS(X(6)-X(11))+ABS(X(36)-X(41))+ABS(X(66)-X(71))
701 P(151)=ABS(X(6)-X(12))+ABS(X(36)-X(42))+ABS(X(66)-X(72))
702 P(152)=ABS(X(6)-X(13))+ABS(X(36)-X(43))+ABS(X(66)-X(73))
703 P(153)=ABS(X(6)-X(14))+ABS(X(36)-X(44))+ABS(X(66)-X(74))
704 P(154)=ABS(X(6)-X(15))+ABS(X(36)-X(45))+ABS(X(66)-X(75))
705 P(155)=ABS(X(6)-X(16))+ABS(X(36)-X(46))+ABS(X(66)-X(76))
706 P(156)=ABS(X(6)-X(17))+ABS(X(36)-X(47))+ABS(X(66)-X(77))
707 P(157)=ABS(X(6)-X(18))+ABS(X(36)-X(48))+ABS(X(66)-X(78))
708 P(158)=ABS(X(6)-X(19))+ABS(X(36)-X(49))+ABS(X(66)-X(79))
709 P(159)=ABS(X(6)-X(20))+ABS(X(36)-X(50))+ABS(X(66)-X(80))
710 P(160)=ABS(X(6)-X(21))+ABS(X(36)-X(51))+ABS(X(66)-X(81))
711 P(161)=ABS(X(6)-X(22))+ABS(X(36)-X(52))+ABS(X(66)-X(82))
712 P(162)=ABS(X(6)-X(23))+ABS(X(36)-X(53))+ABS(X(66)-X(83))
713 P(163)=ABS(X(6)-X(24))+ABS(X(36)-X(54))+ABS(X(66)-X(84))
714 P(164)=ABS(X(6)-X(25))+ABS(X(36)-X(55))+ABS(X(66)-X(85))
715 P(165)=ABS(X(6)-X(26))+ABS(X(36)-X(56))+ABS(X(66)-X(86))
716 P(166)=ABS(X(6)-X(27))+ABS(X(36)-X(57))+ABS(X(66)-X(87))
717 P(167)=ABS(X(6)-X(28))+ABS(X(36)-X(58))+ABS(X(66)-X(88))
718 P(168)=ABS(X(6)-X(29))+ABS(X(36)-X(59))+ABS(X(66)-X(89))
719 P(169)=ABS(X(6)-X(30))+ABS(X(36)-X(60))+ABS(X(66)-X(90))
720 P(170)=ABS(X(7)-X(8))+ABS(X(37)-X(38))+ABS(X(67)-X(68))
721 P(171)=ABS(X(7)-X(9))+ABS(X(37)-X(39))+ABS(X(67)-X(69))
722 P(172)=ABS(X(7)-X(10))+ABS(X(37)-X(40))+ABS(X(67)-X(70))
723 P(173)=ABS(X(7)-X(11))+ABS(X(37)-X(41))+ABS(X(67)-X(71))
724 P(174)=ABS(X(7)-X(12))+ABS(X(37)-X(42))+ABS(X(67)-X(72))
725 P(175)=ABS(X(7)-X(13))+ABS(X(37)-X(43))+ABS(X(67)-X(73))
726 P(176)=ABS(X(7)-X(14))+ABS(X(37)-X(44))+ABS(X(67)-X(74))
727 P(177)=ABS(X(7)-X(15))+ABS(X(37)-X(45))+ABS(X(67)-X(75))
728 P(178)=ABS(X(7)-X(16))+ABS(X(37)-X(46))+ABS(X(67)-X(76))
729 P(179)=ABS(X(7)-X(17))+ABS(X(37)-X(47))+ABS(X(67)-X(77))
730 P(180)=ABS(X(7)-X(18))+ABS(X(37)-X(48))+ABS(X(67)-X(78))
731 P(181)=ABS(X(7)-X(19))+ABS(X(37)-X(49))+ABS(X(67)-X(79))
732 P(182)=ABS(X(7)-X(20))+ABS(X(37)-X(50))+ABS(X(67)-X(80))
733 P(183)=ABS(X(7)-X(21))+ABS(X(37)-X(51))+ABS(X(67)-X(81))
734 P(184)=ABS(X(7)-X(22))+ABS(X(37)-X(52))+ABS(X(67)-X(82))
735 P(185)=ABS(X(7)-X(23))+ABS(X(37)-X(53))+ABS(X(67)-X(83))
736 P(186)=ABS(X(7)-X(24))+ABS(X(37)-X(54))+ABS(X(67)-X(84))
737 P(187)=ABS(X(7)-X(25))+ABS(X(37)-X(55))+ABS(X(67)-X(85))
738 P(188)=ABS(X(7)-X(26))+ABS(X(37)-X(56))+ABS(X(67)-X(86))
739 P(189)=ABS(X(7)-X(27))+ABS(X(37)-X(57))+ABS(X(67)-X(87))
740 P(190)=ABS(X(7)-X(28))+ABS(X(37)-X(58))+ABS(X(67)-X(88))
741 P(191)=ABS(X(7)-X(29))+ABS(X(37)-X(59))+ABS(X(67)-X(89))
742 P(192)=ABS(X(7)-X(30))+ABS(X(37)-X(60))+ABS(X(67)-X(90))
743 P(193)=ABS(X(8)-X(9))+ABS(X(38)-X(39))+ABS(X(68)-X(69))
744 P(194)=ABS(X(8)-X(10))+ABS(X(38)-X(40))+ABS(X(68)-X(70))
745 P(195)=ABS(X(8)-X(11))+ABS(X(38)-X(41))+ABS(X(68)-X(71))
746 P(196)=ABS(X(8)-X(12))+ABS(X(38)-X(42))+ABS(X(68)-X(72))
747 P(197)=ABS(X(8)-X(13))+ABS(X(38)-X(43))+ABS(X(68)-X(73))
748 P(198)=ABS(X(8)-X(14))+ABS(X(38)-X(44))+ABS(X(68)-X(74))
749 P(199)=ABS(X(8)-X(15))+ABS(X(38)-X(45))+ABS(X(68)-X(75))
750 P(200)=ABS(X(8)-X(16))+ABS(X(38)-X(46))+ABS(X(68)-X(76))
751 P(201)=ABS(X(8)-X(17))+ABS(X(38)-X(47))+ABS(X(68)-X(77))
752 P(202)=ABS(X(8)-X(18))+ABS(X(38)-X(48))+ABS(X(68)-X(78))
753 P(203)=ABS(X(8)-X(19))+ABS(X(38)-X(49))+ABS(X(68)-X(79))
754 P(204)=ABS(X(8)-X(20))+ABS(X(38)-X(50))+ABS(X(68)-X(80))
755 P(205)=ABS(X(8)-X(21))+ABS(X(38)-X(51))+ABS(X(68)-X(81))
756 P(206)=ABS(X(8)-X(22))+ABS(X(38)-X(52))+ABS(X(68)-X(82))
757 P(207)=ABS(X(8)-X(23))+ABS(X(38)-X(53))+ABS(X(68)-X(83))
758 P(208)=ABS(X(8)-X(24))+ABS(X(38)-X(54))+ABS(X(68)-X(84))
759 P(209)=ABS(X(8)-X(25))+ABS(X(38)-X(55))+ABS(X(68)-X(85))
760 P(210)=ABS(X(8)-X(26))+ABS(X(38)-X(56))+ABS(X(68)-X(86))
761 P(211)=ABS(X(8)-X(27))+ABS(X(38)-X(57))+ABS(X(68)-X(87))
762 P(212)=ABS(X(8)-X(28))+ABS(X(38)-X(58))+ABS(X(68)-X(88))
763 P(213)=ABS(X(8)-X(29))+ABS(X(38)-X(59))+ABS(X(68)-X(89))
764 P(214)=ABS(X(8)-X(30))+ABS(X(38)-X(60))+ABS(X(68)-X(90))
765 P(215)=ABS(X(9)-X(10))+ABS(X(39)-X(40))+ABS(X(69)-X(70))
766 P(216)=ABS(X(9)-X(11))+ABS(X(39)-X(41))+ABS(X(69)-X(71))
767 P(217)=ABS(X(9)-X(12))+ABS(X(39)-X(42))+ABS(X(69)-X(72))
768 P(218)=ABS(X(9)-X(13))+ABS(X(39)-X(43))+ABS(X(69)-X(73))
769 P(219)=ABS(X(9)-X(14))+ABS(X(39)-X(44))+ABS(X(69)-X(74))
770 P(220)=ABS(X(9)-X(15))+ABS(X(39)-X(45))+ABS(X(69)-X(75))
771 P(221)=ABS(X(9)-X(16))+ABS(X(39)-X(46))+ABS(X(69)-X(76))
772 P(222)=ABS(X(9)-X(17))+ABS(X(39)-X(47))+ABS(X(69)-X(77))
773 P(223)=ABS(X(9)-X(18))+ABS(X(39)-X(48))+ABS(X(69)-X(78))
774 P(224)=ABS(X(9)-X(19))+ABS(X(39)-X(49))+ABS(X(69)-X(79))
775 P(225)=ABS(X(9)-X(20))+ABS(X(39)-X(50))+ABS(X(69)-X(80))
776 P(226)=ABS(X(9)-X(21))+ABS(X(39)-X(51))+ABS(X(69)-X(81))
777 P(227)=ABS(X(9)-X(22))+ABS(X(39)-X(52))+ABS(X(69)-X(82))
778 P(228)=ABS(X(9)-X(23))+ABS(X(39)-X(53))+ABS(X(69)-X(83))
779 P(229)=ABS(X(9)-X(24))+ABS(X(39)-X(54))+ABS(X(69)-X(84))
780 P(230)=ABS(X(9)-X(25))+ABS(X(39)-X(55))+ABS(X(69)-X(85))
781 P(231)=ABS(X(9)-X(26))+ABS(X(39)-X(56))+ABS(X(69)-X(86))
782 P(232)=ABS(X(9)-X(27))+ABS(X(39)-X(57))+ABS(X(69)-X(87))
783 P(233)=ABS(X(9)-X(28))+ABS(X(39)-X(58))+ABS(X(69)-X(88))
784 P(234)=ABS(X(9)-X(29))+ABS(X(39)-X(59))+ABS(X(69)-X(89))
785 P(235)=ABS(X(9)-X(30))+ABS(X(39)-X(60))+ABS(X(69)-X(90))
786 P(236)=ABS(X(10)-X(11))+ABS(X(40)-X(41))+ABS(X(70)-X(71))
787 P(237)=ABS(X(10)-X(12))+ABS(X(40)-X(42))+ABS(X(70)-X(72))
788 P(238)=ABS(X(10)-X(13))+ABS(X(40)-X(43))+ABS(X(70)-X(73))
789 P(239)=ABS(X(10)-X(14))+ABS(X(40)-X(44))+ABS(X(70)-X(74))
790 P(240)=ABS(X(10)-X(15))+ABS(X(40)-X(45))+ABS(X(70)-X(75))
791 P(241)=ABS(X(10)-X(16))+ABS(X(40)-X(46))+ABS(X(70)-X(76))
792 P(242)=ABS(X(10)-X(17))+ABS(X(40)-X(47))+ABS(X(70)-X(77))
793 P(243)=ABS(X(10)-X(18))+ABS(X(40)-X(48))+ABS(X(70)-X(78))
794 P(244)=ABS(X(10)-X(19))+ABS(X(40)-X(49))+ABS(X(70)-X(79))
795 P(245)=ABS(X(10)-X(20))+ABS(X(40)-X(50))+ABS(X(70)-X(80))
796 P(246)=ABS(X(10)-X(21))+ABS(X(40)-X(51))+ABS(X(70)-X(81))
797 P(247)=ABS(X(10)-X(22))+ABS(X(40)-X(52))+ABS(X(70)-X(82))
798 P(248)=ABS(X(10)-X(23))+ABS(X(40)-X(53))+ABS(X(70)-X(83))
799 P(249)=ABS(X(10)-X(24))+ABS(X(40)-X(54))+ABS(X(70)-X(84))
800 P(250)=ABS(X(10)-X(25))+ABS(X(40)-X(55))+ABS(X(70)-X(85))
801 P(251)=ABS(X(10)-X(26))+ABS(X(40)-X(56))+ABS(X(70)-X(86))
802 P(252)=ABS(X(10)-X(27))+ABS(X(40)-X(57))+ABS(X(70)-X(87))
803 P(253)=ABS(X(10)-X(28))+ABS(X(40)-X(58))+ABS(X(70)-X(88))
804 P(254)=ABS(X(10)-X(29))+ABS(X(40)-X(59))+ABS(X(70)-X(89))
805 P(255)=ABS(X(10)-X(30))+ABS(X(40)-X(60))+ABS(X(70)-X(90))
806 P(256)=ABS(X(11)-X(12))+ABS(X(41)-X(42))+ABS(X(71)-X(72))
807 P(257)=ABS(X(11)-X(13))+ABS(X(41)-X(43))+ABS(X(71)-X(73))
808 P(258)=ABS(X(11)-X(14))+ABS(X(41)-X(44))+ABS(X(71)-X(74))
809 P(259)=ABS(X(11)-X(15))+ABS(X(41)-X(45))+ABS(X(71)-X(75))
810 P(260)=ABS(X(11)-X(16))+ABS(X(41)-X(46))+ABS(X(71)-X(76))
811 P(261)=ABS(X(11)-X(17))+ABS(X(41)-X(47))+ABS(X(71)-X(77))
812 P(262)=ABS(X(11)-X(18))+ABS(X(41)-X(48))+ABS(X(71)-X(78))
813 P(263)=ABS(X(11)-X(19))+ABS(X(41)-X(49))+ABS(X(71)-X(79))
814 P(264)=ABS(X(11)-X(20))+ABS(X(41)-X(50))+ABS(X(71)-X(80))
815 P(265)=ABS(X(11)-X(21))+ABS(X(41)-X(51))+ABS(X(71)-X(81))
816 P(266)=ABS(X(11)-X(22))+ABS(X(41)-X(52))+ABS(X(71)-X(82))
817 P(267)=ABS(X(11)-X(23))+ABS(X(41)-X(53))+ABS(X(71)-X(83))
818 P(268)=ABS(X(11)-X(24))+ABS(X(41)-X(54))+ABS(X(71)-X(84))
819 P(269)=ABS(X(11)-X(25))+ABS(X(41)-X(55))+ABS(X(71)-X(85))
820 P(270)=ABS(X(11)-X(26))+ABS(X(41)-X(56))+ABS(X(71)-X(86))
821 P(271)=ABS(X(11)-X(27))+ABS(X(41)-X(57))+ABS(X(71)-X(87))
822 P(272)=ABS(X(11)-X(28))+ABS(X(41)-X(58))+ABS(X(71)-X(88))
823 P(273)=ABS(X(11)-X(29))+ABS(X(41)-X(59))+ABS(X(71)-X(89))
824 P(274)=ABS(X(11)-X(30))+ABS(X(41)-X(60))+ABS(X(71)-X(90))
825 P(275)=ABS(X(12)-X(13))+ABS(X(42)-X(43))+ABS(X(72)-X(73))
826 P(276)=ABS(X(12)-X(14))+ABS(X(42)-X(44))+ABS(X(72)-X(74))
827 P(277)=ABS(X(12)-X(15))+ABS(X(42)-X(45))+ABS(X(72)-X(75))
828 P(278)=ABS(X(12)-X(16))+ABS(X(42)-X(46))+ABS(X(72)-X(76))
829 P(279)=ABS(X(12)-X(17))+ABS(X(42)-X(47))+ABS(X(72)-X(77))
830 P(280)=ABS(X(12)-X(18))+ABS(X(42)-X(48))+ABS(X(72)-X(78))
831 P(281)=ABS(X(12)-X(19))+ABS(X(42)-X(49))+ABS(X(72)-X(79))
832 P(282)=ABS(X(12)-X(20))+ABS(X(42)-X(50))+ABS(X(72)-X(80))
833 P(283)=ABS(X(12)-X(21))+ABS(X(42)-X(51))+ABS(X(72)-X(81))
834 P(284)=ABS(X(12)-X(22))+ABS(X(42)-X(52))+ABS(X(72)-X(82))
835 P(285)=ABS(X(12)-X(23))+ABS(X(42)-X(53))+ABS(X(72)-X(83))
836 P(286)=ABS(X(12)-X(24))+ABS(X(42)-X(54))+ABS(X(72)-X(84))
837 P(287)=ABS(X(12)-X(25))+ABS(X(42)-X(55))+ABS(X(72)-X(85))
838 P(288)=ABS(X(12)-X(26))+ABS(X(42)-X(56))+ABS(X(72)-X(86))
839 P(289)=ABS(X(12)-X(27))+ABS(X(42)-X(57))+ABS(X(72)-X(87))
840 P(290)=ABS(X(12)-X(28))+ABS(X(42)-X(58))+ABS(X(72)-X(88))
841 P(291)=ABS(X(12)-X(29))+ABS(X(42)-X(59))+ABS(X(72)-X(89))
842 P(292)=ABS(X(12)-X(30))+ABS(X(42)-X(60))+ABS(X(72)-X(90))
843 P(293)=ABS(X(13)-X(14))+ABS(X(43)-X(44))+ABS(X(73)-X(74))
844 P(294)=ABS(X(13)-X(15))+ABS(X(43)-X(45))+ABS(X(73)-X(75))
845 P(295)=ABS(X(13)-X(16))+ABS(X(43)-X(46))+ABS(X(73)-X(76))
846 P(296)=ABS(X(13)-X(17))+ABS(X(43)-X(47))+ABS(X(73)-X(77))
847 P(297)=ABS(X(13)-X(18))+ABS(X(43)-X(48))+ABS(X(73)-X(78))
848 P(298)=ABS(X(13)-X(19))+ABS(X(43)-X(49))+ABS(X(73)-X(79))
849 P(299)=ABS(X(13)-X(20))+ABS(X(43)-X(50))+ABS(X(73)-X(80))
850 P(300)=ABS(X(13)-X(21))+ABS(X(43)-X(51))+ABS(X(73)-X(81))
851 P(301)=ABS(X(13)-X(22))+ABS(X(43)-X(52))+ABS(X(73)-X(82))
852 P(302)=ABS(X(13)-X(23))+ABS(X(43)-X(53))+ABS(X(73)-X(83))
853 P(303)=ABS(X(13)-X(24))+ABS(X(43)-X(54))+ABS(X(73)-X(84))
854 P(304)=ABS(X(13)-X(25))+ABS(X(43)-X(55))+ABS(X(73)-X(85))
855 P(305)=ABS(X(13)-X(26))+ABS(X(43)-X(56))+ABS(X(73)-X(86))
856 P(306)=ABS(X(13)-X(27))+ABS(X(43)-X(57))+ABS(X(73)-X(87))
857 P(307)=ABS(X(13)-X(28))+ABS(X(43)-X(58))+ABS(X(73)-X(88))
858 P(308)=ABS(X(13)-X(29))+ABS(X(43)-X(59))+ABS(X(73)-X(89))
859 P(309)=ABS(X(13)-X(30))+ABS(X(43)-X(60))+ABS(X(73)-X(90))
860 P(310)=ABS(X(14)-X(15))+ABS(X(44)-X(45))+ABS(X(74)-X(75))
861 P(311)=ABS(X(14)-X(16))+ABS(X(44)-X(46))+ABS(X(74)-X(76))
862 P(312)=ABS(X(14)-X(17))+ABS(X(44)-X(47))+ABS(X(74)-X(77))
863 P(313)=ABS(X(14)-X(18))+ABS(X(44)-X(48))+ABS(X(74)-X(78))
864 P(314)=ABS(X(14)-X(19))+ABS(X(44)-X(49))+ABS(X(74)-X(79))
865 P(315)=ABS(X(14)-X(20))+ABS(X(44)-X(50))+ABS(X(74)-X(80))
866 P(316)=ABS(X(14)-X(21))+ABS(X(44)-X(51))+ABS(X(74)-X(81))
867 P(317)=ABS(X(14)-X(22))+ABS(X(44)-X(52))+ABS(X(74)-X(82))
868 P(318)=ABS(X(14)-X(23))+ABS(X(44)-X(53))+ABS(X(74)-X(83))
869 P(319)=ABS(X(14)-X(24))+ABS(X(44)-X(54))+ABS(X(74)-X(84))
870 P(320)=ABS(X(14)-X(25))+ABS(X(44)-X(55))+ABS(X(74)-X(85))
871 P(321)=ABS(X(14)-X(26))+ABS(X(44)-X(56))+ABS(X(74)-X(86))
872 P(322)=ABS(X(14)-X(27))+ABS(X(44)-X(57))+ABS(X(74)-X(87))
873 P(323)=ABS(X(14)-X(28))+ABS(X(44)-X(58))+ABS(X(74)-X(88))
874 P(324)=ABS(X(14)-X(29))+ABS(X(44)-X(59))+ABS(X(74)-X(89))
875 P(325)=ABS(X(14)-X(30))+ABS(X(44)-X(60))+ABS(X(74)-X(90))
876 P(326)=ABS(X(15)-X(16))+ABS(X(45)-X(46))+ABS(X(75)-X(76))
877 P(327)=ABS(X(15)-X(17))+ABS(X(45)-X(47))+ABS(X(75)-X(77))
878 P(328)=ABS(X(15)-X(18))+ABS(X(45)-X(48))+ABS(X(75)-X(78))
879 P(329)=ABS(X(15)-X(19))+ABS(X(45)-X(49))+ABS(X(75)-X(79))
880 P(330)=ABS(X(15)-X(20))+ABS(X(45)-X(50))+ABS(X(75)-X(80))
881 P(331)=ABS(X(15)-X(21))+ABS(X(45)-X(51))+ABS(X(75)-X(81))
882 P(332)=ABS(X(15)-X(22))+ABS(X(45)-X(52))+ABS(X(75)-X(82))
883 P(333)=ABS(X(15)-X(23))+ABS(X(45)-X(53))+ABS(X(75)-X(83))
884 P(334)=ABS(X(15)-X(24))+ABS(X(45)-X(54))+ABS(X(75)-X(84))
885 P(335)=ABS(X(15)-X(25))+ABS(X(45)-X(55))+ABS(X(75)-X(85))
886 P(336)=ABS(X(15)-X(26))+ABS(X(45)-X(56))+ABS(X(75)-X(86))
887 P(337)=ABS(X(15)-X(27))+ABS(X(45)-X(57))+ABS(X(75)-X(87))
888 P(338)=ABS(X(15)-X(28))+ABS(X(45)-X(58))+ABS(X(75)-X(88))
889 P(339)=ABS(X(15)-X(29))+ABS(X(45)-X(59))+ABS(X(75)-X(89))
890 P(340)=ABS(X(15)-X(30))+ABS(X(45)-X(60))+ABS(X(75)-X(90))
891 P(341)=ABS(X(16)-X(17))+ABS(X(46)-X(47))+ABS(X(76)-X(77))
892 P(342)=ABS(X(16)-X(18))+ABS(X(46)-X(48))+ABS(X(76)-X(78))
893 P(343)=ABS(X(16)-X(19))+ABS(X(46)-X(49))+ABS(X(76)-X(79))
894 P(344)=ABS(X(16)-X(20))+ABS(X(46)-X(50))+ABS(X(76)-X(80))
895 P(345)=ABS(X(16)-X(21))+ABS(X(46)-X(51))+ABS(X(76)-X(81))
896 P(346)=ABS(X(16)-X(22))+ABS(X(46)-X(52))+ABS(X(76)-X(82))
897 P(347)=ABS(X(16)-X(23))+ABS(X(46)-X(53))+ABS(X(76)-X(83))
898 P(348)=ABS(X(16)-X(24))+ABS(X(46)-X(54))+ABS(X(76)-X(84))
899 P(349)=ABS(X(16)-X(25))+ABS(X(46)-X(55))+ABS(X(76)-X(85))
900 P(350)=ABS(X(16)-X(26))+ABS(X(46)-X(56))+ABS(X(76)-X(86))
901 P(351)=ABS(X(16)-X(27))+ABS(X(46)-X(57))+ABS(X(76)-X(87))
902 P(352)=ABS(X(16)-X(28))+ABS(X(46)-X(58))+ABS(X(76)-X(88))
903 P(353)=ABS(X(16)-X(29))+ABS(X(46)-X(59))+ABS(X(76)-X(89))
904 P(354)=ABS(X(16)-X(30))+ABS(X(46)-X(60))+ABS(X(76)-X(90))
905 P(355)=ABS(X(17)-X(18))+ABS(X(47)-X(48))+ABS(X(77)-X(78))
906 P(356)=ABS(X(17)-X(19))+ABS(X(47)-X(49))+ABS(X(77)-X(79))
907 P(357)=ABS(X(17)-X(20))+ABS(X(47)-X(50))+ABS(X(77)-X(80))
908 P(358)=ABS(X(17)-X(21))+ABS(X(47)-X(51))+ABS(X(77)-X(81))
909 P(359)=ABS(X(17)-X(22))+ABS(X(47)-X(52))+ABS(X(77)-X(82))
910 P(360)=ABS(X(17)-X(23))+ABS(X(47)-X(53))+ABS(X(77)-X(83))
911 P(361)=ABS(X(17)-X(24))+ABS(X(47)-X(54))+ABS(X(77)-X(84))
912 P(362)=ABS(X(17)-X(25))+ABS(X(47)-X(55))+ABS(X(77)-X(85))
913 P(363)=ABS(X(17)-X(26))+ABS(X(47)-X(56))+ABS(X(77)-X(86))
914 P(364)=ABS(X(17)-X(27))+ABS(X(47)-X(57))+ABS(X(77)-X(87))
915 P(365)=ABS(X(17)-X(28))+ABS(X(47)-X(58))+ABS(X(77)-X(88))
916 P(366)=ABS(X(17)-X(29))+ABS(X(47)-X(59))+ABS(X(77)-X(89))
917 P(367)=ABS(X(17)-X(30))+ABS(X(47)-X(60))+ABS(X(77)-X(90))
918 P(368)=ABS(X(18)-X(19))+ABS(X(48)-X(49))+ABS(X(78)-X(79))
919 P(369)=ABS(X(18)-X(20))+ABS(X(48)-X(50))+ABS(X(78)-X(80))
920 P(370)=ABS(X(18)-X(21))+ABS(X(48)-X(51))+ABS(X(78)-X(81))
921 P(371)=ABS(X(18)-X(22))+ABS(X(48)-X(52))+ABS(X(78)-X(82))
922 P(372)=ABS(X(18)-X(23))+ABS(X(48)-X(53))+ABS(X(78)-X(83))
923 P(373)=ABS(X(18)-X(24))+ABS(X(48)-X(54))+ABS(X(78)-X(84))
924 P(374)=ABS(X(18)-X(25))+ABS(X(48)-X(55))+ABS(X(78)-X(85))
925 P(375)=ABS(X(18)-X(26))+ABS(X(48)-X(56))+ABS(X(78)-X(86))
926 P(376)=ABS(X(18)-X(27))+ABS(X(48)-X(57))+ABS(X(78)-X(87))
927 P(377)=ABS(X(18)-X(28))+ABS(X(48)-X(58))+ABS(X(78)-X(88))
928 P(378)=ABS(X(18)-X(29))+ABS(X(48)-X(59))+ABS(X(78)-X(89))
929 P(379)=ABS(X(18)-X(30))+ABS(X(48)-X(60))+ABS(X(78)-X(90))
930 P(380)=ABS(X(19)-X(20))+ABS(X(49)-X(50))+ABS(X(79)-X(80))
931 P(381)=ABS(X(19)-X(21))+ABS(X(49)-X(51))+ABS(X(79)-X(81))
932 P(382)=ABS(X(19)-X(22))+ABS(X(49)-X(52))+ABS(X(79)-X(82))
933 P(383)=ABS(X(19)-X(23))+ABS(X(49)-X(53))+ABS(X(79)-X(83))
934 P(384)=ABS(X(19)-X(24))+ABS(X(49)-X(54))+ABS(X(79)-X(84))
935 P(385)=ABS(X(19)-X(25))+ABS(X(49)-X(55))+ABS(X(79)-X(85))
936 P(386)=ABS(X(19)-X(26))+ABS(X(49)-X(56))+ABS(X(79)-X(86))
937 P(387)=ABS(X(19)-X(27))+ABS(X(49)-X(57))+ABS(X(79)-X(87))
938 P(388)=ABS(X(19)-X(28))+ABS(X(49)-X(58))+ABS(X(79)-X(88))
939 P(389)=ABS(X(19)-X(29))+ABS(X(49)-X(59))+ABS(X(79)-X(89))
940 P(390)=ABS(X(19)-X(30))+ABS(X(49)-X(60))+ABS(X(79)-X(90))
941 P(391)=ABS(X(20)-X(21))+ABS(X(50)-X(51))+ABS(X(80)-X(81))
942 P(392)=ABS(X(20)-X(22))+ABS(X(50)-X(52))+ABS(X(80)-X(82))
943 P(393)=ABS(X(20)-X(23))+ABS(X(50)-X(53))+ABS(X(80)-X(83))
944 P(394)=ABS(X(20)-X(24))+ABS(X(50)-X(54))+ABS(X(80)-X(84))
945 P(395)=ABS(X(20)-X(25))+ABS(X(50)-X(55))+ABS(X(80)-X(85))
946 P(396)=ABS(X(20)-X(26))+ABS(X(50)-X(56))+ABS(X(80)-X(86))
947 P(397)=ABS(X(20)-X(27))+ABS(X(50)-X(57))+ABS(X(80)-X(87))
948 P(398)=ABS(X(20)-X(28))+ABS(X(50)-X(58))+ABS(X(80)-X(88))
949 P(399)=ABS(X(20)-X(29))+ABS(X(50)-X(59))+ABS(X(80)-X(89))
950 P(400)=ABS(X(20)-X(30))+ABS(X(50)-X(60))+ABS(X(80)-X(90))
951 P(401)=ABS(X(21)-X(22))+ABS(X(51)-X(52))+ABS(X(81)-X(82))
952 P(402)=ABS(X(21)-X(23))+ABS(X(51)-X(53))+ABS(X(81)-X(83))
953 P(403)=ABS(X(21)-X(24))+ABS(X(51)-X(54))+ABS(X(81)-X(84))
954 P(404)=ABS(X(21)-X(25))+ABS(X(51)-X(55))+ABS(X(81)-X(85))
955 P(405)=ABS(X(21)-X(26))+ABS(X(51)-X(56))+ABS(X(81)-X(86))
956 P(406)=ABS(X(21)-X(27))+ABS(X(51)-X(57))+ABS(X(81)-X(87))
957 P(407)=ABS(X(21)-X(28))+ABS(X(51)-X(58))+ABS(X(81)-X(88))
958 P(408)=ABS(X(21)-X(29))+ABS(X(51)-X(59))+ABS(X(81)-X(89))
959 P(409)=ABS(X(21)-X(30))+ABS(X(51)-X(60))+ABS(X(81)-X(90))
960 P(410)=ABS(X(22)-X(23))+ABS(X(52)-X(53))+ABS(X(82)-X(83))
961 P(411)=ABS(X(22)-X(24))+ABS(X(52)-X(54))+ABS(X(82)-X(84))
962 P(412)=ABS(X(22)-X(25))+ABS(X(52)-X(55))+ABS(X(82)-X(85))
963 P(413)=ABS(X(22)-X(26))+ABS(X(52)-X(56))+ABS(X(82)-X(86))
964 P(414)=ABS(X(22)-X(27))+ABS(X(52)-X(57))+ABS(X(82)-X(87))
965 P(415)=ABS(X(22)-X(28))+ABS(X(52)-X(58))+ABS(X(82)-X(88))
966 P(416)=ABS(X(22)-X(29))+ABS(X(52)-X(59))+ABS(X(82)-X(89))
967 P(417)=ABS(X(22)-X(30))+ABS(X(52)-X(60))+ABS(X(82)-X(90))
968 P(418)=ABS(X(23)-X(24))+ABS(X(53)-X(54))+ABS(X(83)-X(84))
969 P(419)=ABS(X(23)-X(25))+ABS(X(53)-X(55))+ABS(X(83)-X(85))
970 P(420)=ABS(X(23)-X(26))+ABS(X(53)-X(56))+ABS(X(83)-X(86))
971 P(421)=ABS(X(23)-X(27))+ABS(X(53)-X(57))+ABS(X(83)-X(87))
972 P(422)=ABS(X(23)-X(28))+ABS(X(53)-X(58))+ABS(X(83)-X(88))
973 P(423)=ABS(X(23)-X(29))+ABS(X(53)-X(59))+ABS(X(83)-X(89))
974 P(424)=ABS(X(23)-X(30))+ABS(X(53)-X(60))+ABS(X(83)-X(90))
975 P(425)=ABS(X(24)-X(25))+ABS(X(54)-X(55))+ABS(X(84)-X(85))
976 P(426)=ABS(X(24)-X(26))+ABS(X(54)-X(56))+ABS(X(84)-X(86))
977 P(427)=ABS(X(24)-X(27))+ABS(X(54)-X(57))+ABS(X(84)-X(87))
978 P(428)=ABS(X(24)-X(28))+ABS(X(54)-X(58))+ABS(X(84)-X(88))
979 P(429)=ABS(X(24)-X(29))+ABS(X(54)-X(59))+ABS(X(84)-X(89))
980 P(430)=ABS(X(24)-X(30))+ABS(X(54)-X(60))+ABS(X(84)-X(90))
981 P(431)=ABS(X(25)-X(26))+ABS(X(55)-X(56))+ABS(X(85)-X(86))
982 P(432)=ABS(X(25)-X(27))+ABS(X(55)-X(57))+ABS(X(85)-X(87))
983 P(433)=ABS(X(25)-X(28))+ABS(X(55)-X(58))+ABS(X(85)-X(88))
984 P(434)=ABS(X(25)-X(29))+ABS(X(55)-X(59))+ABS(X(85)-X(89))
985 P(435)=ABS(X(25)-X(30))+ABS(X(55)-X(60))+ABS(X(85)-X(90))
986 P(436)=ABS(X(26)-X(27))+ABS(X(56)-X(57))+ABS(X(86)-X(87))
987 P(437)=ABS(X(26)-X(28))+ABS(X(56)-X(58))+ABS(X(86)-X(88))
988 P(438)=ABS(X(26)-X(29))+ABS(X(56)-X(59))+ABS(X(86)-X(89))
989 P(439)=ABS(X(26)-X(30))+ABS(X(56)-X(60))+ABS(X(86)-X(90))
990 P(440)=ABS(X(27)-X(28))+ABS(X(57)-X(58))+ABS(X(87)-X(88))
991 P(441)=ABS(X(27)-X(29))+ABS(X(57)-X(59))+ABS(X(87)-X(89))
992 P(442)=ABS(X(27)-X(30))+ABS(X(57)-X(60))+ABS(X(87)-X(90))
993 P(443)=ABS(X(28)-X(29))+ABS(X(58)-X(59))+ABS(X(88)-X(89))
994 P(444)=ABS(X(28)-X(30))+ABS(X(58)-X(60))+ABS(X(88)-X(90))
995 P(445)=ABS(X(29)-X(30))+ABS(X(59)-X(60))+ABS(X(89)-X(90))
1088 FOR INSI=11 TO 445
1091 IF P(INSI)<.5 THEN P(INSI)=999999! ELSE P(INSI)=P(INSI)
1095 NEXT INSI
1238 P11B=3*P(11)+2*P(12)+.001*P(13)+.001*P(14)+2*P(15)+10*P(16)+5*P(17)+.001*P(18)+5*P(19)+2*P(20)
1239 P12B=5*P(21)+.001*P(22)+.001*P(23)+2*P(24)
1240 P13B=.001*P(25)+5*P(26)+6*P(27)+3*P(28)+.001*P(29)+1*P(30)+10*P(31)+.001*P(32)+10*P(33)+2*P(34)+1*P(35)+1*P(36)+1*P(37)+.001*P(38)+1*P(39)
1241 P14B=4*P(40)+.001*P(41)+10*P(42)+4*P(43)+.001*P(44)+.001*P(45)+2*P(46)+2*P(47)+1*P(48)+.001*P(49)+5*P(50)+.001*P(51)+.001*P(52)+.001*P(53)+.001*P(54)
1242 P15B=2*P(55)+.001*P(56)+1*P(57)+6*P(58)+1*P(59)+.001*P(60)+1*P(61)+2*P(62)+2*P(63)+5*P(64)+1*P(65)+10*P(66)+5*P(67)
1243 P16B=3*P(68)+4*P(69)+.001*P(70)+5*P(71)+5*P(72)+5*P(73)+1*P(74)+4*P(75)+1*P(76)+.001*P(77)+4*P(78)+.001*P(79)+4*P(80)+.001*P(81)+6*P(82)
1244 P17B=3*P(83)+2*P(84)+5*P(85)+5*P(86)+2*P(87)+1*P(88)+.001*P(89)+.001*P(90)+3*P(91)+1*P(92)+.001*P(93)+2*P(94)+.001*P(95)+.001*P(96)+.001*P(97)
1245 P18B=2*P(98)+2*P(99)+.001*P(100)+6*P(101)+.001*P(102)+2*P(103)+5*P(104)+2*P(105)+5*P(106)+1*P(107)+1*P(108)+1*P(109)+1*P(110)+2*P(111)+2*P(112)
1246 P19B=4*P(113)+.001*P(114)+2*P(115)+.001*P(116)+2*P(117)+2*P(118)+5*P(119)+5*P(120)+5*P(121)+2*P(122)+.001*P(123)+.001*P(124)+.001*P(125)+.001*P(126)+2*P(127)
1247 P20B=.001*P(128)+.001*P(129)+.001*P(130)+.001*P(131)+2*P(132)+1*P(133)+.001*P(134)+.001*P(135)+2*P(136)+.001*P(137)+5*P(138)+1*P(139)+.001*P(140)+2*P(141)+1*P(142)
1248 P21B=.001*P(143)+2*P(144)+1*P(145)+1*P(146)+2*P(147)+2*P(148)+1*P(149)+4*P(150)+10*P(151)+10*P(152)+2*P(153)+5*P(154)+5*P(155)+.001*P(156)+5*P(157)
1249 P22B=.001*P(158)+.001*P(159)+.001*P(160)+10*P(161)+.001*P(162)+.001*P(163)+.001*P(164)+4*P(165)+.001*P(166)+10*P(167)+1*P(168)+1*P(169)+10*P(170)+10*P(171)+5*P(172)
1250 P23B=10*P(173)+10*P(174)+6*P(175)+.001*P(176)+.001*P(177)+10*P(178)+2*P(179)+1*P(180)+10*P(181)+1*P(182)+5*P(183)+5*P(184)+2*P(185)+3*P(186)+5*P(187)
1251 P24B=.001*P(188)+2*P(189)+.001*P(190)+1*P(191)+3*P(192)+1*P(193)+3*P(194)+5*P(195)+.001*P(196)+.001*P(197)+.001*P(198)+2*P(199)+4*P(200)+5*P(201)+2*P(202)
1252 P25B=10*P(203)+6*P(204)+.001*P(205)+5*P(206)+5*P(207)+2*P(208)+5*P(209)+.001*P(210)+5*P(211)+5*P(212)+.001*P(213)+2*P(214)+10*P(215)+2*P(216)+1*P(217)
1253 P26B=5*P(218)+2*P(219)+.001*P(220)+3*P(221)+.001*P(222)+2*P(223)+.001*P(224)+.001*P(225)+4*P(226)+.001*P(227)+5*P(228)+2*P(229)+.001*P(230)+5*P(231)+2*P(232)
1254 P27B=2*P(233)+5*P(234)+2*P(235)+5*P(236)+5*P(237)+6*P(238)+.001*P(239)+1*P(240)+5*P(241)+5*P(242)+.001*P(243)+5*P(244)+2*P(245)+3*P(246)+5*P(247)
1255 P28B=.001*P(248)+5*P(249)+2*P(250)+10*P(251)+10*P(252)+1*P(253)+5*P(254)+2*P(255)+.001*P(256)+.001*P(257)+1*P(258)+2*P(259)+1*P(260)+.001*P(261)+2*P(262)
1256 P29B=.001*P(263)+.001*P(264)+.001*P(265)+6*P(266)+6*P(267)+.001*P(268)+4*P(269)+5*P(270)+3*P(271)+2*P(272)+2*P(273)+10*P(274)+5*P(275)+5*P(276)+2*P(277)
1257 P30B=.001*P(278)+.001*P(279)+.001*P(280)+.001*P(281)+2*P(282)+.001*P(283)+4*P(284)+5*P(285)+10*P(286)+1*P(287)+.001*P(288)+.001*P(289)+.001*P(290)+.001*P(291)+1*P(292)
1258 P31B=2*P(293)+.001*P(294)+4*P(295)+2*P(296)+2*P(297)+1*P(298)+.001*P(299)+6*P(300)+2*P(301)+1*P(302)+5*P(303)+5*P(304)+.001*P(305)+.001*P(306)+1*P(307)
1259 P32B=5*P(308)+5*P(309)+2*P(310)+1*P(311)+.001*P(312)+5*P(313)+3*P(314)+10*P(315)+.001*P(316)+.001*P(317)+4*P(318)+2*P(319)+.001*P(320)+.001*P(321)+4*P(322)
1260 P33B=2*P(323)+5*P(324)+5*P(325)+4*P(326)+5*P(327)+1*P(328)+.001*P(329)+1*P(330)+.001*P(331)+5*P(332)+.001*P(333)+2*P(334)+.001*P(335)+.001*P(336)+5*P(337)
1261 P34B=1*P(338)+1*P(339)+.001*P(340)+.001*P(341)+3*P(342)+.001*P(343)+2*P(344)+2*P(345)+.001*P(346)+2*P(347)+.001*P(348)+5*P(349)+.001*P(350)+5*P(351)+2*P(352)
1262 P35B=5*P(353)+10*P(354)+2*P(355)+2*P(356)+.001*P(357)+.001*P(358)+.001*P(359)+6*P(360)+5*P(361)+3*P(362)+5*P(363)+.001*P(364)+.001*P(365)+5*P(366)+1*P(367)
1263 P36B=5*P(368)+1*P(369)+2*P(370)+10*P(371)+10*P(372)+4*P(373)+.001*P(374)+.001*P(375)+5*P(376)+.001*P(377)+.001*P(378)+.001*P(379)+.001*P(380)+5*P(381)+5*P(382)
1264 P38B=1*P(383)+.001*P(384)+5*P(385)+2*P(386)+1*P(387)+2*P(388)+10*P(389)+10*P(390)+5*P(391)+2*P(392)+1*P(393)+3*P(394)+1*P(395)+5*P(396)+6*P(397)
1265 P39B=5*P(398)+5*P(399)+3*P(400)+4*P(401)+.001*P(402)+1*P(403)+.001*P(404)+.001*P(405)+.001*P(406)+5*P(407)+.001*P(408)+.001*P(409)+5*P(410)+.001*P(411)+4*P(412)
1266 P40B=4*P(413)+5*P(414)+.001*P(415)+2*P(416)+5*P(417)+.001*P(418)+4*P(419)+4*P(420)+1*P(421)+.001*P(422)+2*P(423)+2*P(424)+5*P(425)+5*P(426)+.001*P(427)
1267 P41B=1*P(428)+.001*P(429)+.001*P(430)+1*P(431)+.001*P(432)+10*P(433)+1*P(434)+.001*P(435)+.001*P(436)+.001*P(437)+.001*P(438)+.001*P(439)+.001*P(440)+.001*P(441)+10*P(442)
1268 P42B=2*P(443)+2*P(444)+2*P(445)
1388 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B+P21B+P22B+P23B+P24B+P25B+P26B
1395 P2=P27B+P28B+P29B+P30B+P31B+P32B+P33B+P34B+P35B+P36B+P37B+P38B+P39B+P40B+P41B+P42B
1397 P4=0
1398 P3=0
1448 P5=P1+P2+P3+P4
1450 P=-P5
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P5
1454 FOR KLX=1 TO 90
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1778 REM
1888 NEXT JJJ
1890 IF M>-2733 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12),A(13),A(14),A(15)
1922 PRINT A(16),A(17),A(18),A(19),A(20)
1923 PRINT A(21),A(22),A(23),A(24),A(25)
1924 PRINT A(26),A(27),A(28),A(29),A(30)
1925 PRINT A(31),A(32),A(33),A(34),A(35)
1926 PRINT A(36),A(37),A(38),A(39),A(40)
1927 PRINT A(41),A(42),A(43),A(44),A(45)
1928 PRINT A(46),A(47),A(48),A(49),A(50)
1929 PRINT A(51),A(52),A(53),A(54),A(55)
1930 PRINT A(56),A(57),A(58),A(59),A(60)
1931 PRINT A(61),A(62),A(63),A(64),A(65)
1932 PRINT A(66),A(67),A(68),A(69),A(70)
1933 PRINT A(71),A(72),A(73),A(74),A(75)
1934 PRINT A(76),A(77),A(78),A(79),A(80)
1935 PRINT A(81),A(82),A(83),A(84),A(85)
1936 PRINT A(86),A(87),A(88),A(89),A(90)
1999 NEXT JJJJ
The .001s of line 1238 and other lines above are the 0s of the n=30 case, Nugent et al. [5, p. 170].
This BASIC computer program was run with the IBM basica/D interpreter, and its output through JJJJ=-31980 (in compressed form and to be interpreted in accordance with line 1916 through line 1936; copied manually from the computer monitor) is presented below.
-31984 -2698.471 2698.471
2 2 1 1 1
3 2 2 1 2
2 3 3 0 3
3 2 3 2 0
1 2 1 2 3
1 3 2 1 2
3 4 3 2 4
3 3 1 3 2
2 3 4 3 1
2 1 3 1 2
3 3 2 4 2
2 2 2 1 2
2 3 3 4 3
4 3 4 2 2
4 2 3 3 3
3 2 3 3 3
4 4 3 2 4
2 2 5 3 3
-31980 -2702.486 2702.486
4 4 3 3 3
4 2 3 2 4
4 2 2 3 4
3 3 3 3 3
2 4 3 2 2
4 4 2 3 3
3 2 2 3 3
1 2 2 2 2
3 2 1 1 1
1 3 3 2 1
2 2 4 3 3
3 2 1 1 2
3 4 3 1 4
3 2 2 1 2
2 3 3 3 2
2 2 3 4 1
4 3 2 3 2
1 1 2 4 1
The better objective function value, shown above, is 2698 at JJJJ=-31984. (The last three digits of 2698.471 shown above should be disregarded because these are due to the artificial flows, the .001s.) One notes that 3062, the minimum objective function value of the older problem [7], to 2698 is 1.1349 to 1.
The output above was produced in 20 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 21, one may or may not obtain 2698, which may or may not be optimal. That leads to a general remedy that in general, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] Z. Drezner, DISCON: A New Method for the Layout Problem, Operations Research 28 (1980) 1375-1384.
[2] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[3] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[4] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[5] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[6] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
[7] E. M. Loiola, N. M. M. de Abreu, P. O. Boaventura-Netto, P. Hahn, T. Querido, A survey for the quadratic assignment problem, European Journal of Operational Research 176 (2007) 657-690.
Monday, December 1, 2008
Monday, November 17, 2008
An Integer Programming Computer Program Applied to a Widely-Known Assignment Problem
Jsun Yui Wong
The problem considered here is the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2]. Line 561 through line 626 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1328 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 24
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 12
53 N(IOCTT)=3
57 NEXT IOCTT
58 FOR IOCTT=13 TO 24
59 N(IOCTT)=2
60 NEXT IOCTT
61 FOR KLQ=1 TO 24
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 24
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 24
128 FOR I=1 TO 3
129 FOR KKQQ=1 TO 24
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 24
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*72)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+24*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 24
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/2 THEN 471 ELSE 491
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 12
533 IF X(IOCX)>3 THEN X(IOCX)=3
535 NEXT IOCX
537 FOR IOCXX=13 TO 24
538 IF X(IOCXX)>2 THEN X(IOCXX)=2
539 NEXT IOCXX
541 FOR IOCY=1 TO 24
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))
788 FOR INSI=11 TO 76
791 IF P(INSI)<.5 THEN P(INSI)=9999 ELSE P(INSI)=P(INSI)
795 NEXT INSI
1321 P11B=5*P(11)+2*P(12)+4*P(13)+1*P(14)+.01*P(15)+.01*P(16)+6*P(17)+2*P(18)+1*P(19)+1*P(20)+1*P(21)
1322 P12B=3*P(22)+.01*P(23)+2*P(24)+2*P(25)+2*P(26)+.01*P(27)+4*P(28)+5*P(29)+.01*P(30)+.01*P(31)
1323 P13B=.01*P(32)+.01*P(33)+.01*P(34)+.01*P(35)+5*P(36)+5*P(37)+2*P(38)+2*P(39)+2*P(40)
1324 P14B=5*P(41)+2*P(42)+2*P(43)+10*P(44)+.01*P(45)+.01*P(46)+5*P(47)+5*P(48)
1325 P15B=10*P(49)+.01*P(50)+.01*P(51)+.01*P(52)+5*P(53)+1*P(54)+1*P(55)
1326 P16B=5*P(56)+1*P(57)+1*P(58)+5*P(59)+4*P(60)+.01*P(61)
1327 P17B=10*P(62)+5*P(63)+2*P(64)+3*P(65)+3*P(66)+.01*P(67)+.01*P(68)+5*P(69)+.01*P(70)
1328 P18B=.01*P(71)+10*P(72)+10*P(73)+5*P(74)+.01*P(75)+2*P(76)
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B
1448 P6=P1+0+0+0+0
1449 PS1=0
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 24
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-295 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24),JJJJ,M,PP1
1999 NEXT JJJJ
The .01s above are the 0s of the n=12 case, Nugent et al. [2, p. 168].
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions through JJJJ=-30497 (in compressed form and to be interpreted in accordance with line 1916 through line 1926; copied manually from the computer monitor) are presented below.
-31908 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 2 0 1 2
2 0 1 0 2
1 0 -31908 -289.65 289.65
-31625 -291.64 291.64
3 3 3 0 0
1 2 2 1 2
1 0
1 0 2 1 0
0 2 1 2 0
1 2 -31625 -291.64 291.64
-30901 -291.64 291.64
3 3 3 0 0
1 2 2 1 2
1 0
1 0 2 1 0
0 2 1 2 0
1 2 -30901 -291.64 291.64
-30896 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 0 2 1 0
0 2 1 2 0
1 2 -30896 -289.65 289.65
-30497 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 2 0 1 2
2 0 1 0 2
1 0 -30497 -289.65 289.65
The best candidate solutions shown above are at JJJJ=-31908, JJJJ=-30896, and JJJJ=-30497 with an objective function value of 289.65. (The last two digits, 6 and 5, should be disregarded because these are due to the artificial flows, the .01s.)
The output above was produced in 10 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 4, one may or may not obtain 289, which is optimal. That leads to a general remedy that in general, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
The problem considered here is the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2]. Line 561 through line 626 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1328 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 24
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 12
53 N(IOCTT)=3
57 NEXT IOCTT
58 FOR IOCTT=13 TO 24
59 N(IOCTT)=2
60 NEXT IOCTT
61 FOR KLQ=1 TO 24
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 24
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 24
128 FOR I=1 TO 3
129 FOR KKQQ=1 TO 24
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 24
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*72)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+24*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 24
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/2 THEN 471 ELSE 491
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 12
533 IF X(IOCX)>3 THEN X(IOCX)=3
535 NEXT IOCX
537 FOR IOCXX=13 TO 24
538 IF X(IOCXX)>2 THEN X(IOCXX)=2
539 NEXT IOCXX
541 FOR IOCY=1 TO 24
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))
788 FOR INSI=11 TO 76
791 IF P(INSI)<.5 THEN P(INSI)=9999 ELSE P(INSI)=P(INSI)
795 NEXT INSI
1321 P11B=5*P(11)+2*P(12)+4*P(13)+1*P(14)+.01*P(15)+.01*P(16)+6*P(17)+2*P(18)+1*P(19)+1*P(20)+1*P(21)
1322 P12B=3*P(22)+.01*P(23)+2*P(24)+2*P(25)+2*P(26)+.01*P(27)+4*P(28)+5*P(29)+.01*P(30)+.01*P(31)
1323 P13B=.01*P(32)+.01*P(33)+.01*P(34)+.01*P(35)+5*P(36)+5*P(37)+2*P(38)+2*P(39)+2*P(40)
1324 P14B=5*P(41)+2*P(42)+2*P(43)+10*P(44)+.01*P(45)+.01*P(46)+5*P(47)+5*P(48)
1325 P15B=10*P(49)+.01*P(50)+.01*P(51)+.01*P(52)+5*P(53)+1*P(54)+1*P(55)
1326 P16B=5*P(56)+1*P(57)+1*P(58)+5*P(59)+4*P(60)+.01*P(61)
1327 P17B=10*P(62)+5*P(63)+2*P(64)+3*P(65)+3*P(66)+.01*P(67)+.01*P(68)+5*P(69)+.01*P(70)
1328 P18B=.01*P(71)+10*P(72)+10*P(73)+5*P(74)+.01*P(75)+2*P(76)
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B
1448 P6=P1+0+0+0+0
1449 PS1=0
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 24
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-295 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24),JJJJ,M,PP1
1999 NEXT JJJJ
The .01s above are the 0s of the n=12 case, Nugent et al. [2, p. 168].
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions through JJJJ=-30497 (in compressed form and to be interpreted in accordance with line 1916 through line 1926; copied manually from the computer monitor) are presented below.
-31908 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 2 0 1 2
2 0 1 0 2
1 0 -31908 -289.65 289.65
-31625 -291.64 291.64
3 3 3 0 0
1 2 2 1 2
1 0
1 0 2 1 0
0 2 1 2 0
1 2 -31625 -291.64 291.64
-30901 -291.64 291.64
3 3 3 0 0
1 2 2 1 2
1 0
1 0 2 1 0
0 2 1 2 0
1 2 -30901 -291.64 291.64
-30896 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 0 2 1 0
0 2 1 2 0
1 2 -30896 -289.65 289.65
-30497 -289.65 289.65
0 0 0 3 3
2 2 2 1 1
1 3
1 2 0 1 2
2 0 1 0 2
1 0 -30497 -289.65 289.65
The best candidate solutions shown above are at JJJJ=-31908, JJJJ=-30896, and JJJJ=-30497 with an objective function value of 289.65. (The last two digits, 6 and 5, should be disregarded because these are due to the artificial flows, the .01s.)
The output above was produced in 10 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 4, one may or may not obtain 289, which is optimal. That leads to a general remedy that in general, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
Saturday, November 15, 2008
An Integer Programming Computer Program Applied to a Three-Dimensional Layout Problem
Jsun Yui Wong
The problem considered here is essentially the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2] plus a change to more than 12 locations spread over three dimensions. The same interfacility flows [1, p. 33; 2, p. 168] are used here. So one knows the minimum objective function value to this newer problem is 289 [2, p. 159] or smaller.
Line 561 through line 626 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1328 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
A computer program that is identical to the one listed below with the exception of line 128, 128 FOR I=1 TO 3 for the former, produced no computational results after six hours of running. Then the following computer program was inputted.
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 36
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 36
53 N(IOCTT)=2
57 NEXT IOCTT
61 FOR KLQ=1 TO 36
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 36
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 36
128 FOR I=1 TO 10
129 FOR KKQQ=1 TO 36
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 36
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*108)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+36*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 36
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/3 THEN 471 ELSE IF RND<1/2 THEN 491 ELSE 511
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 36
533 IF X(IOCX)>2 THEN X(IOCX)=1
535 NEXT IOCX
541 FOR IOCY=1 TO 36
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))+ABS(X(25)-X(26))
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))+ABS(X(25)-X(27))
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))+ABS(X(25)-X(28))
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))+ABS(X(25)-X(29))
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))+ABS(X(25)-X(30))
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))+ABS(X(25)-X(31))
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))+ABS(X(25)-X(32))
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))+ABS(X(25)-X(33))
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))+ABS(X(25)-X(34))
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))+ABS(X(25)-X(35))
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))+ABS(X(25)-X(36))
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))+ABS(X(26)-X(27))
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))+ABS(X(26)-X(28))
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))+ABS(X(26)-X(29))
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))+ABS(X(26)-X(30))
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))+ABS(X(26)-X(31))
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))+ABS(X(26)-X(32))
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))+ABS(X(26)-X(33))
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))+ABS(X(26)-X(34))
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))+ABS(X(26)-X(35))
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))+ABS(X(26)-X(36))
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))+ABS(X(27)-X(28))
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))+ABS(X(27)-X(29))
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))+ABS(X(27)-X(30))
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))+ABS(X(27)-X(31))
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))+ABS(X(27)-X(32))
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))+ABS(X(27)-X(33))
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))+ABS(X(27)-X(34))
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))+ABS(X(27)-X(35))
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))+ABS(X(27)-X(36))
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))+ABS(X(28)-X(29))
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))+ABS(X(28)-X(30))
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))+ABS(X(28)-X(31))
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))+ABS(X(28)-X(32))
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))+ABS(X(28)-X(33))
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))+ABS(X(28)-X(34))
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))+ABS(X(28)-X(35))
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))+ABS(X(28)-X(36))
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))+ABS(X(29)-X(30))
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))+ABS(X(29)-X(31))
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))+ABS(X(29)-X(32))
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))+ABS(X(29)-X(33))
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))+ABS(X(29)-X(34))
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))+ABS(X(29)-X(35))
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))+ABS(X(29)-X(36))
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))+ABS(X(30)-X(31))
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))+ABS(X(30)-X(32))
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))+ABS(X(30)-X(33))
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))+ABS(X(30)-X(34))
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))+ABS(X(30)-X(35))
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))+ABS(X(30)-X(36))
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))+ABS(X(31)-X(32))
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))+ABS(X(31)-X(33))
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))+ABS(X(31)-X(34))
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))+ABS(X(31)-X(35))
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))+ABS(X(31)-X(36))
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))+ABS(X(32)-X(33))
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))+ABS(X(32)-X(34))
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))+ABS(X(32)-X(35))
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))+ABS(X(32)-X(36))
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))+ABS(X(33)-X(34))
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))+ABS(X(33)-X(35))
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))+ABS(X(33)-X(36))
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))+ABS(X(34)-X(35))
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))+ABS(X(34)-X(36))
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))+ABS(X(35)-X(36))
788 FOR INSI=11 TO 76
791 IF P(INSI)<.5 THEN P(INSI)=9999 ELSE P(INSI)=P(INSI)
795 NEXT INSI
1321 P11B=5*P(11)+2*P(12)+4*P(13)+1*P(14)+.01*P(15)+.01*P(16)+6*P(17)+2*P(18)+1*P(19)+1*P(20)+1*P(21)
1322 P12B=3*P(22)+.01*P(23)+2*P(24)+2*P(25)+2*P(26)+.01*P(27)+4*P(28)+5*P(29)+.01*P(30)+.01*P(31)
1323 P13B=.01*P(32)+.01*P(33)+.01*P(34)+.01*P(35)+5*P(36)+5*P(37)+2*P(38)+2*P(39)+2*P(40)
1324 P14B=5*P(41)+2*P(42)+2*P(43)+10*P(44)+.01*P(45)+.01*P(46)+5*P(47)+5*P(48)
1325 P15B=10*P(49)+.01*P(50)+.01*P(51)+.01*P(52)+5*P(53)+1*P(54)+1*P(55)
1326 P16B=5*P(56)+1*P(57)+1*P(58)+5*P(59)+4*P(60)+.01*P(61)
1327 P17B=10*P(62)+5*P(63)+2*P(64)+3*P(65)+3*P(66)+.01*P(67)+.01*P(68)+5*P(69)+.01*P(70)
1328 P18B=.01*P(71)+10*P(72)+10*P(73)+5*P(74)+.01*P(75)+2*P(76)
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B
1448 P6=P1+0+0+0+0
1449 PS1=0
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 36
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1778 REM
1888 NEXT JJJ
1890 IF M>-265 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24)
1928 PRINT A(25),A(26),A(27),A(28),A(29)
1930 PRINT A(30),A(31),A(32),A(33),A(34)
1932 PRINT A(35),A(36),JJJJ,M,PP1
1999 NEXT JJJJ
(The .01s above are the 0s of the n=12 case, Nugent et al. [2, p. 168].)
This BASIC computer program was run with the IBM basica/D interpreter, and its output through JJJJ=-31868 (in compressed form and to be interpreted in accordance with line 1916 through line 1932; copied manually from the computer monitor) is presented below.
-31987 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 1
1 0 0 1 0
1 1
1 1 1 0 1
0 0 0 1 0
0 1 -31987 -262.58 262.58
-31977 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 0
1 1 1 0 1
1 0
0 0 0 1 1
1 0 0 1 0
1 1 -31977 -262.58 262.58
-31972 -264.56 264.56
1 1 1 1 1
0 0 1 0 0
0 0
1 0 2 1 0
0 2 2 1 0
1 2
1 1 1 0 0
0 0 0 1 1
0 1 -31972 -264.56 264.56
-31868 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
1 1 1 0 1
0 0 0 1 0
0 1
1 1 1 0 0
0 1 1 0 1
0 0 -31868 -262.58 262.58
The best candidate solutions shown above are at JJJJ=-31987, JJJJ=-31977, and JJJJ=-31868 with an objective function value of 262.58. (The last two digits, 5 and 8, should be disregarded because these are due to the artificial flows, the .01s.)
The output above was produced in 6 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 11, one may or may not obtain 262, which may or may not be optimal. That leads to a general remedy that in general, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
The problem considered here is essentially the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2] plus a change to more than 12 locations spread over three dimensions. The same interfacility flows [1, p. 33; 2, p. 168] are used here. So one knows the minimum objective function value to this newer problem is 289 [2, p. 159] or smaller.
Line 561 through line 626 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1328 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
A computer program that is identical to the one listed below with the exception of line 128, 128 FOR I=1 TO 3 for the former, produced no computational results after six hours of running. Then the following computer program was inputted.
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 36
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 36
53 N(IOCTT)=2
57 NEXT IOCTT
61 FOR KLQ=1 TO 36
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 36
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 36
128 FOR I=1 TO 10
129 FOR KKQQ=1 TO 36
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 36
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*108)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+36*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 36
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/3 THEN 471 ELSE IF RND<1/2 THEN 491 ELSE 511
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 36
533 IF X(IOCX)>2 THEN X(IOCX)=1
535 NEXT IOCX
541 FOR IOCY=1 TO 36
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))+ABS(X(25)-X(26))
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))+ABS(X(25)-X(27))
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))+ABS(X(25)-X(28))
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))+ABS(X(25)-X(29))
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))+ABS(X(25)-X(30))
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))+ABS(X(25)-X(31))
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))+ABS(X(25)-X(32))
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))+ABS(X(25)-X(33))
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))+ABS(X(25)-X(34))
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))+ABS(X(25)-X(35))
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))+ABS(X(25)-X(36))
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))+ABS(X(26)-X(27))
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))+ABS(X(26)-X(28))
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))+ABS(X(26)-X(29))
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))+ABS(X(26)-X(30))
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))+ABS(X(26)-X(31))
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))+ABS(X(26)-X(32))
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))+ABS(X(26)-X(33))
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))+ABS(X(26)-X(34))
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))+ABS(X(26)-X(35))
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))+ABS(X(26)-X(36))
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))+ABS(X(27)-X(28))
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))+ABS(X(27)-X(29))
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))+ABS(X(27)-X(30))
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))+ABS(X(27)-X(31))
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))+ABS(X(27)-X(32))
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))+ABS(X(27)-X(33))
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))+ABS(X(27)-X(34))
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))+ABS(X(27)-X(35))
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))+ABS(X(27)-X(36))
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))+ABS(X(28)-X(29))
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))+ABS(X(28)-X(30))
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))+ABS(X(28)-X(31))
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))+ABS(X(28)-X(32))
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))+ABS(X(28)-X(33))
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))+ABS(X(28)-X(34))
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))+ABS(X(28)-X(35))
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))+ABS(X(28)-X(36))
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))+ABS(X(29)-X(30))
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))+ABS(X(29)-X(31))
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))+ABS(X(29)-X(32))
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))+ABS(X(29)-X(33))
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))+ABS(X(29)-X(34))
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))+ABS(X(29)-X(35))
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))+ABS(X(29)-X(36))
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))+ABS(X(30)-X(31))
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))+ABS(X(30)-X(32))
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))+ABS(X(30)-X(33))
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))+ABS(X(30)-X(34))
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))+ABS(X(30)-X(35))
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))+ABS(X(30)-X(36))
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))+ABS(X(31)-X(32))
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))+ABS(X(31)-X(33))
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))+ABS(X(31)-X(34))
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))+ABS(X(31)-X(35))
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))+ABS(X(31)-X(36))
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))+ABS(X(32)-X(33))
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))+ABS(X(32)-X(34))
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))+ABS(X(32)-X(35))
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))+ABS(X(32)-X(36))
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))+ABS(X(33)-X(34))
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))+ABS(X(33)-X(35))
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))+ABS(X(33)-X(36))
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))+ABS(X(34)-X(35))
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))+ABS(X(34)-X(36))
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))+ABS(X(35)-X(36))
788 FOR INSI=11 TO 76
791 IF P(INSI)<.5 THEN P(INSI)=9999 ELSE P(INSI)=P(INSI)
795 NEXT INSI
1321 P11B=5*P(11)+2*P(12)+4*P(13)+1*P(14)+.01*P(15)+.01*P(16)+6*P(17)+2*P(18)+1*P(19)+1*P(20)+1*P(21)
1322 P12B=3*P(22)+.01*P(23)+2*P(24)+2*P(25)+2*P(26)+.01*P(27)+4*P(28)+5*P(29)+.01*P(30)+.01*P(31)
1323 P13B=.01*P(32)+.01*P(33)+.01*P(34)+.01*P(35)+5*P(36)+5*P(37)+2*P(38)+2*P(39)+2*P(40)
1324 P14B=5*P(41)+2*P(42)+2*P(43)+10*P(44)+.01*P(45)+.01*P(46)+5*P(47)+5*P(48)
1325 P15B=10*P(49)+.01*P(50)+.01*P(51)+.01*P(52)+5*P(53)+1*P(54)+1*P(55)
1326 P16B=5*P(56)+1*P(57)+1*P(58)+5*P(59)+4*P(60)+.01*P(61)
1327 P17B=10*P(62)+5*P(63)+2*P(64)+3*P(65)+3*P(66)+.01*P(67)+.01*P(68)+5*P(69)+.01*P(70)
1328 P18B=.01*P(71)+10*P(72)+10*P(73)+5*P(74)+.01*P(75)+2*P(76)
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B
1448 P6=P1+0+0+0+0
1449 PS1=0
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 36
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1778 REM
1888 NEXT JJJ
1890 IF M>-265 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24)
1928 PRINT A(25),A(26),A(27),A(28),A(29)
1930 PRINT A(30),A(31),A(32),A(33),A(34)
1932 PRINT A(35),A(36),JJJJ,M,PP1
1999 NEXT JJJJ
(The .01s above are the 0s of the n=12 case, Nugent et al. [2, p. 168].)
This BASIC computer program was run with the IBM basica/D interpreter, and its output through JJJJ=-31868 (in compressed form and to be interpreted in accordance with line 1916 through line 1932; copied manually from the computer monitor) is presented below.
-31987 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 1
1 0 0 1 0
1 1
1 1 1 0 1
0 0 0 1 0
0 1 -31987 -262.58 262.58
-31977 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 0
1 1 1 0 1
1 0
0 0 0 1 1
1 0 0 1 0
1 1 -31977 -262.58 262.58
-31972 -264.56 264.56
1 1 1 1 1
0 0 1 0 0
0 0
1 0 2 1 0
0 2 2 1 0
1 2
1 1 1 0 0
0 0 0 1 1
0 1 -31972 -264.56 264.56
-31868 -262.58 262.58
2 0 1 2 0
0 1 2 1 0
1 2
1 1 1 0 1
0 0 0 1 0
0 1
1 1 1 0 0
0 1 1 0 1
0 0 -31868 -262.58 262.58
The best candidate solutions shown above are at JJJJ=-31987, JJJJ=-31977, and JJJJ=-31868 with an objective function value of 262.58. (The last two digits, 5 and 8, should be disregarded because these are due to the artificial flows, the .01s.)
The output above was produced in 6 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 11, one may or may not obtain 262, which may or may not be optimal. That leads to a general remedy that in general, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
Friday, November 14, 2008
Scheduling Thirty Activities Competing for Eight Facilities
Jsun Yui Wong
This is an instance of the Carlson and Nemhauser problem of scheduling to minimize interaction cost [1]. Line 561 through line 995 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [2] and on page 140 of Heragu [3]. The objective is to minimize the total interaction cost of assigning thirty courses to eight time periods, which are period 0 through 7. As the individual interaction costs the program uses the interdepartmental flows presented in Nugent, Vollmann, and Ruml [4, p. 170]; these flows are used in line 1238 through line 1268 below.
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(522)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
45 FOR IOC=1 TO 30
46 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 30
53 N(IOCTT)=7
57 NEXT IOCTT
61 FOR KLQ=1 TO 30
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 30
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 30
128 FOR I=1 TO 1
129 FOR KKQQ=1 TO 30
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 30
133 IF RND<=.5 THEN 298 ELSE 230
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*90)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+30*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 30
364 X(I222)=FIX(X(I222))
368 NEXT I222
371 FOR I223=1 TO 30
374 IF X(I223)>7 THEN X(I223)=7
377 NEXT I223
381 FOR I224=1 TO 30
384 IF X(I224)<0 THEN X(I224)=0
388 NEXT I224
461 IF RND>.1 GOTO 561
471 IOCT1=1+FIX(RND*30)
474 IOCT2=1+FIX(RND*30)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
561 P(11)=ABS(X(1)-X(2))
562 P(12)=ABS(X(1)-X(3))
563 P(13)=ABS(X(1)-X(4))
564 P(14)=ABS(X(1)-X(5))
565 P(15)=ABS(X(1)-X(6))
566 P(16)=ABS(X(1)-X(7))
567 P(17)=ABS(X(1)-X(8))
568 P(18)=ABS(X(1)-X(9))
569 P(19)=ABS(X(1)-X(10))
570 P(20)=ABS(X(1)-X(11))
571 P(21)=ABS(X(1)-X(12))
572 P(22)=ABS(X(1)-X(13))
573 P(23)=ABS(X(1)-X(14))
574 P(24)=ABS(X(1)-X(15))
575 P(25)=ABS(X(1)-X(16))
576 P(26)=ABS(X(1)-X(17))
577 P(27)=ABS(X(1)-X(18))
578 P(28)=ABS(X(1)-X(19))
579 P(29)=ABS(X(1)-X(20))
580 P(30)=ABS(X(1)-X(21))
581 P(31)=ABS(X(1)-X(22))
582 P(32)=ABS(X(1)-X(23))
583 P(33)=ABS(X(1)-X(24))
584 P(34)=ABS(X(1)-X(25))
585 P(35)=ABS(X(1)-X(26))
586 P(36)=ABS(X(1)-X(27))
587 P(37)=ABS(X(1)-X(28))
588 P(38)=ABS(X(1)-X(29))
589 P(39)=ABS(X(1)-X(30))
590 P(40)=ABS(X(2)-X(3))
591 P(41)=ABS(X(2)-X(4))
592 P(42)=ABS(X(2)-X(5))
593 P(43)=ABS(X(2)-X(6))
594 P(44)=ABS(X(2)-X(7))
595 P(45)=ABS(X(2)-X(8))
596 P(46)=ABS(X(2)-X(9))
597 P(47)=ABS(X(2)-X(10))
598 P(48)=ABS(X(2)-X(11))
599 P(49)=ABS(X(2)-X(12))
600 P(50)=ABS(X(2)-X(13))
601 P(51)=ABS(X(2)-X(14))
602 P(52)=ABS(X(2)-X(15))
603 P(53)=ABS(X(2)-X(16))
604 P(54)=ABS(X(2)-X(17))
605 P(55)=ABS(X(2)-X(18))
606 P(56)=ABS(X(2)-X(19))
607 P(57)=ABS(X(2)-X(20))
608 P(58)=ABS(X(2)-X(21))
609 P(59)=ABS(X(2)-X(22))
610 P(60)=ABS(X(2)-X(23))
611 P(61)=ABS(X(2)-X(24))
612 P(62)=ABS(X(2)-X(25))
613 P(63)=ABS(X(2)-X(26))
614 P(64)=ABS(X(2)-X(27))
615 P(65)=ABS(X(2)-X(28))
616 P(66)=ABS(X(2)-X(29))
617 P(67)=ABS(X(2)-X(30))
618 P(68)=ABS(X(3)-X(4))
619 P(69)=ABS(X(3)-X(5))
620 P(70)=ABS(X(3)-X(6))
621 P(71)=ABS(X(3)-X(7))
622 P(72)=ABS(X(3)-X(8))
623 P(73)=ABS(X(3)-X(9))
624 P(74)=ABS(X(3)-X(10))
625 P(75)=ABS(X(3)-X(11))
626 P(76)=ABS(X(3)-X(12))
627 P(77)=ABS(X(3)-X(13))
628 P(78)=ABS(X(3)-X(14))
629 P(79)=ABS(X(3)-X(15))
630 P(80)=ABS(X(3)-X(16))
631 P(81)=ABS(X(3)-X(17))
632 P(82)=ABS(X(3)-X(18))
633 P(83)=ABS(X(3)-X(19))
634 P(84)=ABS(X(3)-X(20))
635 P(85)=ABS(X(3)-X(21))
636 P(86)=ABS(X(3)-X(22))
637 P(87)=ABS(X(3)-X(23))
638 P(88)=ABS(X(3)-X(24))
639 P(89)=ABS(X(3)-X(25))
640 P(90)=ABS(X(3)-X(26))
641 P(91)=ABS(X(3)-X(27))
642 P(92)=ABS(X(3)-X(28))
643 P(93)=ABS(X(3)-X(29))
644 P(94)=ABS(X(3)-X(30))
645 P(95)=ABS(X(4)-X(5))
646 P(96)=ABS(X(4)-X(6))
647 P(97)=ABS(X(4)-X(7))
648 P(98)=ABS(X(4)-X(8))
649 P(99)=ABS(X(4)-X(9))
650 P(100)=ABS(X(4)-X(10))
651 P(101)=ABS(X(4)-X(11))
652 P(102)=ABS(X(4)-X(12))
653 P(103)=ABS(X(4)-X(13))
654 P(104)=ABS(X(4)-X(14))
655 P(105)=ABS(X(4)-X(15))
656 P(106)=ABS(X(4)-X(16))
657 P(107)=ABS(X(4)-X(17))
658 P(108)=ABS(X(4)-X(18))
659 P(109)=ABS(X(4)-X(19))
660 P(110)=ABS(X(4)-X(20))
661 P(111)=ABS(X(4)-X(21))
662 P(112)=ABS(X(4)-X(22))
663 P(113)=ABS(X(4)-X(23))
664 P(114)=ABS(X(4)-X(24))
665 P(115)=ABS(X(4)-X(25))
666 P(116)=ABS(X(4)-X(26))
667 P(117)=ABS(X(4)-X(27))
668 P(118)=ABS(X(4)-X(28))
669 P(119)=ABS(X(4)-X(29))
670 P(120)=ABS(X(4)-X(30))
671 P(121)=ABS(X(5)-X(6))
672 P(122)=ABS(X(5)-X(7))
673 P(123)=ABS(X(5)-X(8))
674 P(124)=ABS(X(5)-X(9))
675 P(125)=ABS(X(5)-X(10))
676 P(126)=ABS(X(5)-X(11))
677 P(127)=ABS(X(5)-X(12))
678 P(128)=ABS(X(5)-X(13))
679 P(129)=ABS(X(5)-X(14))
680 P(130)=ABS(X(5)-X(15))
681 P(131)=ABS(X(5)-X(16))
682 P(132)=ABS(X(5)-X(17))
683 P(133)=ABS(X(5)-X(18))
684 P(134)=ABS(X(5)-X(19))
685 P(135)=ABS(X(5)-X(20))
686 P(136)=ABS(X(5)-X(21))
687 P(137)=ABS(X(5)-X(22))
688 P(138)=ABS(X(5)-X(23))
689 P(139)=ABS(X(5)-X(24))
690 P(140)=ABS(X(5)-X(25))
691 P(141)=ABS(X(5)-X(26))
692 P(142)=ABS(X(5)-X(27))
693 P(143)=ABS(X(5)-X(28))
694 P(144)=ABS(X(5)-X(29))
695 P(145)=ABS(X(5)-X(30))
696 P(146)=ABS(X(6)-X(7))
697 P(147)=ABS(X(6)-X(8))
698 P(148)=ABS(X(6)-X(9))
699 P(149)=ABS(X(6)-X(10))
700 P(150)=ABS(X(6)-X(11))
701 P(151)=ABS(X(6)-X(12))
702 P(152)=ABS(X(6)-X(13))
703 P(153)=ABS(X(6)-X(14))
704 P(154)=ABS(X(6)-X(15))
705 P(155)=ABS(X(6)-X(16))
706 P(156)=ABS(X(6)-X(17))
707 P(157)=ABS(X(6)-X(18))
708 P(158)=ABS(X(6)-X(19))
709 P(159)=ABS(X(6)-X(20))
710 P(160)=ABS(X(6)-X(21))
711 P(161)=ABS(X(6)-X(22))
712 P(162)=ABS(X(6)-X(23))
713 P(163)=ABS(X(6)-X(24))
714 P(164)=ABS(X(6)-X(25))
715 P(165)=ABS(X(6)-X(26))
716 P(166)=ABS(X(6)-X(27))
717 P(167)=ABS(X(6)-X(28))
718 P(168)=ABS(X(6)-X(29))
719 P(169)=ABS(X(6)-X(30))
720 P(170)=ABS(X(7)-X(8))
721 P(171)=ABS(X(7)-X(9))
722 P(172)=ABS(X(7)-X(10))
723 P(173)=ABS(X(7)-X(11))
724 P(174)=ABS(X(7)-X(12))
725 P(175)=ABS(X(7)-X(13))
726 P(176)=ABS(X(7)-X(14))
727 P(177)=ABS(X(7)-X(15))
728 P(178)=ABS(X(7)-X(16))
729 P(179)=ABS(X(7)-X(17))
730 P(180)=ABS(X(7)-X(18))
731 P(181)=ABS(X(7)-X(19))
732 P(182)=ABS(X(7)-X(20))
733 P(183)=ABS(X(7)-X(21))
734 P(184)=ABS(X(7)-X(22))
735 P(185)=ABS(X(7)-X(23))
736 P(186)=ABS(X(7)-X(24))
737 P(187)=ABS(X(7)-X(25))
738 P(188)=ABS(X(7)-X(26))
739 P(189)=ABS(X(7)-X(27))
740 P(190)=ABS(X(7)-X(28))
741 P(191)=ABS(X(7)-X(29))
742 P(192)=ABS(X(7)-X(30))
743 P(193)=ABS(X(8)-X(9))
744 P(194)=ABS(X(8)-X(10))
745 P(195)=ABS(X(8)-X(11))
746 P(196)=ABS(X(8)-X(12))
747 P(197)=ABS(X(8)-X(13))
748 P(198)=ABS(X(8)-X(14))
749 P(199)=ABS(X(8)-X(15))
750 P(200)=ABS(X(8)-X(16))
751 P(201)=ABS(X(8)-X(17))
752 P(202)=ABS(X(8)-X(18))
753 P(203)=ABS(X(8)-X(19))
754 P(204)=ABS(X(8)-X(20))
755 P(205)=ABS(X(8)-X(21))
756 P(206)=ABS(X(8)-X(22))
757 P(207)=ABS(X(8)-X(23))
758 P(208)=ABS(X(8)-X(24))
759 P(209)=ABS(X(8)-X(25))
760 P(210)=ABS(X(8)-X(26))
761 P(211)=ABS(X(8)-X(27))
762 P(212)=ABS(X(8)-X(28))
763 P(213)=ABS(X(8)-X(29))
764 P(214)=ABS(X(8)-X(30))
765 P(215)=ABS(X(9)-X(10))
766 P(216)=ABS(X(9)-X(11))
767 P(217)=ABS(X(9)-X(12))
768 P(218)=ABS(X(9)-X(13))
769 P(219)=ABS(X(9)-X(14))
770 P(220)=ABS(X(9)-X(15))
771 P(221)=ABS(X(9)-X(16))
772 P(222)=ABS(X(9)-X(17))
773 P(223)=ABS(X(9)-X(18))
774 P(224)=ABS(X(9)-X(19))
775 P(225)=ABS(X(9)-X(20))
776 P(226)=ABS(X(9)-X(21))
777 P(227)=ABS(X(9)-X(22))
778 P(228)=ABS(X(9)-X(23))
779 P(229)=ABS(X(9)-X(24))
780 P(230)=ABS(X(9)-X(25))
781 P(231)=ABS(X(9)-X(26))
782 P(232)=ABS(X(9)-X(27))
783 P(233)=ABS(X(9)-X(28))
784 P(234)=ABS(X(9)-X(29))
785 P(235)=ABS(X(9)-X(30))
786 P(236)=ABS(X(10)-X(11))
787 P(237)=ABS(X(10)-X(12))
788 P(238)=ABS(X(10)-X(13))
789 P(239)=ABS(X(10)-X(14))
790 P(240)=ABS(X(10)-X(15))
791 P(241)=ABS(X(10)-X(16))
792 P(242)=ABS(X(10)-X(17))
793 P(243)=ABS(X(10)-X(18))
794 P(244)=ABS(X(10)-X(19))
795 P(245)=ABS(X(10)-X(20))
796 P(246)=ABS(X(10)-X(21))
797 P(247)=ABS(X(10)-X(22))
798 P(248)=ABS(X(10)-X(23))
799 P(249)=ABS(X(10)-X(24))
800 P(250)=ABS(X(10)-X(25))
801 P(251)=ABS(X(10)-X(26))
802 P(252)=ABS(X(10)-X(27))
803 P(253)=ABS(X(10)-X(28))
804 P(254)=ABS(X(10)-X(29))
805 P(255)=ABS(X(10)-X(30))
806 P(256)=ABS(X(11)-X(12))
807 P(257)=ABS(X(11)-X(13))
808 P(258)=ABS(X(11)-X(14))
809 P(259)=ABS(X(11)-X(15))
810 P(260)=ABS(X(11)-X(16))
811 P(261)=ABS(X(11)-X(17))
812 P(262)=ABS(X(11)-X(18))
813 P(263)=ABS(X(11)-X(19))
814 P(264)=ABS(X(11)-X(20))
815 P(265)=ABS(X(11)-X(21))
816 P(266)=ABS(X(11)-X(22))
817 P(267)=ABS(X(11)-X(23))
818 P(268)=ABS(X(11)-X(24))
819 P(269)=ABS(X(11)-X(25))
820 P(270)=ABS(X(11)-X(26))
821 P(271)=ABS(X(11)-X(27))
822 P(272)=ABS(X(11)-X(28))
823 P(273)=ABS(X(11)-X(29))
824 P(274)=ABS(X(11)-X(30))
825 P(275)=ABS(X(12)-X(13))
826 P(276)=ABS(X(12)-X(14))
827 P(277)=ABS(X(12)-X(15))
828 P(278)=ABS(X(12)-X(16))
829 P(279)=ABS(X(12)-X(17))
830 P(280)=ABS(X(12)-X(18))
831 P(281)=ABS(X(12)-X(19))
832 P(282)=ABS(X(12)-X(20))
833 P(283)=ABS(X(12)-X(21))
834 P(284)=ABS(X(12)-X(22))
835 P(285)=ABS(X(12)-X(23))
836 P(286)=ABS(X(12)-X(24))
837 P(287)=ABS(X(12)-X(25))
838 P(288)=ABS(X(12)-X(26))
839 P(289)=ABS(X(12)-X(27))
840 P(290)=ABS(X(12)-X(28))
841 P(291)=ABS(X(12)-X(29))
842 P(292)=ABS(X(12)-X(30))
843 P(293)=ABS(X(13)-X(14))
844 P(294)=ABS(X(13)-X(15))
845 P(295)=ABS(X(13)-X(16))
846 P(296)=ABS(X(13)-X(17))
847 P(297)=ABS(X(13)-X(18))
848 P(298)=ABS(X(13)-X(19))
849 P(299)=ABS(X(13)-X(20))
850 P(300)=ABS(X(13)-X(21))
851 P(301)=ABS(X(13)-X(22))
852 P(302)=ABS(X(13)-X(23))
853 P(303)=ABS(X(13)-X(24))
854 P(304)=ABS(X(13)-X(25))
855 P(305)=ABS(X(13)-X(26))
856 P(306)=ABS(X(13)-X(27))
857 P(307)=ABS(X(13)-X(28))
858 P(308)=ABS(X(13)-X(29))
859 P(309)=ABS(X(13)-X(30))
860 P(310)=ABS(X(14)-X(15))
861 P(311)=ABS(X(14)-X(16))
862 P(312)=ABS(X(14)-X(17))
863 P(313)=ABS(X(14)-X(18))
864 P(314)=ABS(X(14)-X(19))
865 P(315)=ABS(X(14)-X(20))
866 P(316)=ABS(X(14)-X(21))
867 P(317)=ABS(X(14)-X(22))
868 P(318)=ABS(X(14)-X(23))
869 P(319)=ABS(X(14)-X(24))
870 P(320)=ABS(X(14)-X(25))
871 P(321)=ABS(X(14)-X(26))
872 P(322)=ABS(X(14)-X(27))
873 P(323)=ABS(X(14)-X(28))
874 P(324)=ABS(X(14)-X(29))
875 P(325)=ABS(X(14)-X(30))
876 P(326)=ABS(X(15)-X(16))
877 P(327)=ABS(X(15)-X(17))
878 P(328)=ABS(X(15)-X(18))
879 P(329)=ABS(X(15)-X(19))
880 P(330)=ABS(X(15)-X(20))
881 P(331)=ABS(X(15)-X(21))
882 P(332)=ABS(X(15)-X(22))
883 P(333)=ABS(X(15)-X(23))
884 P(334)=ABS(X(15)-X(24))
885 P(335)=ABS(X(15)-X(25))
886 P(336)=ABS(X(15)-X(26))
887 P(337)=ABS(X(15)-X(27))
888 P(338)=ABS(X(15)-X(28))
889 P(339)=ABS(X(15)-X(29))
890 P(340)=ABS(X(15)-X(30))
891 P(341)=ABS(X(16)-X(17))
892 P(342)=ABS(X(16)-X(18))
893 P(343)=ABS(X(16)-X(19))
894 P(344)=ABS(X(16)-X(20))
895 P(345)=ABS(X(16)-X(21))
896 P(346)=ABS(X(16)-X(22))
897 P(347)=ABS(X(16)-X(23))
898 P(348)=ABS(X(16)-X(24))
899 P(349)=ABS(X(16)-X(25))
900 P(350)=ABS(X(16)-X(26))
901 P(351)=ABS(X(16)-X(27))
902 P(352)=ABS(X(16)-X(28))
903 P(353)=ABS(X(16)-X(29))
904 P(354)=ABS(X(16)-X(30))
905 P(355)=ABS(X(17)-X(18))
906 P(356)=ABS(X(17)-X(19))
907 P(357)=ABS(X(17)-X(20))
908 P(358)=ABS(X(17)-X(21))
909 P(359)=ABS(X(17)-X(22))
910 P(360)=ABS(X(17)-X(23))
911 P(361)=ABS(X(17)-X(24))
912 P(362)=ABS(X(17)-X(25))
913 P(363)=ABS(X(17)-X(26))
914 P(364)=ABS(X(17)-X(27))
915 P(365)=ABS(X(17)-X(28))
916 P(366)=ABS(X(17)-X(29))
917 P(367)=ABS(X(17)-X(30))
918 P(368)=ABS(X(18)-X(19))
919 P(369)=ABS(X(18)-X(20))
920 P(370)=ABS(X(18)-X(21))
921 P(371)=ABS(X(18)-X(22))
922 P(372)=ABS(X(18)-X(23))
923 P(373)=ABS(X(18)-X(24))
924 P(374)=ABS(X(18)-X(25))
925 P(375)=ABS(X(18)-X(26))
926 P(376)=ABS(X(18)-X(27))
927 P(377)=ABS(X(18)-X(28))
928 P(378)=ABS(X(18)-X(29))
929 P(379)=ABS(X(18)-X(30))
930 P(380)=ABS(X(19)-X(20))
931 P(381)=ABS(X(19)-X(21))
932 P(382)=ABS(X(19)-X(22))
933 P(383)=ABS(X(19)-X(23))
934 P(384)=ABS(X(19)-X(24))
935 P(385)=ABS(X(19)-X(25))
936 P(386)=ABS(X(19)-X(26))
937 P(387)=ABS(X(19)-X(27))
938 P(388)=ABS(X(19)-X(28))
939 P(389)=ABS(X(19)-X(29))
940 P(390)=ABS(X(19)-X(30))
941 P(391)=ABS(X(20)-X(21))
942 P(392)=ABS(X(20)-X(22))
943 P(393)=ABS(X(20)-X(23))
944 P(394)=ABS(X(20)-X(24))
945 P(395)=ABS(X(20)-X(25))
946 P(396)=ABS(X(20)-X(26))
947 P(397)=ABS(X(20)-X(27))
948 P(398)=ABS(X(20)-X(28))
949 P(399)=ABS(X(20)-X(29))
950 P(400)=ABS(X(20)-X(30))
951 P(401)=ABS(X(21)-X(22))
952 P(402)=ABS(X(21)-X(23))
953 P(403)=ABS(X(21)-X(24))
954 P(404)=ABS(X(21)-X(25))
955 P(405)=ABS(X(21)-X(26))
956 P(406)=ABS(X(21)-X(27))
957 P(407)=ABS(X(21)-X(28))
958 P(408)=ABS(X(21)-X(29))
959 P(409)=ABS(X(21)-X(30))
960 P(410)=ABS(X(22)-X(23))
961 P(411)=ABS(X(22)-X(24))
962 P(412)=ABS(X(22)-X(25))
963 P(413)=ABS(X(22)-X(26))
964 P(414)=ABS(X(22)-X(27))
965 P(415)=ABS(X(22)-X(28))
966 P(416)=ABS(X(22)-X(29))
967 P(417)=ABS(X(22)-X(30))
968 P(418)=ABS(X(23)-X(24))
969 P(419)=ABS(X(23)-X(25))
970 P(420)=ABS(X(23)-X(26))
971 P(421)=ABS(X(23)-X(27))
972 P(422)=ABS(X(23)-X(28))
973 P(423)=ABS(X(23)-X(29))
974 P(424)=ABS(X(23)-X(30))
975 P(425)=ABS(X(24)-X(25))
976 P(426)=ABS(X(24)-X(26))
977 P(427)=ABS(X(24)-X(27))
978 P(428)=ABS(X(24)-X(28))
979 P(429)=ABS(X(24)-X(29))
980 P(430)=ABS(X(24)-X(30))
981 P(431)=ABS(X(25)-X(26))
982 P(432)=ABS(X(25)-X(27))
983 P(433)=ABS(X(25)-X(28))
984 P(434)=ABS(X(25)-X(29))
985 P(435)=ABS(X(25)-X(30))
986 P(436)=ABS(X(26)-X(27))
987 P(437)=ABS(X(26)-X(28))
988 P(438)=ABS(X(26)-X(29))
989 P(439)=ABS(X(26)-X(30))
990 P(440)=ABS(X(27)-X(28))
991 P(441)=ABS(X(27)-X(29))
992 P(442)=ABS(X(27)-X(30))
993 P(443)=ABS(X(28)-X(29))
994 P(444)=ABS(X(28)-X(30))
995 P(445)=ABS(X(29)-X(30))
1088 FOR INSI=11 TO 445
1091 IF P(INSI)<.5 THEN P(INSI)=1 ELSE P(INSI)=0
1095 NEXT INSI
1238 P11B=3*P(11)+2*P(12)+0*P(13)+0*P(14)+2*P(15)+10*P(16)+5*P(17)+0*P(18)+5*P(19)+2*P(20)
1239 P12B=5*P(21)+0*P(22)+0*P(23)+2*P(24)
1240 P13B=0*P(25)+5*P(26)+6*P(27)+3*P(28)+0*P(29)+1*P(30)+10*P(31)+0*P(32)+10*P(33)+2*P(34)+1*P(35)+1*P(36)+1*P(37)+0*P(38)+1*P(39)
1241 P14B=4*P(40)+0*P(41)+10*P(42)+4*P(43)+0*P(44)+0*P(45)+2*P(46)+2*P(47)+1*P(48)+0*P(49)+5*P(50)+0*P(51)+0*P(52)+0*P(53)+0*P(54)
1242 P15B=2*P(55)+0*P(56)+1*P(57)+6*P(58)+1*P(59)+0*P(60)+1*P(61)+2*P(62)+2*P(63)+5*P(64)+1*P(65)+10*P(66)+5*P(67)
1243 P16B=3*P(68)+4*P(69)+0*P(70)+5*P(71)+5*P(72)+5*P(73)+1*P(74)+4*P(75)+1*P(76)+0*P(77)+4*P(78)+0*P(79)+4*P(80)+0*P(81)+6*P(82)
1244 P17B=3*P(83)+2*P(84)+5*P(85)+5*P(86)+2*P(87)+1*P(88)+0*P(89)+0*P(90)+3*P(91)+1*P(92)+0*P(93)+2*P(94)+0*P(95)+0*P(96)+0*P(97)
1245 P18B=2*P(98)+2*P(99)+0*P(100)+6*P(101)+0*P(102)+2*P(103)+5*P(104)+2*P(105)+5*P(106)+1*P(107)+1*P(108)+1*P(109)+1*P(110)+2*P(111)+2*P(112)
1246 P19B=4*P(113)+0*P(114)+2*P(115)+0*P(116)+2*P(117)+2*P(118)+5*P(119)+5*P(120)+5*P(121)+2*P(122)+0*P(123)+0*P(124)+0*P(125)+0*P(126)+2*P(127)
1247 P20B=0*P(128)+0*P(129)+0*P(130)+0*P(131)+2*P(132)+1*P(133)+0*P(134)+0*P(135)+2*P(136)+0*P(137)+5*P(138)+1*P(139)+0*P(140)+2*P(141)+1*P(142)
1248 P21B=0*P(143)+2*P(144)+1*P(145)+1*P(146)+2*P(147)+2*P(148)+1*P(149)+4*P(150)+10*P(151)+10*P(152)+2*P(153)+5*P(154)+5*P(155)+0*P(156)+5*P(157)
1249 P22B=0*P(158)+0*P(159)+0*P(160)+10*P(161)+0*P(162)+0*P(163)+0*P(164)+4*P(165)+0*P(166)+10*P(167)+1*P(168)+1*P(169)+10*P(170)+10*P(171)+5*P(172)
1250 P23B=10*P(173)+10*P(174)+6*P(175)+0*P(176)+0*P(177)+10*P(178)+2*P(179)+1*P(180)+10*P(181)+1*P(182)+5*P(183)+5*P(184)+2*P(185)+3*P(186)+5*P(187)
1251 P24B=0*P(188)+2*P(189)+0*P(190)+1*P(191)+3*P(192)+1*P(193)+3*P(194)+5*P(195)+0*P(196)+0*P(197)+0*P(198)+2*P(199)+4*P(200)+5*P(201)+2*P(202)
1252 P25B=10*P(203)+6*P(204)+0*P(205)+5*P(206)+5*P(207)+2*P(208)+5*P(209)+0*P(210)+5*P(211)+5*P(212)+0*P(213)+2*P(214)+10*P(215)+2*P(216)+1*P(217)
1253 P26B=5*P(218)+2*P(219)+0*P(220)+3*P(221)+0*P(222)+2*P(223)+0*P(224)+0*P(225)+4*P(226)+0*P(227)+5*P(228)+2*P(229)+0*P(230)+5*P(231)+2*P(232)
1254 P27B=2*P(233)+5*P(234)+2*P(235)+5*P(236)+5*P(237)+6*P(238)+0*P(239)+1*P(240)+5*P(241)+5*P(242)+0*P(243)+5*P(244)+2*P(245)+3*P(246)+5*P(247)
1255 P28B=0*P(248)+5*P(249)+2*P(250)+10*P(251)+10*P(252)+1*P(253)+5*P(254)+2*P(255)+0*P(256)+0*P(257)+1*P(258)+2*P(259)+1*P(260)+0*P(261)+2*P(262)
1256 P29B=0*P(263)+0*P(264)+0*P(265)+6*P(266)+6*P(267)+0*P(268)+4*P(269)+5*P(270)+3*P(271)+2*P(272)+2*P(273)+10*P(274)+5*P(275)+5*P(276)+2*P(277)
1257 P30B=0*P(278)+0*P(279)+0*P(280)+0*P(281)+2*P(282)+0*P(283)+4*P(284)+5*P(285)+10*P(286)+1*P(287)+0*P(288)+0*P(289)+0*P(290)+0*P(291)+1*P(292)
1258 P31B=2*P(293)+0*P(294)+4*P(295)+2*P(296)+2*P(297)+1*P(298)+0*P(299)+6*P(300)+2*P(301)+1*P(302)+5*P(303)+5*P(304)+0*P(305)+0*P(306)+1*P(307)
1259 P32B=5*P(308)+5*P(309)+2*P(310)+1*P(311)+0*P(312)+5*P(313)+3*P(314)+10*P(315)+0*P(316)+0*P(317)+4*P(318)+2*P(319)+0*P(320)+0*P(321)+4*P(322)
1260 P33B=2*P(323)+5*P(324)+5*P(325)+4*P(326)+5*P(327)+1*P(328)+0*P(329)+1*P(330)+0*P(331)+5*P(332)+0*P(333)+2*P(334)+0*P(335)+0*P(336)+5*P(337)
1261 P34B=1*P(338)+1*P(339)+0*P(340)+0*P(341)+3*P(342)+0*P(343)+2*P(344)+2*P(345)+0*P(346)+2*P(347)+0*P(348)+5*P(349)+0*P(350)+5*P(351)+2*P(352)
1262 P35B=5*P(353)+10*P(354)+2*P(355)+2*P(356)+0*P(357)+0*P(358)+0*P(359)+6*P(360)+5*P(361)+3*P(362)+5*P(363)+0*P(364)+0*P(365)+5*P(366)+1*P(367)
1263 P36B=5*P(368)+1*P(369)+2*P(370)+10*P(371)+10*P(372)+4*P(373)+0*P(374)+0*P(375)+5*P(376)+0*P(377)+0*P(378)+0*P(379)+0*P(380)+5*P(381)+5*P(382)
1264 P38B=1*P(383)+0*P(384)+5*P(385)+2*P(386)+1*P(387)+2*P(388)+10*P(389)+10*P(390)+5*P(391)+2*P(392)+1*P(393)+3*P(394)+1*P(395)+5*P(396)+6*P(397)
1265 P39B=5*P(398)+5*P(399)+3*P(400)+4*P(401)+0*P(402)+1*P(403)+0*P(404)+0*P(405)+0*P(406)+5*P(407)+0*P(408)+0*P(409)+5*P(410)+0*P(411)+4*P(412)
1266 P40B=4*P(413)+5*P(414)+0*P(415)+2*P(416)+5*P(417)+0*P(418)+4*P(419)+4*P(420)+1*P(421)+0*P(422)+2*P(423)+2*P(424)+5*P(425)+5*P(426)+0*P(427)
1267 P41B=1*P(428)+0*P(429)+0*P(430)+1*P(431)+0*P(432)+10*P(433)+1*P(434)+0*P(435)+0*P(436)+0*P(437)+0*P(438)+0*P(439)+0*P(440)+0*P(441)+10*P(442)
1268 P42B=2*P(443)+2*P(444)+2*P(445)
1388 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B+P21B+P22B+P23B+P24B+P25B+P26B
1395 P2=P27B+P28B+P29B+P30B+P31B+P32B+P33B+P34B+P35B+P36B+P37B+P38B+P39B+P40B+P41B+P42B
1397 P4=0
1398 P3=0
1448 P5=P1+P2+P3+P4
1450 P=-P5+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P5
1454 FOR KLX=1 TO 30
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-8 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12),A(13),A(14),A(15)
1922 PRINT A(16),A(17),A(18),A(19),A(20)
1924 PRINT A(21),A(22),A(23),A(24),A(25)
1926 PRINT A(26),A(27),A(28),A(29),A(30)
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its output through JJJJ=-29975 (in compressed form and to be interpreted in accordance with line 1916 through line 1926; copied manually from the computer monitor) is presented below.
-30472 -6 6
4 5 7 5 0
2 5 6 4 3
0 6 0 1 7
1 1 3 0 0
6 1 2 2 7
6 2 3 6 7
-30360 -6 6
3 6 7 6 2
0 6 5 1 4
2 5 2 3 7
3 1 4 2 2
5 1 0 0 7
5 0 4 5 7
-29975 -7 7
1 0 6 0 1
3 0 2 7 5
4 2 4 1 6
1 7 5 4 4
2 7 3 3 6
2 3 7 2 5
Among the candidate solutions presented above, the best are at JJJJ=-30472 and JJJJ=-30360 with an objective function value of 6.
The output above was produced in 16 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 to, for example, 128 FOR I=1 TO 2, one may or may not obtain the best objective function value of the output above, 6, which may or may not optimal. Generally speaking, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; that does not have to be line 128. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] R.C. Carlson, G.L. Nemhauser, Scheduling to minimize interaction cost, Operations Research, 14 (1966) 52-58.
[2] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[3] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[4] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
This is an instance of the Carlson and Nemhauser problem of scheduling to minimize interaction cost [1]. Line 561 through line 995 of the computer program below are slightly different from the mathematical formulation on page 6 of Heragu and Kusiak [2] and on page 140 of Heragu [3]. The objective is to minimize the total interaction cost of assigning thirty courses to eight time periods, which are period 0 through 7. As the individual interaction costs the program uses the interdepartmental flows presented in Nugent, Vollmann, and Ruml [4, p. 170]; these flows are used in line 1238 through line 1268 below.
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(522)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
45 FOR IOC=1 TO 30
46 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 30
53 N(IOCTT)=7
57 NEXT IOCTT
61 FOR KLQ=1 TO 30
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 30
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 30
128 FOR I=1 TO 1
129 FOR KKQQ=1 TO 30
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 30
133 IF RND<=.5 THEN 298 ELSE 230
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*90)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+30*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 30
364 X(I222)=FIX(X(I222))
368 NEXT I222
371 FOR I223=1 TO 30
374 IF X(I223)>7 THEN X(I223)=7
377 NEXT I223
381 FOR I224=1 TO 30
384 IF X(I224)<0 THEN X(I224)=0
388 NEXT I224
461 IF RND>.1 GOTO 561
471 IOCT1=1+FIX(RND*30)
474 IOCT2=1+FIX(RND*30)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
561 P(11)=ABS(X(1)-X(2))
562 P(12)=ABS(X(1)-X(3))
563 P(13)=ABS(X(1)-X(4))
564 P(14)=ABS(X(1)-X(5))
565 P(15)=ABS(X(1)-X(6))
566 P(16)=ABS(X(1)-X(7))
567 P(17)=ABS(X(1)-X(8))
568 P(18)=ABS(X(1)-X(9))
569 P(19)=ABS(X(1)-X(10))
570 P(20)=ABS(X(1)-X(11))
571 P(21)=ABS(X(1)-X(12))
572 P(22)=ABS(X(1)-X(13))
573 P(23)=ABS(X(1)-X(14))
574 P(24)=ABS(X(1)-X(15))
575 P(25)=ABS(X(1)-X(16))
576 P(26)=ABS(X(1)-X(17))
577 P(27)=ABS(X(1)-X(18))
578 P(28)=ABS(X(1)-X(19))
579 P(29)=ABS(X(1)-X(20))
580 P(30)=ABS(X(1)-X(21))
581 P(31)=ABS(X(1)-X(22))
582 P(32)=ABS(X(1)-X(23))
583 P(33)=ABS(X(1)-X(24))
584 P(34)=ABS(X(1)-X(25))
585 P(35)=ABS(X(1)-X(26))
586 P(36)=ABS(X(1)-X(27))
587 P(37)=ABS(X(1)-X(28))
588 P(38)=ABS(X(1)-X(29))
589 P(39)=ABS(X(1)-X(30))
590 P(40)=ABS(X(2)-X(3))
591 P(41)=ABS(X(2)-X(4))
592 P(42)=ABS(X(2)-X(5))
593 P(43)=ABS(X(2)-X(6))
594 P(44)=ABS(X(2)-X(7))
595 P(45)=ABS(X(2)-X(8))
596 P(46)=ABS(X(2)-X(9))
597 P(47)=ABS(X(2)-X(10))
598 P(48)=ABS(X(2)-X(11))
599 P(49)=ABS(X(2)-X(12))
600 P(50)=ABS(X(2)-X(13))
601 P(51)=ABS(X(2)-X(14))
602 P(52)=ABS(X(2)-X(15))
603 P(53)=ABS(X(2)-X(16))
604 P(54)=ABS(X(2)-X(17))
605 P(55)=ABS(X(2)-X(18))
606 P(56)=ABS(X(2)-X(19))
607 P(57)=ABS(X(2)-X(20))
608 P(58)=ABS(X(2)-X(21))
609 P(59)=ABS(X(2)-X(22))
610 P(60)=ABS(X(2)-X(23))
611 P(61)=ABS(X(2)-X(24))
612 P(62)=ABS(X(2)-X(25))
613 P(63)=ABS(X(2)-X(26))
614 P(64)=ABS(X(2)-X(27))
615 P(65)=ABS(X(2)-X(28))
616 P(66)=ABS(X(2)-X(29))
617 P(67)=ABS(X(2)-X(30))
618 P(68)=ABS(X(3)-X(4))
619 P(69)=ABS(X(3)-X(5))
620 P(70)=ABS(X(3)-X(6))
621 P(71)=ABS(X(3)-X(7))
622 P(72)=ABS(X(3)-X(8))
623 P(73)=ABS(X(3)-X(9))
624 P(74)=ABS(X(3)-X(10))
625 P(75)=ABS(X(3)-X(11))
626 P(76)=ABS(X(3)-X(12))
627 P(77)=ABS(X(3)-X(13))
628 P(78)=ABS(X(3)-X(14))
629 P(79)=ABS(X(3)-X(15))
630 P(80)=ABS(X(3)-X(16))
631 P(81)=ABS(X(3)-X(17))
632 P(82)=ABS(X(3)-X(18))
633 P(83)=ABS(X(3)-X(19))
634 P(84)=ABS(X(3)-X(20))
635 P(85)=ABS(X(3)-X(21))
636 P(86)=ABS(X(3)-X(22))
637 P(87)=ABS(X(3)-X(23))
638 P(88)=ABS(X(3)-X(24))
639 P(89)=ABS(X(3)-X(25))
640 P(90)=ABS(X(3)-X(26))
641 P(91)=ABS(X(3)-X(27))
642 P(92)=ABS(X(3)-X(28))
643 P(93)=ABS(X(3)-X(29))
644 P(94)=ABS(X(3)-X(30))
645 P(95)=ABS(X(4)-X(5))
646 P(96)=ABS(X(4)-X(6))
647 P(97)=ABS(X(4)-X(7))
648 P(98)=ABS(X(4)-X(8))
649 P(99)=ABS(X(4)-X(9))
650 P(100)=ABS(X(4)-X(10))
651 P(101)=ABS(X(4)-X(11))
652 P(102)=ABS(X(4)-X(12))
653 P(103)=ABS(X(4)-X(13))
654 P(104)=ABS(X(4)-X(14))
655 P(105)=ABS(X(4)-X(15))
656 P(106)=ABS(X(4)-X(16))
657 P(107)=ABS(X(4)-X(17))
658 P(108)=ABS(X(4)-X(18))
659 P(109)=ABS(X(4)-X(19))
660 P(110)=ABS(X(4)-X(20))
661 P(111)=ABS(X(4)-X(21))
662 P(112)=ABS(X(4)-X(22))
663 P(113)=ABS(X(4)-X(23))
664 P(114)=ABS(X(4)-X(24))
665 P(115)=ABS(X(4)-X(25))
666 P(116)=ABS(X(4)-X(26))
667 P(117)=ABS(X(4)-X(27))
668 P(118)=ABS(X(4)-X(28))
669 P(119)=ABS(X(4)-X(29))
670 P(120)=ABS(X(4)-X(30))
671 P(121)=ABS(X(5)-X(6))
672 P(122)=ABS(X(5)-X(7))
673 P(123)=ABS(X(5)-X(8))
674 P(124)=ABS(X(5)-X(9))
675 P(125)=ABS(X(5)-X(10))
676 P(126)=ABS(X(5)-X(11))
677 P(127)=ABS(X(5)-X(12))
678 P(128)=ABS(X(5)-X(13))
679 P(129)=ABS(X(5)-X(14))
680 P(130)=ABS(X(5)-X(15))
681 P(131)=ABS(X(5)-X(16))
682 P(132)=ABS(X(5)-X(17))
683 P(133)=ABS(X(5)-X(18))
684 P(134)=ABS(X(5)-X(19))
685 P(135)=ABS(X(5)-X(20))
686 P(136)=ABS(X(5)-X(21))
687 P(137)=ABS(X(5)-X(22))
688 P(138)=ABS(X(5)-X(23))
689 P(139)=ABS(X(5)-X(24))
690 P(140)=ABS(X(5)-X(25))
691 P(141)=ABS(X(5)-X(26))
692 P(142)=ABS(X(5)-X(27))
693 P(143)=ABS(X(5)-X(28))
694 P(144)=ABS(X(5)-X(29))
695 P(145)=ABS(X(5)-X(30))
696 P(146)=ABS(X(6)-X(7))
697 P(147)=ABS(X(6)-X(8))
698 P(148)=ABS(X(6)-X(9))
699 P(149)=ABS(X(6)-X(10))
700 P(150)=ABS(X(6)-X(11))
701 P(151)=ABS(X(6)-X(12))
702 P(152)=ABS(X(6)-X(13))
703 P(153)=ABS(X(6)-X(14))
704 P(154)=ABS(X(6)-X(15))
705 P(155)=ABS(X(6)-X(16))
706 P(156)=ABS(X(6)-X(17))
707 P(157)=ABS(X(6)-X(18))
708 P(158)=ABS(X(6)-X(19))
709 P(159)=ABS(X(6)-X(20))
710 P(160)=ABS(X(6)-X(21))
711 P(161)=ABS(X(6)-X(22))
712 P(162)=ABS(X(6)-X(23))
713 P(163)=ABS(X(6)-X(24))
714 P(164)=ABS(X(6)-X(25))
715 P(165)=ABS(X(6)-X(26))
716 P(166)=ABS(X(6)-X(27))
717 P(167)=ABS(X(6)-X(28))
718 P(168)=ABS(X(6)-X(29))
719 P(169)=ABS(X(6)-X(30))
720 P(170)=ABS(X(7)-X(8))
721 P(171)=ABS(X(7)-X(9))
722 P(172)=ABS(X(7)-X(10))
723 P(173)=ABS(X(7)-X(11))
724 P(174)=ABS(X(7)-X(12))
725 P(175)=ABS(X(7)-X(13))
726 P(176)=ABS(X(7)-X(14))
727 P(177)=ABS(X(7)-X(15))
728 P(178)=ABS(X(7)-X(16))
729 P(179)=ABS(X(7)-X(17))
730 P(180)=ABS(X(7)-X(18))
731 P(181)=ABS(X(7)-X(19))
732 P(182)=ABS(X(7)-X(20))
733 P(183)=ABS(X(7)-X(21))
734 P(184)=ABS(X(7)-X(22))
735 P(185)=ABS(X(7)-X(23))
736 P(186)=ABS(X(7)-X(24))
737 P(187)=ABS(X(7)-X(25))
738 P(188)=ABS(X(7)-X(26))
739 P(189)=ABS(X(7)-X(27))
740 P(190)=ABS(X(7)-X(28))
741 P(191)=ABS(X(7)-X(29))
742 P(192)=ABS(X(7)-X(30))
743 P(193)=ABS(X(8)-X(9))
744 P(194)=ABS(X(8)-X(10))
745 P(195)=ABS(X(8)-X(11))
746 P(196)=ABS(X(8)-X(12))
747 P(197)=ABS(X(8)-X(13))
748 P(198)=ABS(X(8)-X(14))
749 P(199)=ABS(X(8)-X(15))
750 P(200)=ABS(X(8)-X(16))
751 P(201)=ABS(X(8)-X(17))
752 P(202)=ABS(X(8)-X(18))
753 P(203)=ABS(X(8)-X(19))
754 P(204)=ABS(X(8)-X(20))
755 P(205)=ABS(X(8)-X(21))
756 P(206)=ABS(X(8)-X(22))
757 P(207)=ABS(X(8)-X(23))
758 P(208)=ABS(X(8)-X(24))
759 P(209)=ABS(X(8)-X(25))
760 P(210)=ABS(X(8)-X(26))
761 P(211)=ABS(X(8)-X(27))
762 P(212)=ABS(X(8)-X(28))
763 P(213)=ABS(X(8)-X(29))
764 P(214)=ABS(X(8)-X(30))
765 P(215)=ABS(X(9)-X(10))
766 P(216)=ABS(X(9)-X(11))
767 P(217)=ABS(X(9)-X(12))
768 P(218)=ABS(X(9)-X(13))
769 P(219)=ABS(X(9)-X(14))
770 P(220)=ABS(X(9)-X(15))
771 P(221)=ABS(X(9)-X(16))
772 P(222)=ABS(X(9)-X(17))
773 P(223)=ABS(X(9)-X(18))
774 P(224)=ABS(X(9)-X(19))
775 P(225)=ABS(X(9)-X(20))
776 P(226)=ABS(X(9)-X(21))
777 P(227)=ABS(X(9)-X(22))
778 P(228)=ABS(X(9)-X(23))
779 P(229)=ABS(X(9)-X(24))
780 P(230)=ABS(X(9)-X(25))
781 P(231)=ABS(X(9)-X(26))
782 P(232)=ABS(X(9)-X(27))
783 P(233)=ABS(X(9)-X(28))
784 P(234)=ABS(X(9)-X(29))
785 P(235)=ABS(X(9)-X(30))
786 P(236)=ABS(X(10)-X(11))
787 P(237)=ABS(X(10)-X(12))
788 P(238)=ABS(X(10)-X(13))
789 P(239)=ABS(X(10)-X(14))
790 P(240)=ABS(X(10)-X(15))
791 P(241)=ABS(X(10)-X(16))
792 P(242)=ABS(X(10)-X(17))
793 P(243)=ABS(X(10)-X(18))
794 P(244)=ABS(X(10)-X(19))
795 P(245)=ABS(X(10)-X(20))
796 P(246)=ABS(X(10)-X(21))
797 P(247)=ABS(X(10)-X(22))
798 P(248)=ABS(X(10)-X(23))
799 P(249)=ABS(X(10)-X(24))
800 P(250)=ABS(X(10)-X(25))
801 P(251)=ABS(X(10)-X(26))
802 P(252)=ABS(X(10)-X(27))
803 P(253)=ABS(X(10)-X(28))
804 P(254)=ABS(X(10)-X(29))
805 P(255)=ABS(X(10)-X(30))
806 P(256)=ABS(X(11)-X(12))
807 P(257)=ABS(X(11)-X(13))
808 P(258)=ABS(X(11)-X(14))
809 P(259)=ABS(X(11)-X(15))
810 P(260)=ABS(X(11)-X(16))
811 P(261)=ABS(X(11)-X(17))
812 P(262)=ABS(X(11)-X(18))
813 P(263)=ABS(X(11)-X(19))
814 P(264)=ABS(X(11)-X(20))
815 P(265)=ABS(X(11)-X(21))
816 P(266)=ABS(X(11)-X(22))
817 P(267)=ABS(X(11)-X(23))
818 P(268)=ABS(X(11)-X(24))
819 P(269)=ABS(X(11)-X(25))
820 P(270)=ABS(X(11)-X(26))
821 P(271)=ABS(X(11)-X(27))
822 P(272)=ABS(X(11)-X(28))
823 P(273)=ABS(X(11)-X(29))
824 P(274)=ABS(X(11)-X(30))
825 P(275)=ABS(X(12)-X(13))
826 P(276)=ABS(X(12)-X(14))
827 P(277)=ABS(X(12)-X(15))
828 P(278)=ABS(X(12)-X(16))
829 P(279)=ABS(X(12)-X(17))
830 P(280)=ABS(X(12)-X(18))
831 P(281)=ABS(X(12)-X(19))
832 P(282)=ABS(X(12)-X(20))
833 P(283)=ABS(X(12)-X(21))
834 P(284)=ABS(X(12)-X(22))
835 P(285)=ABS(X(12)-X(23))
836 P(286)=ABS(X(12)-X(24))
837 P(287)=ABS(X(12)-X(25))
838 P(288)=ABS(X(12)-X(26))
839 P(289)=ABS(X(12)-X(27))
840 P(290)=ABS(X(12)-X(28))
841 P(291)=ABS(X(12)-X(29))
842 P(292)=ABS(X(12)-X(30))
843 P(293)=ABS(X(13)-X(14))
844 P(294)=ABS(X(13)-X(15))
845 P(295)=ABS(X(13)-X(16))
846 P(296)=ABS(X(13)-X(17))
847 P(297)=ABS(X(13)-X(18))
848 P(298)=ABS(X(13)-X(19))
849 P(299)=ABS(X(13)-X(20))
850 P(300)=ABS(X(13)-X(21))
851 P(301)=ABS(X(13)-X(22))
852 P(302)=ABS(X(13)-X(23))
853 P(303)=ABS(X(13)-X(24))
854 P(304)=ABS(X(13)-X(25))
855 P(305)=ABS(X(13)-X(26))
856 P(306)=ABS(X(13)-X(27))
857 P(307)=ABS(X(13)-X(28))
858 P(308)=ABS(X(13)-X(29))
859 P(309)=ABS(X(13)-X(30))
860 P(310)=ABS(X(14)-X(15))
861 P(311)=ABS(X(14)-X(16))
862 P(312)=ABS(X(14)-X(17))
863 P(313)=ABS(X(14)-X(18))
864 P(314)=ABS(X(14)-X(19))
865 P(315)=ABS(X(14)-X(20))
866 P(316)=ABS(X(14)-X(21))
867 P(317)=ABS(X(14)-X(22))
868 P(318)=ABS(X(14)-X(23))
869 P(319)=ABS(X(14)-X(24))
870 P(320)=ABS(X(14)-X(25))
871 P(321)=ABS(X(14)-X(26))
872 P(322)=ABS(X(14)-X(27))
873 P(323)=ABS(X(14)-X(28))
874 P(324)=ABS(X(14)-X(29))
875 P(325)=ABS(X(14)-X(30))
876 P(326)=ABS(X(15)-X(16))
877 P(327)=ABS(X(15)-X(17))
878 P(328)=ABS(X(15)-X(18))
879 P(329)=ABS(X(15)-X(19))
880 P(330)=ABS(X(15)-X(20))
881 P(331)=ABS(X(15)-X(21))
882 P(332)=ABS(X(15)-X(22))
883 P(333)=ABS(X(15)-X(23))
884 P(334)=ABS(X(15)-X(24))
885 P(335)=ABS(X(15)-X(25))
886 P(336)=ABS(X(15)-X(26))
887 P(337)=ABS(X(15)-X(27))
888 P(338)=ABS(X(15)-X(28))
889 P(339)=ABS(X(15)-X(29))
890 P(340)=ABS(X(15)-X(30))
891 P(341)=ABS(X(16)-X(17))
892 P(342)=ABS(X(16)-X(18))
893 P(343)=ABS(X(16)-X(19))
894 P(344)=ABS(X(16)-X(20))
895 P(345)=ABS(X(16)-X(21))
896 P(346)=ABS(X(16)-X(22))
897 P(347)=ABS(X(16)-X(23))
898 P(348)=ABS(X(16)-X(24))
899 P(349)=ABS(X(16)-X(25))
900 P(350)=ABS(X(16)-X(26))
901 P(351)=ABS(X(16)-X(27))
902 P(352)=ABS(X(16)-X(28))
903 P(353)=ABS(X(16)-X(29))
904 P(354)=ABS(X(16)-X(30))
905 P(355)=ABS(X(17)-X(18))
906 P(356)=ABS(X(17)-X(19))
907 P(357)=ABS(X(17)-X(20))
908 P(358)=ABS(X(17)-X(21))
909 P(359)=ABS(X(17)-X(22))
910 P(360)=ABS(X(17)-X(23))
911 P(361)=ABS(X(17)-X(24))
912 P(362)=ABS(X(17)-X(25))
913 P(363)=ABS(X(17)-X(26))
914 P(364)=ABS(X(17)-X(27))
915 P(365)=ABS(X(17)-X(28))
916 P(366)=ABS(X(17)-X(29))
917 P(367)=ABS(X(17)-X(30))
918 P(368)=ABS(X(18)-X(19))
919 P(369)=ABS(X(18)-X(20))
920 P(370)=ABS(X(18)-X(21))
921 P(371)=ABS(X(18)-X(22))
922 P(372)=ABS(X(18)-X(23))
923 P(373)=ABS(X(18)-X(24))
924 P(374)=ABS(X(18)-X(25))
925 P(375)=ABS(X(18)-X(26))
926 P(376)=ABS(X(18)-X(27))
927 P(377)=ABS(X(18)-X(28))
928 P(378)=ABS(X(18)-X(29))
929 P(379)=ABS(X(18)-X(30))
930 P(380)=ABS(X(19)-X(20))
931 P(381)=ABS(X(19)-X(21))
932 P(382)=ABS(X(19)-X(22))
933 P(383)=ABS(X(19)-X(23))
934 P(384)=ABS(X(19)-X(24))
935 P(385)=ABS(X(19)-X(25))
936 P(386)=ABS(X(19)-X(26))
937 P(387)=ABS(X(19)-X(27))
938 P(388)=ABS(X(19)-X(28))
939 P(389)=ABS(X(19)-X(29))
940 P(390)=ABS(X(19)-X(30))
941 P(391)=ABS(X(20)-X(21))
942 P(392)=ABS(X(20)-X(22))
943 P(393)=ABS(X(20)-X(23))
944 P(394)=ABS(X(20)-X(24))
945 P(395)=ABS(X(20)-X(25))
946 P(396)=ABS(X(20)-X(26))
947 P(397)=ABS(X(20)-X(27))
948 P(398)=ABS(X(20)-X(28))
949 P(399)=ABS(X(20)-X(29))
950 P(400)=ABS(X(20)-X(30))
951 P(401)=ABS(X(21)-X(22))
952 P(402)=ABS(X(21)-X(23))
953 P(403)=ABS(X(21)-X(24))
954 P(404)=ABS(X(21)-X(25))
955 P(405)=ABS(X(21)-X(26))
956 P(406)=ABS(X(21)-X(27))
957 P(407)=ABS(X(21)-X(28))
958 P(408)=ABS(X(21)-X(29))
959 P(409)=ABS(X(21)-X(30))
960 P(410)=ABS(X(22)-X(23))
961 P(411)=ABS(X(22)-X(24))
962 P(412)=ABS(X(22)-X(25))
963 P(413)=ABS(X(22)-X(26))
964 P(414)=ABS(X(22)-X(27))
965 P(415)=ABS(X(22)-X(28))
966 P(416)=ABS(X(22)-X(29))
967 P(417)=ABS(X(22)-X(30))
968 P(418)=ABS(X(23)-X(24))
969 P(419)=ABS(X(23)-X(25))
970 P(420)=ABS(X(23)-X(26))
971 P(421)=ABS(X(23)-X(27))
972 P(422)=ABS(X(23)-X(28))
973 P(423)=ABS(X(23)-X(29))
974 P(424)=ABS(X(23)-X(30))
975 P(425)=ABS(X(24)-X(25))
976 P(426)=ABS(X(24)-X(26))
977 P(427)=ABS(X(24)-X(27))
978 P(428)=ABS(X(24)-X(28))
979 P(429)=ABS(X(24)-X(29))
980 P(430)=ABS(X(24)-X(30))
981 P(431)=ABS(X(25)-X(26))
982 P(432)=ABS(X(25)-X(27))
983 P(433)=ABS(X(25)-X(28))
984 P(434)=ABS(X(25)-X(29))
985 P(435)=ABS(X(25)-X(30))
986 P(436)=ABS(X(26)-X(27))
987 P(437)=ABS(X(26)-X(28))
988 P(438)=ABS(X(26)-X(29))
989 P(439)=ABS(X(26)-X(30))
990 P(440)=ABS(X(27)-X(28))
991 P(441)=ABS(X(27)-X(29))
992 P(442)=ABS(X(27)-X(30))
993 P(443)=ABS(X(28)-X(29))
994 P(444)=ABS(X(28)-X(30))
995 P(445)=ABS(X(29)-X(30))
1088 FOR INSI=11 TO 445
1091 IF P(INSI)<.5 THEN P(INSI)=1 ELSE P(INSI)=0
1095 NEXT INSI
1238 P11B=3*P(11)+2*P(12)+0*P(13)+0*P(14)+2*P(15)+10*P(16)+5*P(17)+0*P(18)+5*P(19)+2*P(20)
1239 P12B=5*P(21)+0*P(22)+0*P(23)+2*P(24)
1240 P13B=0*P(25)+5*P(26)+6*P(27)+3*P(28)+0*P(29)+1*P(30)+10*P(31)+0*P(32)+10*P(33)+2*P(34)+1*P(35)+1*P(36)+1*P(37)+0*P(38)+1*P(39)
1241 P14B=4*P(40)+0*P(41)+10*P(42)+4*P(43)+0*P(44)+0*P(45)+2*P(46)+2*P(47)+1*P(48)+0*P(49)+5*P(50)+0*P(51)+0*P(52)+0*P(53)+0*P(54)
1242 P15B=2*P(55)+0*P(56)+1*P(57)+6*P(58)+1*P(59)+0*P(60)+1*P(61)+2*P(62)+2*P(63)+5*P(64)+1*P(65)+10*P(66)+5*P(67)
1243 P16B=3*P(68)+4*P(69)+0*P(70)+5*P(71)+5*P(72)+5*P(73)+1*P(74)+4*P(75)+1*P(76)+0*P(77)+4*P(78)+0*P(79)+4*P(80)+0*P(81)+6*P(82)
1244 P17B=3*P(83)+2*P(84)+5*P(85)+5*P(86)+2*P(87)+1*P(88)+0*P(89)+0*P(90)+3*P(91)+1*P(92)+0*P(93)+2*P(94)+0*P(95)+0*P(96)+0*P(97)
1245 P18B=2*P(98)+2*P(99)+0*P(100)+6*P(101)+0*P(102)+2*P(103)+5*P(104)+2*P(105)+5*P(106)+1*P(107)+1*P(108)+1*P(109)+1*P(110)+2*P(111)+2*P(112)
1246 P19B=4*P(113)+0*P(114)+2*P(115)+0*P(116)+2*P(117)+2*P(118)+5*P(119)+5*P(120)+5*P(121)+2*P(122)+0*P(123)+0*P(124)+0*P(125)+0*P(126)+2*P(127)
1247 P20B=0*P(128)+0*P(129)+0*P(130)+0*P(131)+2*P(132)+1*P(133)+0*P(134)+0*P(135)+2*P(136)+0*P(137)+5*P(138)+1*P(139)+0*P(140)+2*P(141)+1*P(142)
1248 P21B=0*P(143)+2*P(144)+1*P(145)+1*P(146)+2*P(147)+2*P(148)+1*P(149)+4*P(150)+10*P(151)+10*P(152)+2*P(153)+5*P(154)+5*P(155)+0*P(156)+5*P(157)
1249 P22B=0*P(158)+0*P(159)+0*P(160)+10*P(161)+0*P(162)+0*P(163)+0*P(164)+4*P(165)+0*P(166)+10*P(167)+1*P(168)+1*P(169)+10*P(170)+10*P(171)+5*P(172)
1250 P23B=10*P(173)+10*P(174)+6*P(175)+0*P(176)+0*P(177)+10*P(178)+2*P(179)+1*P(180)+10*P(181)+1*P(182)+5*P(183)+5*P(184)+2*P(185)+3*P(186)+5*P(187)
1251 P24B=0*P(188)+2*P(189)+0*P(190)+1*P(191)+3*P(192)+1*P(193)+3*P(194)+5*P(195)+0*P(196)+0*P(197)+0*P(198)+2*P(199)+4*P(200)+5*P(201)+2*P(202)
1252 P25B=10*P(203)+6*P(204)+0*P(205)+5*P(206)+5*P(207)+2*P(208)+5*P(209)+0*P(210)+5*P(211)+5*P(212)+0*P(213)+2*P(214)+10*P(215)+2*P(216)+1*P(217)
1253 P26B=5*P(218)+2*P(219)+0*P(220)+3*P(221)+0*P(222)+2*P(223)+0*P(224)+0*P(225)+4*P(226)+0*P(227)+5*P(228)+2*P(229)+0*P(230)+5*P(231)+2*P(232)
1254 P27B=2*P(233)+5*P(234)+2*P(235)+5*P(236)+5*P(237)+6*P(238)+0*P(239)+1*P(240)+5*P(241)+5*P(242)+0*P(243)+5*P(244)+2*P(245)+3*P(246)+5*P(247)
1255 P28B=0*P(248)+5*P(249)+2*P(250)+10*P(251)+10*P(252)+1*P(253)+5*P(254)+2*P(255)+0*P(256)+0*P(257)+1*P(258)+2*P(259)+1*P(260)+0*P(261)+2*P(262)
1256 P29B=0*P(263)+0*P(264)+0*P(265)+6*P(266)+6*P(267)+0*P(268)+4*P(269)+5*P(270)+3*P(271)+2*P(272)+2*P(273)+10*P(274)+5*P(275)+5*P(276)+2*P(277)
1257 P30B=0*P(278)+0*P(279)+0*P(280)+0*P(281)+2*P(282)+0*P(283)+4*P(284)+5*P(285)+10*P(286)+1*P(287)+0*P(288)+0*P(289)+0*P(290)+0*P(291)+1*P(292)
1258 P31B=2*P(293)+0*P(294)+4*P(295)+2*P(296)+2*P(297)+1*P(298)+0*P(299)+6*P(300)+2*P(301)+1*P(302)+5*P(303)+5*P(304)+0*P(305)+0*P(306)+1*P(307)
1259 P32B=5*P(308)+5*P(309)+2*P(310)+1*P(311)+0*P(312)+5*P(313)+3*P(314)+10*P(315)+0*P(316)+0*P(317)+4*P(318)+2*P(319)+0*P(320)+0*P(321)+4*P(322)
1260 P33B=2*P(323)+5*P(324)+5*P(325)+4*P(326)+5*P(327)+1*P(328)+0*P(329)+1*P(330)+0*P(331)+5*P(332)+0*P(333)+2*P(334)+0*P(335)+0*P(336)+5*P(337)
1261 P34B=1*P(338)+1*P(339)+0*P(340)+0*P(341)+3*P(342)+0*P(343)+2*P(344)+2*P(345)+0*P(346)+2*P(347)+0*P(348)+5*P(349)+0*P(350)+5*P(351)+2*P(352)
1262 P35B=5*P(353)+10*P(354)+2*P(355)+2*P(356)+0*P(357)+0*P(358)+0*P(359)+6*P(360)+5*P(361)+3*P(362)+5*P(363)+0*P(364)+0*P(365)+5*P(366)+1*P(367)
1263 P36B=5*P(368)+1*P(369)+2*P(370)+10*P(371)+10*P(372)+4*P(373)+0*P(374)+0*P(375)+5*P(376)+0*P(377)+0*P(378)+0*P(379)+0*P(380)+5*P(381)+5*P(382)
1264 P38B=1*P(383)+0*P(384)+5*P(385)+2*P(386)+1*P(387)+2*P(388)+10*P(389)+10*P(390)+5*P(391)+2*P(392)+1*P(393)+3*P(394)+1*P(395)+5*P(396)+6*P(397)
1265 P39B=5*P(398)+5*P(399)+3*P(400)+4*P(401)+0*P(402)+1*P(403)+0*P(404)+0*P(405)+0*P(406)+5*P(407)+0*P(408)+0*P(409)+5*P(410)+0*P(411)+4*P(412)
1266 P40B=4*P(413)+5*P(414)+0*P(415)+2*P(416)+5*P(417)+0*P(418)+4*P(419)+4*P(420)+1*P(421)+0*P(422)+2*P(423)+2*P(424)+5*P(425)+5*P(426)+0*P(427)
1267 P41B=1*P(428)+0*P(429)+0*P(430)+1*P(431)+0*P(432)+10*P(433)+1*P(434)+0*P(435)+0*P(436)+0*P(437)+0*P(438)+0*P(439)+0*P(440)+0*P(441)+10*P(442)
1268 P42B=2*P(443)+2*P(444)+2*P(445)
1388 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B+P21B+P22B+P23B+P24B+P25B+P26B
1395 P2=P27B+P28B+P29B+P30B+P31B+P32B+P33B+P34B+P35B+P36B+P37B+P38B+P39B+P40B+P41B+P42B
1397 P4=0
1398 P3=0
1448 P5=P1+P2+P3+P4
1450 P=-P5+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P5
1454 FOR KLX=1 TO 30
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-8 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12),A(13),A(14),A(15)
1922 PRINT A(16),A(17),A(18),A(19),A(20)
1924 PRINT A(21),A(22),A(23),A(24),A(25)
1926 PRINT A(26),A(27),A(28),A(29),A(30)
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its output through JJJJ=-29975 (in compressed form and to be interpreted in accordance with line 1916 through line 1926; copied manually from the computer monitor) is presented below.
-30472 -6 6
4 5 7 5 0
2 5 6 4 3
0 6 0 1 7
1 1 3 0 0
6 1 2 2 7
6 2 3 6 7
-30360 -6 6
3 6 7 6 2
0 6 5 1 4
2 5 2 3 7
3 1 4 2 2
5 1 0 0 7
5 0 4 5 7
-29975 -7 7
1 0 6 0 1
3 0 2 7 5
4 2 4 1 6
1 7 5 4 4
2 7 3 3 6
2 3 7 2 5
Among the candidate solutions presented above, the best are at JJJJ=-30472 and JJJJ=-30360 with an objective function value of 6.
The output above was produced in 16 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 to, for example, 128 FOR I=1 TO 2, one may or may not obtain the best objective function value of the output above, 6, which may or may not optimal. Generally speaking, in order to increase the probability of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; that does not have to be line 128. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] R.C. Carlson, G.L. Nemhauser, Scheduling to minimize interaction cost, Operations Research, 14 (1966) 52-58.
[2] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[3] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[4] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
Wednesday, November 12, 2008
Scheduling Fifteen Activities Competing for Four Facilities
Jsun Yui Wong
This is an instance of the Carlson and Nemhauser problem of scheduling to minimize interaction cost [1]. The computer program listed below slightly changes the mathematical formulation on page 6 of Heragu and Kusiak [2] and on page 140 of Heragu [3]; its goal is to minimize the total interaction cost of assigning fifteen courses to four time periods, which are period 0, period 1, period 2, and period 3. As the individual interaction costs it uses the interdepartmental flows (of n=20, not n=15) presented in Nugent, Vollmann, and Ruml [4, p. 169]; these flows are used in line 1238 through line 1259 below.
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
21 FOR IOC=1 TO 15
23 B(IOC)=0
24 NEXT IOC
51 FOR IOCTT=1 TO 15
53 N(IOCTT)=3
57 NEXT IOCTT
61 FOR KLQ=1 TO 15
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 15
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 15
128 FOR I=1 TO 1
129 FOR KKQQ=1 TO 15
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 15
133 IF RND<=.5 THEN 298 ELSE 230
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*45)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+15*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 15
364 X(I222)=FIX(X(I222))
368 NEXT I222
371 FOR I223=1 TO 15
374 IF X(I223)>3 THEN X(I223)=3
378 NEXT I223
381 FOR I224=1 TO 15
384 IF X(I224)<0 THEN X(I224)=0
388 NEXT I224
461 IF RND>.1 GOTO 561
471 IOCT1=1+FIX(RND*15)
474 IOCT2=1+FIX(RND*15)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
561 P(11)=ABS(X(1)-X(2))
562 P(12)=ABS(X(1)-X(3))
563 P(13)=ABS(X(1)-X(4))
564 P(14)=ABS(X(1)-X(5))
565 P(15)=ABS(X(1)-X(6))
566 P(16)=ABS(X(1)-X(7))
567 P(17)=ABS(X(1)-X(8))
568 P(18)=ABS(X(1)-X(9))
569 P(19)=ABS(X(1)-X(10))
570 P(20)=ABS(X(1)-X(11))
571 P(21)=ABS(X(1)-X(12))
572 P(22)=ABS(X(1)-X(13))
573 P(23)=ABS(X(1)-X(14))
574 P(24)=ABS(X(1)-X(15))
580 P(25)=ABS(X(2)-X(3))
581 P(26)=ABS(X(2)-X(4))
582 P(27)=ABS(X(2)-X(5))
583 P(28)=ABS(X(2)-X(6))
584 P(29)=ABS(X(2)-X(7))
585 P(30)=ABS(X(2)-X(8))
586 P(31)=ABS(X(2)-X(9))
587 P(32)=ABS(X(2)-X(10))
588 P(33)=ABS(X(2)-X(11))
589 P(34)=ABS(X(2)-X(12))
590 P(35)=ABS(X(2)-X(13))
591 P(36)=ABS(X(2)-X(14))
592 P(37)=ABS(X(2)-X(15))
598 P(38)=ABS(X(3)-X(4))
599 P(39)=ABS(X(3)-X(5))
600 P(40)=ABS(X(3)-X(6))
601 P(41)=ABS(X(3)-X(7))
602 P(42)=ABS(X(3)-X(8))
603 P(43)=ABS(X(3)-X(9))
604 P(44)=ABS(X(3)-X(10))
605 P(45)=ABS(X(3)-X(11))
606 P(46)=ABS(X(3)-X(12))
607 P(47)=ABS(X(3)-X(13))
608 P(48)=ABS(X(3)-X(14))
609 P(49)=ABS(X(3)-X(15))
615 P(50)=ABS(X(4)-X(5))
616 P(51)=ABS(X(4)-X(6))
617 P(52)=ABS(X(4)-X(7))
618 P(53)=ABS(X(4)-X(8))
619 P(54)=ABS(X(4)-X(9))
620 P(55)=ABS(X(4)-X(10))
621 P(56)=ABS(X(4)-X(11))
622 P(57)=ABS(X(4)-X(12))
623 P(58)=ABS(X(4)-X(13))
624 P(59)=ABS(X(4)-X(14))
625 P(60)=ABS(X(4)-X(15))
631 P(61)=ABS(X(5)-X(6))
632 P(62)=ABS(X(5)-X(7))
633 P(63)=ABS(X(5)-X(8))
634 P(64)=ABS(X(5)-X(9))
635 P(65)=ABS(X(5)-X(10))
636 P(66)=ABS(X(5)-X(11))
637 P(67)=ABS(X(5)-X(12))
638 P(68)=ABS(X(5)-X(13))
639 P(69)=ABS(X(5)-X(14))
640 P(70)=ABS(X(5)-X(15))
646 P(71)=ABS(X(6)-X(7))
647 P(72)=ABS(X(6)-X(8))
648 P(73)=ABS(X(6)-X(9))
649 P(74)=ABS(X(6)-X(10))
650 P(75)=ABS(X(6)-X(11))
651 P(76)=ABS(X(6)-X(12))
652 P(77)=ABS(X(6)-X(13))
653 P(78)=ABS(X(6)-X(14))
654 P(79)=ABS(X(6)-X(15))
660 P(80)=ABS(X(7)-X(8))
661 P(81)=ABS(X(7)-X(9))
662 P(82)=ABS(X(7)-X(10))
663 P(83)=ABS(X(7)-X(11))
664 P(84)=ABS(X(7)-X(12))
665 P(85)=ABS(X(7)-X(13))
666 P(86)=ABS(X(7)-X(14))
667 P(87)=ABS(X(7)-X(15))
673 P(88)=ABS(X(8)-X(9))
674 P(89)=ABS(X(8)-X(10))
675 P(90)=ABS(X(8)-X(11))
676 P(91)=ABS(X(8)-X(12))
677 P(92)=ABS(X(8)-X(13))
678 P(93)=ABS(X(8)-X(14))
679 P(94)=ABS(X(8)-X(15))
685 P(95)=ABS(X(9)-X(10))
686 P(96)=ABS(X(9)-X(11))
687 P(97)=ABS(X(9)-X(12))
688 P(98)=ABS(X(9)-X(13))
689 P(99)=ABS(X(9)-X(14))
690 P(100)=ABS(X(9)-X(15))
696 P(101)=ABS(X(10)-X(11))
697 P(102)=ABS(X(10)-X(12))
698 P(103)=ABS(X(10)-X(13))
699 P(104)=ABS(X(10)-X(14))
700 P(105)=ABS(X(10)-X(15))
706 P(106)=ABS(X(11)-X(12))
707 P(107)=ABS(X(11)-X(13))
708 P(108)=ABS(X(11)-X(14))
709 P(109)=ABS(X(11)-X(15))
715 P(110)=ABS(X(12)-X(13))
716 P(111)=ABS(X(12)-X(14))
717 P(112)=ABS(X(12)-X(15))
723 P(113)=ABS(X(13)-X(14))
724 P(114)=ABS(X(13)-X(15))
730 P(115)=ABS(X(14)-X(15))
788 FOR INSI=11 TO 115
791 IF P(INSI)<.5 THEN P(INSI)=1 ELSE P(INSI)=0
795 NEXT INSI
1238 P11B=0*P(11)+5*P(12)+0*P(13)+5*P(14)+2*P(15)+10*P(16)+3*P(17)+1*P(18)+5*P(19)+5*P(20)
1239 P12B=5*P(21)+0*P(22)+0*P(23)+5*P(24)
1240 P13B=3*P(25)+10*P(26)+5*P(27)+1*P(28)+5*P(29)+1*P(30)+2*P(31)+4*P(32)+2*P(33)
1241 P14B=5*P(34)+0*P(35)+10*P(36)+10*P(37)
1243 P15B=2*P(38)+0*P(39)+5*P(40)+2*P(41)+4*P(42)+4*P(43)+5*P(44)+0*P(45)
1244 P16B=0*P(46)+0*P(47)+5*P(48)+1*P(49)
1245 P17B=1*P(50)+0*P(51)+5*P(52)+2*P(53)+1*P(54)+0*P(55)+10*P(56)
1246 P18B=2*P(57)+2*P(58)+0*P(59)+2*P(60)
1248 P19B=5*P(61)+6*P(62)+5*P(63)+2*P(64)+5*P(65)+2*P(66)+0*P(67)+5*P(68)+1*P(69)+1*P(70)
1249 P20B=5*P(71)+2*P(72)+1*P(73)+6*P(74)+0*P(75)+0*P(76)+10*P(77)+0*P(78)+2*P(79)
1250 P21B=0*P(80)+0*P(81)+0*P(82)+5*P(83)+10*P(84)+2*P(85)+2*P(86)+5*P(87)
1251 P22B=1*P(88)+1*P(89)+10*P(90)+10*P(91)+2*P(92)+0*P(93)+10*P(94)
1255 P23B=2*P(95)+0*P(96)+3*P(97)+5*P(98)+5*P(99)+0*P(100)
1257 P24B=5*P(101)+5*P(102)+0*P(103)+5*P(104)+1*P(105)
1258 P25B=5*P(106)+2*P(107)+5*P(108)+1*P(109)
1259 P26B=2*P(110)+10*P(111)+5*P(112)+2*P(113)+2*P(114)+5*P(115)
1445 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B+P21B+P22B+P23B+P24B+P25B+P26B
1446 P2=0
1448 P3=P1+P2
1450 P=-P3+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P3
1454 FOR KLX=1 TO 15
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-9999 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12),A(13),A(14),A(15)
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the candidate solutions produced from JJJJ=-32000 through JJJJ=-31995 (in compressed form and to be interpreted in accordance with line 1916 through line 1920; copied manually from the computer monitor) are presented below.
-32000 -20 20
0 0 2 3 2
3 1 1 3 1
2 3 0 1 2
-31999 -21 21
0 2 1 0 1
0 2 2 2 3
1 1 3 0 3
-31998 -17 17
2 0 1 2 1
2 3 3 3 3
0 1 0 2 1
-31997 -17 17
0 3 2 0 2
0 1 1 1 1
3 2 3 0 2
-31996 -17 17
1 0 2 1 2
1 3 3 3 3
0 2 0 1 2
-31995 -18 18
1 0 3 1 3
1 0 0 2 0
2 3 0 1 2
Among the candidate solutions presented above, the best are at JJJJ=-31998, JJJJ=-31997, and JJJJ=-31996 with an objective function value of 17.
The output above was produced in one minute on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
References
[1] R.C. Carlson, G.L. Nemhauser, Scheduling to minimize interaction cost, Operations Research 14 (1966) 52-58.
[2] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[3] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[4] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
This is an instance of the Carlson and Nemhauser problem of scheduling to minimize interaction cost [1]. The computer program listed below slightly changes the mathematical formulation on page 6 of Heragu and Kusiak [2] and on page 140 of Heragu [3]; its goal is to minimize the total interaction cost of assigning fifteen courses to four time periods, which are period 0, period 1, period 2, and period 3. As the individual interaction costs it uses the interdepartmental flows (of n=20, not n=15) presented in Nugent, Vollmann, and Ruml [4, p. 169]; these flows are used in line 1238 through line 1259 below.
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
21 FOR IOC=1 TO 15
23 B(IOC)=0
24 NEXT IOC
51 FOR IOCTT=1 TO 15
53 N(IOCTT)=3
57 NEXT IOCTT
61 FOR KLQ=1 TO 15
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 15
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 15
128 FOR I=1 TO 1
129 FOR KKQQ=1 TO 15
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 15
133 IF RND<=.5 THEN 298 ELSE 230
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*45)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+15*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 15
364 X(I222)=FIX(X(I222))
368 NEXT I222
371 FOR I223=1 TO 15
374 IF X(I223)>3 THEN X(I223)=3
378 NEXT I223
381 FOR I224=1 TO 15
384 IF X(I224)<0 THEN X(I224)=0
388 NEXT I224
461 IF RND>.1 GOTO 561
471 IOCT1=1+FIX(RND*15)
474 IOCT2=1+FIX(RND*15)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
561 P(11)=ABS(X(1)-X(2))
562 P(12)=ABS(X(1)-X(3))
563 P(13)=ABS(X(1)-X(4))
564 P(14)=ABS(X(1)-X(5))
565 P(15)=ABS(X(1)-X(6))
566 P(16)=ABS(X(1)-X(7))
567 P(17)=ABS(X(1)-X(8))
568 P(18)=ABS(X(1)-X(9))
569 P(19)=ABS(X(1)-X(10))
570 P(20)=ABS(X(1)-X(11))
571 P(21)=ABS(X(1)-X(12))
572 P(22)=ABS(X(1)-X(13))
573 P(23)=ABS(X(1)-X(14))
574 P(24)=ABS(X(1)-X(15))
580 P(25)=ABS(X(2)-X(3))
581 P(26)=ABS(X(2)-X(4))
582 P(27)=ABS(X(2)-X(5))
583 P(28)=ABS(X(2)-X(6))
584 P(29)=ABS(X(2)-X(7))
585 P(30)=ABS(X(2)-X(8))
586 P(31)=ABS(X(2)-X(9))
587 P(32)=ABS(X(2)-X(10))
588 P(33)=ABS(X(2)-X(11))
589 P(34)=ABS(X(2)-X(12))
590 P(35)=ABS(X(2)-X(13))
591 P(36)=ABS(X(2)-X(14))
592 P(37)=ABS(X(2)-X(15))
598 P(38)=ABS(X(3)-X(4))
599 P(39)=ABS(X(3)-X(5))
600 P(40)=ABS(X(3)-X(6))
601 P(41)=ABS(X(3)-X(7))
602 P(42)=ABS(X(3)-X(8))
603 P(43)=ABS(X(3)-X(9))
604 P(44)=ABS(X(3)-X(10))
605 P(45)=ABS(X(3)-X(11))
606 P(46)=ABS(X(3)-X(12))
607 P(47)=ABS(X(3)-X(13))
608 P(48)=ABS(X(3)-X(14))
609 P(49)=ABS(X(3)-X(15))
615 P(50)=ABS(X(4)-X(5))
616 P(51)=ABS(X(4)-X(6))
617 P(52)=ABS(X(4)-X(7))
618 P(53)=ABS(X(4)-X(8))
619 P(54)=ABS(X(4)-X(9))
620 P(55)=ABS(X(4)-X(10))
621 P(56)=ABS(X(4)-X(11))
622 P(57)=ABS(X(4)-X(12))
623 P(58)=ABS(X(4)-X(13))
624 P(59)=ABS(X(4)-X(14))
625 P(60)=ABS(X(4)-X(15))
631 P(61)=ABS(X(5)-X(6))
632 P(62)=ABS(X(5)-X(7))
633 P(63)=ABS(X(5)-X(8))
634 P(64)=ABS(X(5)-X(9))
635 P(65)=ABS(X(5)-X(10))
636 P(66)=ABS(X(5)-X(11))
637 P(67)=ABS(X(5)-X(12))
638 P(68)=ABS(X(5)-X(13))
639 P(69)=ABS(X(5)-X(14))
640 P(70)=ABS(X(5)-X(15))
646 P(71)=ABS(X(6)-X(7))
647 P(72)=ABS(X(6)-X(8))
648 P(73)=ABS(X(6)-X(9))
649 P(74)=ABS(X(6)-X(10))
650 P(75)=ABS(X(6)-X(11))
651 P(76)=ABS(X(6)-X(12))
652 P(77)=ABS(X(6)-X(13))
653 P(78)=ABS(X(6)-X(14))
654 P(79)=ABS(X(6)-X(15))
660 P(80)=ABS(X(7)-X(8))
661 P(81)=ABS(X(7)-X(9))
662 P(82)=ABS(X(7)-X(10))
663 P(83)=ABS(X(7)-X(11))
664 P(84)=ABS(X(7)-X(12))
665 P(85)=ABS(X(7)-X(13))
666 P(86)=ABS(X(7)-X(14))
667 P(87)=ABS(X(7)-X(15))
673 P(88)=ABS(X(8)-X(9))
674 P(89)=ABS(X(8)-X(10))
675 P(90)=ABS(X(8)-X(11))
676 P(91)=ABS(X(8)-X(12))
677 P(92)=ABS(X(8)-X(13))
678 P(93)=ABS(X(8)-X(14))
679 P(94)=ABS(X(8)-X(15))
685 P(95)=ABS(X(9)-X(10))
686 P(96)=ABS(X(9)-X(11))
687 P(97)=ABS(X(9)-X(12))
688 P(98)=ABS(X(9)-X(13))
689 P(99)=ABS(X(9)-X(14))
690 P(100)=ABS(X(9)-X(15))
696 P(101)=ABS(X(10)-X(11))
697 P(102)=ABS(X(10)-X(12))
698 P(103)=ABS(X(10)-X(13))
699 P(104)=ABS(X(10)-X(14))
700 P(105)=ABS(X(10)-X(15))
706 P(106)=ABS(X(11)-X(12))
707 P(107)=ABS(X(11)-X(13))
708 P(108)=ABS(X(11)-X(14))
709 P(109)=ABS(X(11)-X(15))
715 P(110)=ABS(X(12)-X(13))
716 P(111)=ABS(X(12)-X(14))
717 P(112)=ABS(X(12)-X(15))
723 P(113)=ABS(X(13)-X(14))
724 P(114)=ABS(X(13)-X(15))
730 P(115)=ABS(X(14)-X(15))
788 FOR INSI=11 TO 115
791 IF P(INSI)<.5 THEN P(INSI)=1 ELSE P(INSI)=0
795 NEXT INSI
1238 P11B=0*P(11)+5*P(12)+0*P(13)+5*P(14)+2*P(15)+10*P(16)+3*P(17)+1*P(18)+5*P(19)+5*P(20)
1239 P12B=5*P(21)+0*P(22)+0*P(23)+5*P(24)
1240 P13B=3*P(25)+10*P(26)+5*P(27)+1*P(28)+5*P(29)+1*P(30)+2*P(31)+4*P(32)+2*P(33)
1241 P14B=5*P(34)+0*P(35)+10*P(36)+10*P(37)
1243 P15B=2*P(38)+0*P(39)+5*P(40)+2*P(41)+4*P(42)+4*P(43)+5*P(44)+0*P(45)
1244 P16B=0*P(46)+0*P(47)+5*P(48)+1*P(49)
1245 P17B=1*P(50)+0*P(51)+5*P(52)+2*P(53)+1*P(54)+0*P(55)+10*P(56)
1246 P18B=2*P(57)+2*P(58)+0*P(59)+2*P(60)
1248 P19B=5*P(61)+6*P(62)+5*P(63)+2*P(64)+5*P(65)+2*P(66)+0*P(67)+5*P(68)+1*P(69)+1*P(70)
1249 P20B=5*P(71)+2*P(72)+1*P(73)+6*P(74)+0*P(75)+0*P(76)+10*P(77)+0*P(78)+2*P(79)
1250 P21B=0*P(80)+0*P(81)+0*P(82)+5*P(83)+10*P(84)+2*P(85)+2*P(86)+5*P(87)
1251 P22B=1*P(88)+1*P(89)+10*P(90)+10*P(91)+2*P(92)+0*P(93)+10*P(94)
1255 P23B=2*P(95)+0*P(96)+3*P(97)+5*P(98)+5*P(99)+0*P(100)
1257 P24B=5*P(101)+5*P(102)+0*P(103)+5*P(104)+1*P(105)
1258 P25B=5*P(106)+2*P(107)+5*P(108)+1*P(109)
1259 P26B=2*P(110)+10*P(111)+5*P(112)+2*P(113)+2*P(114)+5*P(115)
1445 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B+P21B+P22B+P23B+P24B+P25B+P26B
1446 P2=0
1448 P3=P1+P2
1450 P=-P3+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P3
1454 FOR KLX=1 TO 15
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1888 NEXT JJJ
1890 IF M>-9999 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12),A(13),A(14),A(15)
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the candidate solutions produced from JJJJ=-32000 through JJJJ=-31995 (in compressed form and to be interpreted in accordance with line 1916 through line 1920; copied manually from the computer monitor) are presented below.
-32000 -20 20
0 0 2 3 2
3 1 1 3 1
2 3 0 1 2
-31999 -21 21
0 2 1 0 1
0 2 2 2 3
1 1 3 0 3
-31998 -17 17
2 0 1 2 1
2 3 3 3 3
0 1 0 2 1
-31997 -17 17
0 3 2 0 2
0 1 1 1 1
3 2 3 0 2
-31996 -17 17
1 0 2 1 2
1 3 3 3 3
0 2 0 1 2
-31995 -18 18
1 0 3 1 3
1 0 0 2 0
2 3 0 1 2
Among the candidate solutions presented above, the best are at JJJJ=-31998, JJJJ=-31997, and JJJJ=-31996 with an objective function value of 17.
The output above was produced in one minute on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
References
[1] R.C. Carlson, G.L. Nemhauser, Scheduling to minimize interaction cost, Operations Research 14 (1966) 52-58.
[2] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[3] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[4] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
Monday, November 10, 2008
A General Integer Programming Computer Program Applied to a Three-Dimensional Layout Problem
Jsun Yui Wong
The problem considered here is essentially the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2] plus a change to more than 12 locations spread over three dimensions. The same interfacility flows [1, p. 33; 2, p. 168] are used here. So one knows the minimum objective function value to this newer problem is 289 [2, p. 159] or smaller.
Line 561 through line 626 of the computer program below extend to three dimensions the mathematical formulation appearing on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1414 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 36
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 36
53 N(IOCTT)=2
57 NEXT IOCTT
61 FOR KLQ=1 TO 36
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 36
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 36
128 FOR I=1 TO 3
129 FOR KKQQ=1 TO 36
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 36
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*108)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+36*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 36
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/3 THEN 471 ELSE IF RND<1/2 THEN 491 ELSE 511
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 36
533 IF X(IOCX)>2 THEN X(IOCX)=1
535 NEXT IOCX
541 FOR IOCY=1 TO 36
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))+ABS(X(25)-X(26))-1
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))+ABS(X(25)-X(27))-1
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))+ABS(X(25)-X(28))-1
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))+ABS(X(25)-X(29))-1
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))+ABS(X(25)-X(30))-1
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))+ABS(X(25)-X(31))-1
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))+ABS(X(25)-X(32))-1
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))+ABS(X(25)-X(33))-1
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))+ABS(X(25)-X(34))-1
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))+ABS(X(25)-X(35))-1
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))+ABS(X(25)-X(36))-1
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))+ABS(X(26)-X(27))-1
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))+ABS(X(26)-X(28))-1
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))+ABS(X(26)-X(29))-1
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))+ABS(X(26)-X(30))-1
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))+ABS(X(26)-X(31))-1
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))+ABS(X(26)-X(32))-1
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))+ABS(X(26)-X(33))-1
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))+ABS(X(26)-X(34))-1
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))+ABS(X(26)-X(35))-1
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))+ABS(X(26)-X(36))-1
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))+ABS(X(27)-X(28))-1
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))+ABS(X(27)-X(29))-1
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))+ABS(X(27)-X(30))-1
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))+ABS(X(27)-X(31))-1
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))+ABS(X(27)-X(32))-1
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))+ABS(X(27)-X(33))-1
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))+ABS(X(27)-X(34))-1
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))+ABS(X(27)-X(35))-1
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))+ABS(X(27)-X(36))-1
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))+ABS(X(28)-X(29))-1
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))+ABS(X(28)-X(30))-1
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))+ABS(X(28)-X(31))-1
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))+ABS(X(28)-X(32))-1
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))+ABS(X(28)-X(33))-1
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))+ABS(X(28)-X(34))-1
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))+ABS(X(28)-X(35))-1
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))+ABS(X(28)-X(36))-1
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))+ABS(X(29)-X(30))-1
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))+ABS(X(29)-X(31))-1
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))+ABS(X(29)-X(32))-1
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))+ABS(X(29)-X(33))-1
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))+ABS(X(29)-X(34))-1
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))+ABS(X(29)-X(35))-1
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))+ABS(X(29)-X(36))-1
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))+ABS(X(30)-X(31))-1
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))+ABS(X(30)-X(32))-1
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))+ABS(X(30)-X(33))-1
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))+ABS(X(30)-X(34))-1
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))+ABS(X(30)-X(35))-1
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))+ABS(X(30)-X(36))-1
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))+ABS(X(31)-X(32))-1
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))+ABS(X(31)-X(33))-1
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))+ABS(X(31)-X(34))-1
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))+ABS(X(31)-X(35))-1
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))+ABS(X(31)-X(36))-1
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))+ABS(X(32)-X(33))-1
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))+ABS(X(32)-X(34))-1
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))+ABS(X(32)-X(35))-1
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))+ABS(X(32)-X(36))-1
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))+ABS(X(33)-X(34))-1
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))+ABS(X(33)-X(35))-1
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))+ABS(X(33)-X(36))-1
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))+ABS(X(34)-X(35))-1
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))+ABS(X(34)-X(36))-1
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))+ABS(X(35)-X(36))-1
788 FOR INSI=11 TO 76
791 IF P(INSI)<0 THEN P(INSI)=P(INSI) ELSE P(INSI)=0
795 NEXT INSI
1111 PSUM=0
1115 FOR IOCT=11 TO 76
1118 PSUM=PSUM+P(IOCT)
1121 NEXT IOCT
1131 PS1=99*555555!*PSUM
1321 P11B=5*ABS(X(1)-X(2))+2*ABS(X(1)-X(3))+4*ABS(X(1)-X(4))+1*ABS(X(1)-X(5))+0*ABS(X(1)-X(6))
1322 P12B=0*ABS(X(1)-X(7))+6*ABS(X(1)-X(8))+2*ABS(X(1)-X(9))+1*ABS(X(1)-X(10))+1*ABS(X(1)-X(11))+1*ABS(X(1)-X(12))
1323 P13B=3*ABS(X(2)-X(3))+0*ABS(X(2)-X(4))+2*ABS(X(2)-X(5))+2*ABS(X(2)-X(6))+2*ABS(X(2)-X(7))
1324 P14B=0*ABS(X(2)-X(8))+4*ABS(X(2)-X(9))+5*ABS(X(2)-X(10))+0*ABS(X(2)-X(11))+0*ABS(X(2)-X(12))
1325 P15B=0*ABS(X(3)-X(4))+0*ABS(X(3)-X(5))+0*ABS(X(3)-X(6))+0*ABS(X(3)-X(7))+5*ABS(X(3)-X(8))
1326 P16B=5*ABS(X(3)-X(9))+2*ABS(X(3)-X(10))+2*ABS(X(3)-X(11))+2*ABS(X(3)-X(12))
1327 P17B=5*ABS(X(4)-X(5))+2*ABS(X(4)-X(6))+2*ABS(X(4)-X(7))+10*ABS(X(4)-X(8))+0*ABS(X(4)-X(9))+0*ABS(X(4)-X(10))+5*ABS(X(4)-X(11))+5*ABS(X(4)-X(12))
1328 P18B=10*ABS(X(5)-X(6))+0*ABS(X(5)-X(7))+0*ABS(X(5)-X(8))+0*ABS(X(5)-X(9))+5*ABS(X(5)-X(10))+1*ABS(X(5)-X(11))+1*ABS(X(5)-X(12))
1329 P19B=5*ABS(X(6)-X(7))+1*ABS(X(6)-X(8))+1*ABS(X(6)-X(9))+5*ABS(X(6)-X(10))+4*ABS(X(6)-X(11))+0*ABS(X(6)-X(12))
1330 P20B=10*ABS(X(7)-X(8))+5*ABS(X(7)-X(9))+2*ABS(X(7)-X(10))+3*ABS(X(7)-X(11))+3*ABS(X(7)-X(12))
1331 P21B=0*ABS(X(8)-X(9))+0*ABS(X(8)-X(10))+5*ABS(X(8)-X(11))+0*ABS(X(8)-X(12))
1332 P22B=0*ABS(X(9)-X(10))+10*ABS(X(9)-X(11))+10*ABS(X(9)-X(12))
1333 P23B=5*ABS(X(10)-X(11))+0*ABS(X(10)-X(12))
1334 P24B=2*ABS(X(11)-X(12))
1351 P25B=5*ABS(X(13)-X(14))+2*ABS(X(13)-X(15))+4*ABS(X(13)-X(16))+1*ABS(X(13)-X(17))+0*ABS(X(13)-X(18))
1352 P26B=0*ABS(X(13)-X(19))+6*ABS(X(13)-X(20))+2*ABS(X(13)-X(21))+1*ABS(X(13)-X(22))+1*ABS(X(13)-X(23))+1*ABS(X(13)-X(24))
1353 P27B=3*ABS(X(14)-X(15))+0*ABS(X(14)-X(16))+2*ABS(X(14)-X(17))+2*ABS(X(14)-X(18))+2*ABS(X(14)-X(19))
1354 P28B=0*ABS(X(14)-X(20))+4*ABS(X(14)-X(21))+5*ABS(X(14)-X(22))+0*ABS(X(14)-X(23))+0*ABS(X(14)-X(24))
1355 P29B=0*ABS(X(15)-X(16))+0*ABS(X(15)-X(17))+0*ABS(X(15)-X(18))+0*ABS(X(15)-X(19))+5*ABS(X(15)-X(20))
1356 P30B=5*ABS(X(15)-X(21))+2*ABS(X(15)-X(22))+2*ABS(X(15)-X(23))+2*ABS(X(15)-X(24))
1367 P31B=5*ABS(X(16)-X(17))+2*ABS(X(16)-X(18))+2*ABS(X(16)-X(19))+10*ABS(X(16)-X(20))+0*ABS(X(16)-X(21))+0*ABS(X(16)-X(22))+5*ABS(X(16)-X(23))+5*ABS(X(16)-X(24))
1368 P32B=10*ABS(X(17)-X(18))+0*ABS(X(17)-X(19))+0*ABS(X(17)-X(20))+0*ABS(X(17)-X(21))+5*ABS(X(17)-X(22))+1*ABS(X(17)-X(23))+1*ABS(X(17)-X(24))
1369 P33B=5*ABS(X(18)-X(19))+1*ABS(X(18)-X(20))+1*ABS(X(18)-X(21))+5*ABS(X(18)-X(22))+4*ABS(X(18)-X(23))+0*ABS(X(18)-X(24))
1370 P34B=10*ABS(X(19)-X(20))+5*ABS(X(19)-X(21))+2*ABS(X(19)-X(22))+3*ABS(X(19)-X(23))+3*ABS(X(19)-X(24))
1371 P35B=0*ABS(X(20)-X(21))+0*ABS(X(20)-X(22))+5*ABS(X(20)-X(23))+0*ABS(X(20)-X(24))
1372 P36B=0*ABS(X(21)-X(22))+10*ABS(X(21)-X(23))+10*ABS(X(21)-X(24))
1373 P37B=5*ABS(X(22)-X(23))+0*ABS(X(22)-X(24))
1374 P38B=2*ABS(X(23)-X(24))
1401 P39B=5*ABS(X(25)-X(26))+2*ABS(X(25)-X(27))+4*ABS(X(25)-X(28))+1*ABS(X(25)-X(29))+0*ABS(X(25)-X(30))
1402 P40B=0*ABS(X(25)-X(31))+6*ABS(X(25)-X(32))+2*ABS(X(25)-X(33))+1*ABS(X(25)-X(34))+1*ABS(X(25)-X(35))+1*ABS(X(25)-X(36))
1403 P41B=3*ABS(X(26)-X(27))+0*ABS(X(26)-X(28))+2*ABS(X(26)-X(29))+2*ABS(X(26)-X(30))+2*ABS(X(26)-X(31))
1404 P42B=0*ABS(X(26)-X(32))+4*ABS(X(26)-X(33))+5*ABS(X(26)-X(34))+0*ABS(X(26)-X(35))+0*ABS(X(26)-X(36))
1405 P43B=0*ABS(X(27)-X(28))+0*ABS(X(27)-X(29))+0*ABS(X(27)-X(30))+0*ABS(X(27)-X(31))+5*ABS(X(27)-X(32))
1406 P44B=5*ABS(X(27)-X(33))+2*ABS(X(27)-X(34))+2*ABS(X(27)-X(35))+2*ABS(X(27)-X(36))
1407 P45B=5*ABS(X(28)-X(29))+2*ABS(X(28)-X(30))+2*ABS(X(28)-X(31))+10*ABS(X(28)-X(32))+0*ABS(X(28)-X(33))+0*ABS(X(28)-X(34))+5*ABS(X(28)-X(35))+5*ABS(X(28)-X(36))
1408 P46B=10*ABS(X(29)-X(30))+0*ABS(X(29)-X(31))+0*ABS(X(29)-X(32))+0*ABS(X(29)-X(33))+5*ABS(X(29)-X(34))+1*ABS(X(29)-X(35))+1*ABS(X(29)-X(36))
1409 P47B=5*ABS(X(30)-X(31))+1*ABS(X(30)-X(32))+1*ABS(X(30)-X(33))+5*ABS(X(30)-X(34))+4*ABS(X(30)-X(35))+0*ABS(X(30)-X(36))
1410 P48B=10*ABS(X(31)-X(32))+5*ABS(X(31)-X(33))+2*ABS(X(31)-X(34))+3*ABS(X(31)-X(35))+3*ABS(X(31)-X(36))
1411 P49B=0*ABS(X(32)-X(33))+0*ABS(X(32)-X(34))+5*ABS(X(32)-X(35))+0*ABS(X(32)-X(36))
1412 P50B=0*ABS(X(33)-X(34))+10*ABS(X(33)-X(35))+10*ABS(X(33)-X(36))
1413 P51B=5*ABS(X(34)-X(35))+0*ABS(X(34)-X(36))
1414 P52B=2*ABS(X(35)-X(36))
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B
1444 P2=P21B+P22B+P23B+P24B+P25B+P26B+P27B+P28B+P29B+P30B
1445 P3=P31B+P32B+P33B+P34B+P35B+P36B+P37B+P38B
1446 P4=P39B+P40B+P41B+P42B+P43B+P44B+P45B+P46B+P47B+P48B
1447 P5=P49B+P50B+P51B+P52B
1448 P6=P1+P2+P3+P4+P5
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 36
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1778 REM
1888 NEXT JJJ
1890 IF M>-280 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24)
1928 PRINT A(25),A(26),A(27),A(28),A(29)
1930 PRINT A(30),A(31),A(32),A(33),A(34)
1932 PRINT A(35),A(36),JJJJ,M,PP1
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the best candidate solutions produced from JJJJ=-32000 through JJJJ=-31658 (in compressed form and to be interpreted in accordance with line 1916 through line 1932; copied manually from the computer monitor) are presented below.
-31989 -262 262
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 1
1 0 0 1 0
1 1
1 1 1 0 1
0 0 0 1 0
0 1 -31989 -262 262
-31716 -262 262
0 2 1 0 2
2 1 0 1 2
1 0
1 1 1 0 0
0 1 1 0 1
0 0
0 0 0 1 0
1 1 1 0 1
1 0 -31716 -262 262
-31658 -263 263
1 1 0 1 1
0 0 0 1 0
0 1
2 0 2 2 0
0 1 2 1 0
1 1
1 1 1 0 0
0 0 0 1 1
1 0 -31658 -263 263
The best candidate solutions shown above are at JJJJ=-31989 and at JJJJ=-31716 with an objective function value of 262. 289, the minimum objective function value for the older problem [2, p. 159], to 262 is 1.103 to 1.
The output above was produced in 7 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 4, one may or may not obtain 262, which may or may not be optimal. That leads to a general remedy that in general, in order to increase the chance of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
The problem considered here is essentially the 12-location problem in Hillier [1] and in Nugent, Vollmann, and Ruml [2] plus a change to more than 12 locations spread over three dimensions. The same interfacility flows [1, p. 33; 2, p. 168] are used here. So one knows the minimum objective function value to this newer problem is 289 [2, p. 159] or smaller.
Line 561 through line 626 of the computer program below extend to three dimensions the mathematical formulation appearing on page 6 of Heragu and Kusiak [3] and on page 140 of Heragu [4]. Line 1321 through line 1414 below use the interdepartmental flows presented in Hillier [1, p. 33] and in Nugent, Vollmann, and Ruml [2, p. 168].
The following computer program benefits from the computer programs of the present blog and the computer program on pages 229-232 of Conley [5].
2 DEFINT I,J,K
5 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(222)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
43 FOR IOC=1 TO 36
45 B(IOC)=0
47 NEXT IOC
51 FOR IOCTT=1 TO 36
53 N(IOCTT)=2
57 NEXT IOCTT
61 FOR KLQ=1 TO 36
62 A(KLQ)=B(KLQ)+RND*(N(KLQ)-B(KLQ))
63 NEXT KLQ
71 FOR KLR=1 TO 36
72 H(KLR)=3
73 NEXT KLR
88 FOR JJJ=1 TO 1000 STEP 10
90 FOR INEW=1 TO 1
94 FOR J=INEW*2 TO 0 STEP -1
102 FOR JJ=0 TO 36
128 FOR I=1 TO 3
129 FOR KKQQ=1 TO 36
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
132 FOR K=1 TO 36
133 IF RND<=.5 THEN 298 ELSE 230
134 REM
137 REM
230 IF A(K)-(N(K)-B(K))/H(K)^J250 L(K)=B(K)
255 GOTO 265
260 L(K)=A(K)-(N(K)-B(K))/H(K)^J
265 IF A(K)+(N(K)-B(K))/H(K)^J>N(K) THEN 266 ELSE 268
266 U(K)=N(K)-L(K)
267 GOTO 272
268 U(K)=A(K)+(N(K)-B(K))/H(K)^J-L(K)
272 GOTO 300
298 X(K)=A(K)+2*RND*(2*RND-1)*(1/(1+RND*JJJ))*.05*A(K)
299 GOTO 302
300 X(K)=(L(K)+2*RND*RND*U(K))
302 NEXT K
304 X(JJ)=A(JJ)
306 KLPS=FIX(1+RND*108)
307 FOR KLA1=1 TO KLPS
308 KLA2=FIX(1+36*RND)
309 X(KLA2)=A(KLA2)
310 NEXT KLA1
343 IF RND>.1 GOTO 361
352 IF RND<.5 THEN 353 ELSE 355
353 X(JJ)=B(JJ)
354 GOTO 361
355 X(JJ)=N(JJ)
361 FOR I222=1 TO 36
364 X(I222)=FIX(X(I222))
368 NEXT I222
461 IF RND>.1 GOTO 531
465 IF RND<1/3 THEN 471 ELSE IF RND<1/2 THEN 491 ELSE 511
471 IOCT1=1+FIX(RND*12)
474 IOCT2=1+FIX(RND*12)
477 X(IOCT1)=A(IOCT2)
480 X(IOCT2)=A(IOCT1)
481 GOTO 531
491 IOCT6=13+FIX(RND*12)
494 IOCT7=13+FIX(RND*12)
497 X(IOCT6)=A(IOCT7)
500 X(IOCT7)=A(IOCT6)
502 GOTO 531
511 IOCT8=25+FIX(RND*12)
514 IOCT9=25+FIX(RND*12)
517 X(IOCT8)=A(IOCT9)
520 X(IOCT9)=A(IOCT8)
522 GOTO 531
531 FOR IOCX=1 TO 36
533 IF X(IOCX)>2 THEN X(IOCX)=1
535 NEXT IOCX
541 FOR IOCY=1 TO 36
543 IF X(IOCY)<0 THEN X(IOCY)=0
545 NEXT IOCY
561 P(11)=ABS(X(1)-X(2))+ABS(X(13)-X(14))+ABS(X(25)-X(26))-1
562 P(12)=ABS(X(1)-X(3))+ABS(X(13)-X(15))+ABS(X(25)-X(27))-1
563 P(13)=ABS(X(1)-X(4))+ABS(X(13)-X(16))+ABS(X(25)-X(28))-1
564 P(14)=ABS(X(1)-X(5))+ABS(X(13)-X(17))+ABS(X(25)-X(29))-1
565 P(15)=ABS(X(1)-X(6))+ABS(X(13)-X(18))+ABS(X(25)-X(30))-1
566 P(16)=ABS(X(1)-X(7))+ABS(X(13)-X(19))+ABS(X(25)-X(31))-1
567 P(17)=ABS(X(1)-X(8))+ABS(X(13)-X(20))+ABS(X(25)-X(32))-1
568 P(18)=ABS(X(1)-X(9))+ABS(X(13)-X(21))+ABS(X(25)-X(33))-1
569 P(19)=ABS(X(1)-X(10))+ABS(X(13)-X(22))+ABS(X(25)-X(34))-1
570 P(20)=ABS(X(1)-X(11))+ABS(X(13)-X(23))+ABS(X(25)-X(35))-1
571 P(21)=ABS(X(1)-X(12))+ABS(X(13)-X(24))+ABS(X(25)-X(36))-1
572 P(22)=ABS(X(2)-X(3))+ABS(X(14)-X(15))+ABS(X(26)-X(27))-1
573 P(23)=ABS(X(2)-X(4))+ABS(X(14)-X(16))+ABS(X(26)-X(28))-1
574 P(24)=ABS(X(2)-X(5))+ABS(X(14)-X(17))+ABS(X(26)-X(29))-1
575 P(25)=ABS(X(2)-X(6))+ABS(X(14)-X(18))+ABS(X(26)-X(30))-1
576 P(26)=ABS(X(2)-X(7))+ABS(X(14)-X(19))+ABS(X(26)-X(31))-1
577 P(27)=ABS(X(2)-X(8))+ABS(X(14)-X(20))+ABS(X(26)-X(32))-1
578 P(28)=ABS(X(2)-X(9))+ABS(X(14)-X(21))+ABS(X(26)-X(33))-1
579 P(29)=ABS(X(2)-X(10))+ABS(X(14)-X(22))+ABS(X(26)-X(34))-1
580 P(30)=ABS(X(2)-X(11))+ABS(X(14)-X(23))+ABS(X(26)-X(35))-1
581 P(31)=ABS(X(2)-X(12))+ABS(X(14)-X(24))+ABS(X(26)-X(36))-1
582 P(32)=ABS(X(3)-X(4))+ABS(X(15)-X(16))+ABS(X(27)-X(28))-1
583 P(33)=ABS(X(3)-X(5))+ABS(X(15)-X(17))+ABS(X(27)-X(29))-1
584 P(34)=ABS(X(3)-X(6))+ABS(X(15)-X(18))+ABS(X(27)-X(30))-1
585 P(35)=ABS(X(3)-X(7))+ABS(X(15)-X(19))+ABS(X(27)-X(31))-1
586 P(36)=ABS(X(3)-X(8))+ABS(X(15)-X(20))+ABS(X(27)-X(32))-1
587 P(37)=ABS(X(3)-X(9))+ABS(X(15)-X(21))+ABS(X(27)-X(33))-1
588 P(38)=ABS(X(3)-X(10))+ABS(X(15)-X(22))+ABS(X(27)-X(34))-1
589 P(39)=ABS(X(3)-X(11))+ABS(X(15)-X(23))+ABS(X(27)-X(35))-1
590 P(40)=ABS(X(3)-X(12))+ABS(X(15)-X(24))+ABS(X(27)-X(36))-1
591 P(41)=ABS(X(4)-X(5))+ABS(X(16)-X(17))+ABS(X(28)-X(29))-1
592 P(42)=ABS(X(4)-X(6))+ABS(X(16)-X(18))+ABS(X(28)-X(30))-1
593 P(43)=ABS(X(4)-X(7))+ABS(X(16)-X(19))+ABS(X(28)-X(31))-1
594 P(44)=ABS(X(4)-X(8))+ABS(X(16)-X(20))+ABS(X(28)-X(32))-1
595 P(45)=ABS(X(4)-X(9))+ABS(X(16)-X(21))+ABS(X(28)-X(33))-1
596 P(46)=ABS(X(4)-X(10))+ABS(X(16)-X(22))+ABS(X(28)-X(34))-1
597 P(47)=ABS(X(4)-X(11))+ABS(X(16)-X(23))+ABS(X(28)-X(35))-1
598 P(48)=ABS(X(4)-X(12))+ABS(X(16)-X(24))+ABS(X(28)-X(36))-1
599 P(49)=ABS(X(5)-X(6))+ABS(X(17)-X(18))+ABS(X(29)-X(30))-1
600 P(50)=ABS(X(5)-X(7))+ABS(X(17)-X(19))+ABS(X(29)-X(31))-1
601 P(51)=ABS(X(5)-X(8))+ABS(X(17)-X(20))+ABS(X(29)-X(32))-1
602 P(52)=ABS(X(5)-X(9))+ABS(X(17)-X(21))+ABS(X(29)-X(33))-1
603 P(53)=ABS(X(5)-X(10))+ABS(X(17)-X(22))+ABS(X(29)-X(34))-1
604 P(54)=ABS(X(5)-X(11))+ABS(X(17)-X(23))+ABS(X(29)-X(35))-1
605 P(55)=ABS(X(5)-X(12))+ABS(X(17)-X(24))+ABS(X(29)-X(36))-1
606 P(56)=ABS(X(6)-X(7))+ABS(X(18)-X(19))+ABS(X(30)-X(31))-1
607 P(57)=ABS(X(6)-X(8))+ABS(X(18)-X(20))+ABS(X(30)-X(32))-1
608 P(58)=ABS(X(6)-X(9))+ABS(X(18)-X(21))+ABS(X(30)-X(33))-1
609 P(59)=ABS(X(6)-X(10))+ABS(X(18)-X(22))+ABS(X(30)-X(34))-1
610 P(60)=ABS(X(6)-X(11))+ABS(X(18)-X(23))+ABS(X(30)-X(35))-1
611 P(61)=ABS(X(6)-X(12))+ABS(X(18)-X(24))+ABS(X(30)-X(36))-1
612 P(62)=ABS(X(7)-X(8))+ABS(X(19)-X(20))+ABS(X(31)-X(32))-1
613 P(63)=ABS(X(7)-X(9))+ABS(X(19)-X(21))+ABS(X(31)-X(33))-1
614 P(64)=ABS(X(7)-X(10))+ABS(X(19)-X(22))+ABS(X(31)-X(34))-1
615 P(65)=ABS(X(7)-X(11))+ABS(X(19)-X(23))+ABS(X(31)-X(35))-1
616 P(66)=ABS(X(7)-X(12))+ABS(X(19)-X(24))+ABS(X(31)-X(36))-1
617 P(67)=ABS(X(8)-X(9))+ABS(X(20)-X(21))+ABS(X(32)-X(33))-1
618 P(68)=ABS(X(8)-X(10))+ABS(X(20)-X(22))+ABS(X(32)-X(34))-1
619 P(69)=ABS(X(8)-X(11))+ABS(X(20)-X(23))+ABS(X(32)-X(35))-1
620 P(70)=ABS(X(8)-X(12))+ABS(X(20)-X(24))+ABS(X(32)-X(36))-1
621 P(71)=ABS(X(9)-X(10))+ABS(X(21)-X(22))+ABS(X(33)-X(34))-1
622 P(72)=ABS(X(9)-X(11))+ABS(X(21)-X(23))+ABS(X(33)-X(35))-1
623 P(73)=ABS(X(9)-X(12))+ABS(X(21)-X(24))+ABS(X(33)-X(36))-1
624 P(74)=ABS(X(10)-X(11))+ABS(X(22)-X(23))+ABS(X(34)-X(35))-1
625 P(75)=ABS(X(10)-X(12))+ABS(X(22)-X(24))+ABS(X(34)-X(36))-1
626 P(76)=ABS(X(11)-X(12))+ABS(X(23)-X(24))+ABS(X(35)-X(36))-1
788 FOR INSI=11 TO 76
791 IF P(INSI)<0 THEN P(INSI)=P(INSI) ELSE P(INSI)=0
795 NEXT INSI
1111 PSUM=0
1115 FOR IOCT=11 TO 76
1118 PSUM=PSUM+P(IOCT)
1121 NEXT IOCT
1131 PS1=99*555555!*PSUM
1321 P11B=5*ABS(X(1)-X(2))+2*ABS(X(1)-X(3))+4*ABS(X(1)-X(4))+1*ABS(X(1)-X(5))+0*ABS(X(1)-X(6))
1322 P12B=0*ABS(X(1)-X(7))+6*ABS(X(1)-X(8))+2*ABS(X(1)-X(9))+1*ABS(X(1)-X(10))+1*ABS(X(1)-X(11))+1*ABS(X(1)-X(12))
1323 P13B=3*ABS(X(2)-X(3))+0*ABS(X(2)-X(4))+2*ABS(X(2)-X(5))+2*ABS(X(2)-X(6))+2*ABS(X(2)-X(7))
1324 P14B=0*ABS(X(2)-X(8))+4*ABS(X(2)-X(9))+5*ABS(X(2)-X(10))+0*ABS(X(2)-X(11))+0*ABS(X(2)-X(12))
1325 P15B=0*ABS(X(3)-X(4))+0*ABS(X(3)-X(5))+0*ABS(X(3)-X(6))+0*ABS(X(3)-X(7))+5*ABS(X(3)-X(8))
1326 P16B=5*ABS(X(3)-X(9))+2*ABS(X(3)-X(10))+2*ABS(X(3)-X(11))+2*ABS(X(3)-X(12))
1327 P17B=5*ABS(X(4)-X(5))+2*ABS(X(4)-X(6))+2*ABS(X(4)-X(7))+10*ABS(X(4)-X(8))+0*ABS(X(4)-X(9))+0*ABS(X(4)-X(10))+5*ABS(X(4)-X(11))+5*ABS(X(4)-X(12))
1328 P18B=10*ABS(X(5)-X(6))+0*ABS(X(5)-X(7))+0*ABS(X(5)-X(8))+0*ABS(X(5)-X(9))+5*ABS(X(5)-X(10))+1*ABS(X(5)-X(11))+1*ABS(X(5)-X(12))
1329 P19B=5*ABS(X(6)-X(7))+1*ABS(X(6)-X(8))+1*ABS(X(6)-X(9))+5*ABS(X(6)-X(10))+4*ABS(X(6)-X(11))+0*ABS(X(6)-X(12))
1330 P20B=10*ABS(X(7)-X(8))+5*ABS(X(7)-X(9))+2*ABS(X(7)-X(10))+3*ABS(X(7)-X(11))+3*ABS(X(7)-X(12))
1331 P21B=0*ABS(X(8)-X(9))+0*ABS(X(8)-X(10))+5*ABS(X(8)-X(11))+0*ABS(X(8)-X(12))
1332 P22B=0*ABS(X(9)-X(10))+10*ABS(X(9)-X(11))+10*ABS(X(9)-X(12))
1333 P23B=5*ABS(X(10)-X(11))+0*ABS(X(10)-X(12))
1334 P24B=2*ABS(X(11)-X(12))
1351 P25B=5*ABS(X(13)-X(14))+2*ABS(X(13)-X(15))+4*ABS(X(13)-X(16))+1*ABS(X(13)-X(17))+0*ABS(X(13)-X(18))
1352 P26B=0*ABS(X(13)-X(19))+6*ABS(X(13)-X(20))+2*ABS(X(13)-X(21))+1*ABS(X(13)-X(22))+1*ABS(X(13)-X(23))+1*ABS(X(13)-X(24))
1353 P27B=3*ABS(X(14)-X(15))+0*ABS(X(14)-X(16))+2*ABS(X(14)-X(17))+2*ABS(X(14)-X(18))+2*ABS(X(14)-X(19))
1354 P28B=0*ABS(X(14)-X(20))+4*ABS(X(14)-X(21))+5*ABS(X(14)-X(22))+0*ABS(X(14)-X(23))+0*ABS(X(14)-X(24))
1355 P29B=0*ABS(X(15)-X(16))+0*ABS(X(15)-X(17))+0*ABS(X(15)-X(18))+0*ABS(X(15)-X(19))+5*ABS(X(15)-X(20))
1356 P30B=5*ABS(X(15)-X(21))+2*ABS(X(15)-X(22))+2*ABS(X(15)-X(23))+2*ABS(X(15)-X(24))
1367 P31B=5*ABS(X(16)-X(17))+2*ABS(X(16)-X(18))+2*ABS(X(16)-X(19))+10*ABS(X(16)-X(20))+0*ABS(X(16)-X(21))+0*ABS(X(16)-X(22))+5*ABS(X(16)-X(23))+5*ABS(X(16)-X(24))
1368 P32B=10*ABS(X(17)-X(18))+0*ABS(X(17)-X(19))+0*ABS(X(17)-X(20))+0*ABS(X(17)-X(21))+5*ABS(X(17)-X(22))+1*ABS(X(17)-X(23))+1*ABS(X(17)-X(24))
1369 P33B=5*ABS(X(18)-X(19))+1*ABS(X(18)-X(20))+1*ABS(X(18)-X(21))+5*ABS(X(18)-X(22))+4*ABS(X(18)-X(23))+0*ABS(X(18)-X(24))
1370 P34B=10*ABS(X(19)-X(20))+5*ABS(X(19)-X(21))+2*ABS(X(19)-X(22))+3*ABS(X(19)-X(23))+3*ABS(X(19)-X(24))
1371 P35B=0*ABS(X(20)-X(21))+0*ABS(X(20)-X(22))+5*ABS(X(20)-X(23))+0*ABS(X(20)-X(24))
1372 P36B=0*ABS(X(21)-X(22))+10*ABS(X(21)-X(23))+10*ABS(X(21)-X(24))
1373 P37B=5*ABS(X(22)-X(23))+0*ABS(X(22)-X(24))
1374 P38B=2*ABS(X(23)-X(24))
1401 P39B=5*ABS(X(25)-X(26))+2*ABS(X(25)-X(27))+4*ABS(X(25)-X(28))+1*ABS(X(25)-X(29))+0*ABS(X(25)-X(30))
1402 P40B=0*ABS(X(25)-X(31))+6*ABS(X(25)-X(32))+2*ABS(X(25)-X(33))+1*ABS(X(25)-X(34))+1*ABS(X(25)-X(35))+1*ABS(X(25)-X(36))
1403 P41B=3*ABS(X(26)-X(27))+0*ABS(X(26)-X(28))+2*ABS(X(26)-X(29))+2*ABS(X(26)-X(30))+2*ABS(X(26)-X(31))
1404 P42B=0*ABS(X(26)-X(32))+4*ABS(X(26)-X(33))+5*ABS(X(26)-X(34))+0*ABS(X(26)-X(35))+0*ABS(X(26)-X(36))
1405 P43B=0*ABS(X(27)-X(28))+0*ABS(X(27)-X(29))+0*ABS(X(27)-X(30))+0*ABS(X(27)-X(31))+5*ABS(X(27)-X(32))
1406 P44B=5*ABS(X(27)-X(33))+2*ABS(X(27)-X(34))+2*ABS(X(27)-X(35))+2*ABS(X(27)-X(36))
1407 P45B=5*ABS(X(28)-X(29))+2*ABS(X(28)-X(30))+2*ABS(X(28)-X(31))+10*ABS(X(28)-X(32))+0*ABS(X(28)-X(33))+0*ABS(X(28)-X(34))+5*ABS(X(28)-X(35))+5*ABS(X(28)-X(36))
1408 P46B=10*ABS(X(29)-X(30))+0*ABS(X(29)-X(31))+0*ABS(X(29)-X(32))+0*ABS(X(29)-X(33))+5*ABS(X(29)-X(34))+1*ABS(X(29)-X(35))+1*ABS(X(29)-X(36))
1409 P47B=5*ABS(X(30)-X(31))+1*ABS(X(30)-X(32))+1*ABS(X(30)-X(33))+5*ABS(X(30)-X(34))+4*ABS(X(30)-X(35))+0*ABS(X(30)-X(36))
1410 P48B=10*ABS(X(31)-X(32))+5*ABS(X(31)-X(33))+2*ABS(X(31)-X(34))+3*ABS(X(31)-X(35))+3*ABS(X(31)-X(36))
1411 P49B=0*ABS(X(32)-X(33))+0*ABS(X(32)-X(34))+5*ABS(X(32)-X(35))+0*ABS(X(32)-X(36))
1412 P50B=0*ABS(X(33)-X(34))+10*ABS(X(33)-X(35))+10*ABS(X(33)-X(36))
1413 P51B=5*ABS(X(34)-X(35))+0*ABS(X(34)-X(36))
1414 P52B=2*ABS(X(35)-X(36))
1443 P1=P11B+P12B+P13B+P14B+P15B+P16B+P17B+P18B+P19B+P20B
1444 P2=P21B+P22B+P23B+P24B+P25B+P26B+P27B+P28B+P29B+P30B
1445 P3=P31B+P32B+P33B+P34B+P35B+P36B+P37B+P38B
1446 P4=P39B+P40B+P41B+P42B+P43B+P44B+P45B+P46B+P47B+P48B
1447 P5=P49B+P50B+P51B+P52B
1448 P6=P1+P2+P3+P4+P5
1450 P=-P6+PS1
1451 IF P<=M THEN 1670
1452 M=P
1453 PP1=P6
1454 FOR KLX=1 TO 36
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1457 GOTO 128
1670 NEXT I
1702 NEXT JJ
1706 NEXT J
1777 NEXT INEW
1778 REM
1888 NEXT JJJ
1890 IF M>-280 THEN 1916 ELSE 1999
1916 PRINT JJJJ,M,PP1
1917 PRINT A(1),A(2),A(3),A(4),A(5)
1918 PRINT A(6),A(7),A(8),A(9),A(10)
1920 PRINT A(11),A(12)
1922 PRINT A(13),A(14),A(15),A(16),A(17)
1924 PRINT A(18),A(19),A(20),A(21),A(22)
1926 PRINT A(23),A(24)
1928 PRINT A(25),A(26),A(27),A(28),A(29)
1930 PRINT A(30),A(31),A(32),A(33),A(34)
1932 PRINT A(35),A(36),JJJJ,M,PP1
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the best candidate solutions produced from JJJJ=-32000 through JJJJ=-31658 (in compressed form and to be interpreted in accordance with line 1916 through line 1932; copied manually from the computer monitor) are presented below.
-31989 -262 262
2 0 1 2 0
0 1 2 1 0
1 2
0 0 0 1 1
1 0 0 1 0
1 1
1 1 1 0 1
0 0 0 1 0
0 1 -31989 -262 262
-31716 -262 262
0 2 1 0 2
2 1 0 1 2
1 0
1 1 1 0 0
0 1 1 0 1
0 0
0 0 0 1 0
1 1 1 0 1
1 0 -31716 -262 262
-31658 -263 263
1 1 0 1 1
0 0 0 1 0
0 1
2 0 2 2 0
0 1 2 1 0
1 1
1 1 1 0 0
0 0 0 1 1
1 0 -31658 -263 263
The best candidate solutions shown above are at JJJJ=-31989 and at JJJJ=-31716 with an objective function value of 262. 289, the minimum objective function value for the older problem [2, p. 159], to 262 is 1.103 to 1.
The output above was produced in 7 hours on a personal computer with an Intel 2.66 GHz. chip and the IBM interpreter, which is slower than the corresponding compiler.
If one makes changes to the computer program above, such as a change of changing line 128 above to 128 FOR I=1 TO 4, one may or may not obtain 262, which may or may not be optimal. That leads to a general remedy that in general, in order to increase the chance of getting an optimal solution, one preferably should run several computers simultaneously, each with a different line 128, for example; instead of line 128, another line can be chosen. This multicomputer approach can mitigate the possible danger of missed optimality and can produce a usable solution faster than just running one computer.
References
[1] F.S. Hillier, Quantitative tools for plant layout analysis, J. Indust. Eng. 14 (1963) 33-40.
[2] C.E. Nugent, T.E. Vollmann, J. Ruml, An experimental comparison of techniques for the assignment of facilities to locations, Operations Research 16 (1968) 150-173.
[3] S.S. Heragu, A. Kusiak, Efficient models for the facility layout problem, European Journal of Operational Research 53 (1991) 1-13.
[4] S.S. Heragu, Recent models and techniques for solving the layout problem, European Journal of Operational Research 57 (1992) 136-144.
[5] W.C. Conley, Optimization: A Simplified Approach, Petrocelli, Princeton, New Jersey, 1981.
Subscribe to:
Posts (Atom)