func (l LabelMap) Valid() bool {
	inverse := make(map[uint]string)
	for k, v := range l {
		inverse[v.ID] = k
	}

	// Bijective?
	if !(len(l) == len(inverse)) {
		return false
	}

	// No longer checking that it starts with 0 and has consecutive integers
	// for i := 0; i < len(inverse); i++ {
	// 	if _, exists := inverse[uint(i)]; !exists {
	// 		return false
	// 	}
	// }

	return true
}
// Valid ensures that the LabelMap is valid by testing that it is bijective. If
// not, it's invalid. (Previously checked to make sure that IDs started at 0 and
// had no gaps, but that requirement has since been relaxed.)
Valid ensures that the LabelMap is valid by testing that it is bijective. If
not, it's invalid. (Previously checked to make sure that IDs started at 0 and
had no gaps, but that requirement has since been relaxed.)
// Valid ensures that the LabelMap is valid by testing that it is bijective . If // not it ' s invalid . ( Previously checked to make sure that IDs started at 0 and // had no gaps but that requirement has since been relaxed . )
func (l LabelMap) Valid() bool {
	inverse := make(map[uint]string)
	for k, v := range l {
		inverse[v.ID] = k
	}
	if !(len(l) == len(inverse)) {
		return false
	}
	return true
}
func ( l LabelMap ) Valid ( ) bool { inverse := make ( map [ uint ] string ) for k , v := range l { inverse [ v . ID ] = k } if ! ( len ( l ) == len ( inverse ) ) { return false } return true }
Valid ensures that the LabelMap is valid by testing that it is bijective.
Valid ensures that the LabelMap is valid by testing that it is bijective .
// Bijective? // No longer checking that it starts with 0 and has consecutive integers // for i := 0; i < len(inverse); i++ { // 	if _, exists := inverse[uint(i)]; !exists { // 		return false // 	} // }