Research Article
Decentralized Algorithms for Weapon-Target Assignment in Swarming Combat System
Algorithm 2
The improved task swap algorithm DWLCC.
(1) | Initialize the dual variables , the reduced cost ; | (2) | Let be the set of candidate source nodes; | (3) | While do | (4) | is voted among neighbors as the source node; ; if , the assignment cannot be improved, then Algorithm 2 terminates; | (5) | Let be the set of the candidate nodes to be added to the swap chain, let be the set of the nodes that joined the swap chain (leaf nodes); | (6) | Let be the distance from node to the source node, let be ’s predecessor node; initialize , , and ; | (7) | While do | (8) | ; | (9) | ; ; | (10) | For each node on outgoing edge of do | (11) | If then | (12) | //This step is termed as the relaxation operation. | (13) | ; set ; | (14) | End if | (15) | If and the distance is smaller than its previous value then | (16) | If then | (17) | Change the source node: ; ; | (18) | Go to step 5; | (19) | Else | (20) | Go to step 3; | (21) | End if | (22) | End if | (23) | If there exists a loop with between the source node and a leaf node then | (24) | If then | (25) | The valid task swap loop is found, and Algorithm 2 terminates. | (26) | End if | (27) | End if | (28) | End for | (29) | End while | (30) | End while |
|