|
Algorithm 3: Placement: Calculate
|
|
Require:
|
|
Ensure:
|
| 1: for
to n do
|
| 2: for
do
|
| 3: for
to
do
|
| 4:
|
| 5:
|
| 6: for
do
|
| 7: if
then
|
| 8:
|
| 9: end if
|
| 10: end for
|
| 11:
|
| 12: if
and
and
then
|
| 13: if
|
| 14:
end if
|
| 15:
end for
|
| 16: end for
|
| 17: end for
|
| 18: for
to n do
|
| 19:
|
| 20: end for
|
| 21:
|
| 22:
|
| 23: while
do
|
| 24: for
n do
|
| 25:
|
| 26: for
do
|
| 27:
|
| 28: if
then
|
| 29:
|
| 30:
|
| 31: end if
|
| 32: end for
|
| 33: end for
|
| 34:
|
| 35:
|
| 36: end while
|