1: N = Number of Relays; 2: NumberOfObjectives = 4; // i.e. 1: Throughput, 2: Delay, 3: Battery and 4: Buffer 3: Exchange CSI and Resource Information 4: //Discover the available incoming links, i.e. links 5: ListOfAvailableIncomingLinks[] = [] //List contains indices of available relays for Rx, initially the list is empty 6: NumberOfAvailableIncomingLinks = 0; 7: for i=1:N do 8: if AND // SNR of link AND // Available buffer at relay // Batery power at relay then 9: NumberOfAvailableIncomingLinks++; 10: ListOfAvailableIncomingLinks[NumberOfAvailableIncomingLinks] = i; 11: end if 12: end for 13: //Discover the available outgoing links, i.e. links 14: ListOfAvailableOutgoingLinks[] = [] //List contains indices of available relays for Tx, initially the list is empty 15: NumberOfAvailableOutgoingLinks = 0; 16: for i=1:N do 17: if AND // SNR of AND // Occupied buffer at relay // Batery power at relay then 18: NumberOfAvailableOutgoingLinks++; 19: ListOfAvailableOutgoingLinks[NumberOfAvailableOutgoingLinks] = i; 20: end if 21: end for 22: // Now we select the best outgoing link out of the available outgoing links as per application QoS requirements. 23: selectedOutgoingRelayIndex = -1; // initially none selected 24: bestValue = 0; // initialized 25: for i=1: NumberOfAvailableOutgoingLinks do 26: Y[ListOfAvailableOutgoingLinks[i]]= 27: if Y[ListOfAvailableOutgoingLinks[i]] ¿ bestValue then 28: bestValue = Y[ListOfAvailableOutgoingLinks[i]]; 29: selectedOutgoingRelayIndex = ListOfAvailableOutgoingLinks[i]; 30: end if 31: end for 32: // Now select the best incoming link out of the available incoming links as per application QoS requirements and also it is not the selected outgoing link. 33: selectedIncomingRelayIndex = -1; // initially none selected 34: bestValue = 0; // initialized 35: for i=1:NumberOfAvailableIncomingLinks do 36: Y 37: if Y[ListOfAvailableIncomingLinks[i]] ¿ bestValue AND ListOfAvailableIncomingLinks[i] != selectedOutgoingRelayIndex then 38: bestValue = Y[ListOfAvailableIncominggLinks[i]]; 39: selectedIncomingRelayIndex = ListOfAvailableIncomingLinks[i]; 40: end if 41: end for