Gird computing is a new computing-framework to meet the growing computational demands. Grid computing provides mechanisms for sharing and accessing large and heterogeneous collections of remote resources. However, how to scheduling the subtasks in these heterogeneous resources is a critical problem. This paper puts forward a task scheduling algorithm based on genetic algorithm. It first generates a fitness function through weighted least connection algorithm, and than generates a new group of individuals through genetic operation such as reproduction, crossover, mutation, etc. It approaches op...