A node covering algorithm