1:

Input:.

2:

Output:.

3:

Initialize each vector,.

4:

for to

5:

Sample an edge from.

6:

Load and from the corresponding part of and.

7:

Update and using the objective function.

8:

Overwrite the corresponding part of and with and.

9:

Sample an edge from.

10:

Load from the corresponding part of and.

11:

Update and using the objective function.

12:

Overwrite the corresponding part of with.

13:

Sample an edge from.

14:

Update and using the objective function.

15:

END