In this paper, we codify the objective function that should be optimized by using Genetic Algorithm instead of Heuristic method to solve these problems. So, each bit that constitutes one structure can signify each commodity. Therefore, we can exchange customers without restriction if the traveling distance diminishes among the districts. Furthermore, even though the capacity of a customer's commodities exceeds that of a vehicle, the following vehicle can be allocated. Also, we obtained good result by testing with real data. To be brief, we can effectively allocate innumerable commodities, that have various magnitudes and weight, into restricted capacity of the vehicle by applying genetic algorithm that is useful in solving the problems of optimization.