DP, part 1: executed at each route ๐ โ ๐ Initialization Set ๐ต 0 ๐ = ๐ , ๐ 0 ๐ < 1 , ๐ 1 ๐ = ๐ผ ( | ๐ต ๐ | + โ ๐ ) . repeat if   ๐ ๐ ๐ก โ 1 < 1 (i.e., unbalanced) Broadcast its price ๐ ๐ก ๐ to each source node ๐ โ ๐ต ๐ . else Broadcast its price ๐ ๐ก ๐ with a “balanced” signal to each source node ๐ โ ๐ต ๐ . End  if Wait for responses from all source nodes in ๐ต ๐ . if   | ๐ถ ๐ก ๐ | > ๐ ๐ก ๐ / ๐ผ โ โ ๐ โ | ๐ต ๐ ๐ก โ 1 | + | ๐ฟ ๐ก ๐ | Randomly choose a subset ๐ด ๐ก ๐ of ๐ถ ๐ก ๐ , such that supply-demand is balanced. Set ๐ต ๐ก ๐ = ๐ต ๐ ๐ก โ 1 โ ๐ด ๐ก ๐ โงต ๐ฟ ๐ก ๐ . else Set ๐ต ๐ก ๐ = ๐ต ๐ ๐ก โ 1 โ ๐ถ ๐ก ๐ โงต ๐ฟ ๐ก ๐ . End  if Broadcast its decision to each source node ๐ โ ๐ต ๐ . if   ๐ ๐ก ๐ < 1 and | ๐ถ ๐ก ๐ | + | ๐ฟ ๐ก ๐ | = = 0 Set ๐ ๐ ๐ก + 1 = ๐ ๐ก ๐ โ ๐ผ . else Set ๐ ๐ ๐ก + 1 = ๐ ๐ก ๐ . ๐ก = ๐ก + 1 . End  if until   ๐ ๐ก = 1 or ๐ ๐ก ๐ = = 1 for each ๐ โ ๐ (i.e., balance its Supply-demand). ๐ฟ ๐ก ๐ : set of source nodes that leave route ๐ during iteration ๐ก . ๐ถ ๐ก ๐ : set of source nodes that turn to route ๐ during iteration ๐ก .
Algorithm 1: