func (g *Graph) Add(v Vertex) Vertex {
	g.once.Do(g.init)
	g.vertices.Add(v)
	return v
}
Add adds a vertex to the graph. This is safe to call multiple time with
the same Vertex.
package dag
import (
	"bytes"
	"fmt"
	"sort"
	"sync"
)
type Graph struct {
	vertices  *Set
	edges     *Set
	downEdges map[interface{}]*Set
	upEdges   map[interface{}]*Set
	once      sync.Once
}
type Vertex interface{}
type NamedVertex interface {
	Vertex
	Name() string
}
func (g *Graph) Vertices() []Vertex {
	list := g.vertices.List()
	result := make([]Vertex, len(list))
	for i, v := range list {
		result[i] = v.(Vertex)
	}
	return result
}
func (g *Graph) Edges() []Edge {
	list := g.edges.List()
	result := make([]Edge, len(list))
	for i, v := range list {
		result[i] = v.(Edge)
	}
	return result
}
func (g *Graph) HasVertex(v Vertex) bool {
	return g.vertices.Include(v)
}
func (g *Graph) HasEdge(e Edge) bool {
	return g.edges.Include(e)
}