def find(label, equiv):
	"""
		Finds the root label in equivalence classes of labels
		Parameters: 
			label -> int
			Value of a labelled pixel, to traverse for finding the root label

			equiv -> dict
			Contains equivalence classes for each label

		Return:
			minVal -> int
			The root label
	"""
	minVal = min(equiv[label])
	while label != minVal:
		label = minVal
		minVal = min(equiv[label])
	
	return minVal