In this work, we are interested in developing an efficient heuristic algorithm for scheduling the tasks of a parallel program based on the class of UNC (Unbounded Number of Clusters) scheduling algorithms for clusters of NOWs. The main objective of the proposed UNC algorithm is to consider synchronous communication with deadlock avoidance strategy for inter-task message-passing. The proposed algorithm generates non-linear clusters by traversing the task graph (DAG) once, using the Edge-Zeroing (EZ) technique. The objectives of the clustering algorithm is reducing the parallel time of the program, reducing the communication cost, improving the program computation to communication ratio (PCCR), and avoiding deadlock situations. The algorithm achieves its objectives with a time complexity O(|V|(log|V| + (|E|)2)) using nonlinear clustering in order to avoid more than one pass through the task DAG and to be able to deal with task DAGs with fine, medium, and coarse granularity.