1: Initialize , , , for all . |
2:fordo
|
3: fordo
|
4: ifthen
|
5: Calculate and
|
6: Assign with probability . |
7: Let , and , . |
8: else ifthen
|
9: Assign with probability . |
10: Let , and , . |
11: else ifthen
|
12: Assign with probability
|
13: Let , and , . |
14: else
|
15: Assign , and , , . |
16: for all . |
return for all , and . |