s In grid computing, the goals of task scheduling is to achieve high system optimization performance while matching multi-dimension Quiality of Service(QoS) requirement of applications. Considering of the autonomous, heterogeneous and distributed feature of the grid system, in this paper, we propose a flexible task scheduling algorithm for grid computing after researching on the existing QoS Guide Min-min scheduling algorithm intensively, which is called distance-weighted measurement methodology (DWMM). We evaluate our algorithm within a simulated Gridsim environment. Experimental results once again proved that this flexible algorithm improve the system performance and load balancing.