This works develops a novel hierarchical algorithm for task assignment (TA), coordination and communication of multiple UAVs engaging multiple targets and conceives an ad-hoc routing algorithm for synchronization of target lists utilizing a distributed computing topology. Assuming limited communication bandwidth and range, coordination of UAV motion is achieved by implementing a simple behavioral flocking algorithm utilizing a tree topology for target list routing. The TA algorithm is based on a graph-theoretic approach, in which a node locates all the detectable targets, identifies them and computes its distance to each target. The node then produces an attack plan that minimizes the sum of distances of the UAVs in the subtree of a given node to the targets. Simulation experiments show that the combination of flocking and TA algorithms gives the best performance. Clear-cut advantages of the TA algorithm are shown to exist in cases where the hit probability tends to one. An improvement of efficiency, representing the ratio between killed targets and the number of missile launches, is obtained for larger numbers of UAVs only if the engagement times are long enough, utilizing the improved coverage achieved by more UAVs.