func CollectVertices(g VertexEnumerator) (vertices []Vertex) {
	if c, ok := g.(VertexCounter); ok {
		vertices = make([]Vertex, 0, c.Order())
	} else {
		vertices = make([]Vertex, 0, 32)
	}
	g.Vertices(func(v Vertex) (terminate bool) {
		vertices = append(vertices, v)
		return
	})
	return vertices
}
/* Enumerator to slice/collection functors
Collects all of a graph's vertices into a vertex slice, for easy range-ing.

This is a convenience function. Avoid it on very large graphs or in performance critical sections.
package gogl
func Order(g VertexEnumerator) int {
	if c, ok := g.(VertexCounter); ok {
		return c.Order()
	} else {
		var order int
		g.Vertices(func(v Vertex) (terminate bool) {
			order++
			return
		})
		return order
	}
}
func Size(g EdgeEnumerator) int {
	if c, ok := g.(EdgeCounter); ok {
		return c.Size()
	} else {
		var size int
		g.Edges(func(e Edge) (terminate bool) {
			size++
			return
		})
		return size
	}
}