func (g *mutableUndirected) RemoveVertex(vertices ...Vertex) {
	if len(vertices) == 0 {
		return
	}
	g.mu.Lock()
	defer g.mu.Unlock()
	for _, vertex := range vertices {
		if g.hasVertex(vertex) {
			eachVertexInAdjacencyList(g.list, vertex, func(adjacent Vertex) (terminate bool) {
				delete(g.list[adjacent], vertex)
				return
			})
			g.size -= len(g.list[vertex])
			delete(g.list, vertex)
		}
	}
	return
}
Removes a vertex from the graph. Also removes any edges of which that
vertex is a member.
package al
import (
	. "github.com/sdboyer/gogl"
	"gopkg.in/fatih/set.v0"
)
type mutableUndirected struct {
	al_basic_mut
}
func (g *mutableUndirected) DegreeOf(vertex Vertex) (degree int, exists bool) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	if exists = g.hasVertex(vertex); exists {
		degree = len(g.list[vertex])
	}
	return
}
func (g *mutableUndirected) Edges(f EdgeStep) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	visited := set.New(set.NonThreadSafe)
	for source, adjacent := range g.list {
		for target := range adjacent {
			e := NewEdge(source, target)
			if !visited.Has(NewEdge(target, source)) {
				visited.Add(e)
				if f(e) {
					return
				}
			}
		}
	}
}
func (g *mutableUndirected) IncidentTo(v Vertex, f EdgeStep) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	if !g.hasVertex(v) {
		return
	}
	for adjacent := range g.list[v] {
		if f(NewEdge(v, adjacent)) {
			return
		}
	}
}
func (g *mutableUndirected) AdjacentTo(vertex Vertex, f VertexStep) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	eachVertexInAdjacencyList(g.list, vertex, f)
}
func (g *mutableUndirected) HasEdge(edge Edge) bool {
	g.mu.RLock()
	defer g.mu.RUnlock()
	u, v := edge.Both()
	if _, exists := g.list[u][v]; exists {
		return true
	} else if _, exists := g.list[v][u]; exists {
		return true
	}
	return false
}
func (g *mutableUndirected) Density() float64 {
	g.mu.RLock()
	defer g.mu.RUnlock()
	order := g.Order()
	return 2 * float64(g.Size()) / float64(order*(order-1))
}