(1) decide whether to transmit source data by the direct link or by the relaying link according to (18) and (19);
( if both (18) and (19) are satisfied, the forwarding threshold is calculated by formula (15), the transmit power of each source node is calculated by (16) and (17);
Otherwise the direct transmission is preferred, the transmit power of each source node is computed by (16) and (17);
(3) the source nodes start the transmission including broadcasting the message of transmit power and .
At the selected relay node (if the relaying is preferred):
(1) decide whether to broadcast the network-coded data by (7);
(2) work out the transmit power of relay node by (8).