This paper presents a novel discrete population based stochastic optimization algorithm inspired from weed colonization. Its performance in a discrete benchmark, timecost trade-off (TCT) problem, is evaluated and compared with five other evolutionary algorithms. Also we use our proposed discrete invasive weed optimization (DIWO) algorithm for cooperative multiple task assignment of unmanned aerial vehicles (UAVs) and compare the solutions with those of genetic algorithms (GAs) which have shown satisfactory results in the previous works. UAV task assignment problem is of great interest among researchers and many deterministic and stochastic methods have been devised to come up with the problem. Monte Carlo simulations show successful results that verify better performance of DIWO compared to GAs in both optimality of the solutions and computational time.