WATER FLOW-LIKE ALGORITHM FOR OBJECT GROUPING PROBLEMS