code: func (g *UndirectedGraph) NewNodeID() int {
  	if len(g.nodes) == 0 {
  		return 0
  	}
  	if len(g.nodes) == maxInt {
  		panic(fmt.Sprintf("simple: cannot allocate node: no slot"))
  	}
  
  	var id int
  	if g.freeIDs.Len() != 0 && g.freeIDs.TakeMin(&id) {
  		return id
  	}
  	if id = g.usedIDs.Max(); id < maxInt {
  		return id + 1
  	}
  	for id = 0; id < maxInt; id++ {
  		if !g.usedIDs.Has(id) {
  			return id
  		}
  	}
  	panic("unreachable")
  }
docs: // NewNodeID returns a new unique ID for a node to be added to g. The returned ID does
  // not become a valid ID in g until it is added to g.