func (g *al_basic_mut) Order() int {
	g.mu.RLock()
	defer g.mu.RUnlock()
	return len(g.list)
}
Returns the order (number of vertices) in the graph.
package al
import (
	. "github.com/sdboyer/gogl"
	"sync"
)
var alCreators = map[GraphProperties]func() Graph{
	GraphProperties(G_IMMUTABLE | G_DIRECTED | G_BASIC | G_SIMPLE): func() Graph {
		return &immutableDirected{al_basic_immut{al_basic{list: make(map[Vertex]map[Vertex]struct{})}}}
	},
	GraphProperties(G_MUTABLE | G_DIRECTED | G_BASIC | G_SIMPLE): func() Graph {
		return &mutableDirected{al_basic_mut{al_basic{list: make(map[Vertex]map[Vertex]struct{})}, sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_UNDIRECTED | G_BASIC | G_SIMPLE): func() Graph {
		return &mutableUndirected{al_basic_mut{al_basic{list: make(map[Vertex]map[Vertex]struct{})}, sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_DIRECTED | G_WEIGHTED | G_SIMPLE): func() Graph {
		return &weightedDirected{baseWeighted{list: make(map[Vertex]map[Vertex]float64), size: 0, mu: sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_UNDIRECTED | G_WEIGHTED | G_SIMPLE): func() Graph {
		return &weightedUndirected{baseWeighted{list: make(map[Vertex]map[Vertex]float64), size: 0, mu: sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_DIRECTED | G_LABELED | G_SIMPLE): func() Graph {
		return &labeledDirected{baseLabeled{list: make(map[Vertex]map[Vertex]string), size: 0, mu: sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_UNDIRECTED | G_LABELED | G_SIMPLE): func() Graph {
		return &labeledUndirected{baseLabeled{list: make(map[Vertex]map[Vertex]string), size: 0, mu: sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_DIRECTED | G_DATA | G_SIMPLE): func() Graph {
		return &dataDirected{baseData{list: make(map[Vertex]map[Vertex]interface{}), size: 0, mu: sync.RWMutex{}}}
	},
	GraphProperties(G_MUTABLE | G_UNDIRECTED | G_DATA | G_SIMPLE): func() Graph {
		return &dataUndirected{baseData{list: make(map[Vertex]map[Vertex]interface{}), size: 0, mu: sync.RWMutex{}}}
	},
}
func G(gs GraphSpec) Graph {
	for gp, gf := range alCreators {
		if gp&^gs.Props == 0 {
			if gs.Source != nil {
				if gs.Props&G_DIRECTED == G_DIRECTED {
					if dgs, ok := gs.Source.(DigraphSource); ok {
						return functorToDirectedAdjacencyList(dgs, gf().(al_digraph))
					} else {
						panic("Cannot create a digraph from a graph.")
					}
				} else {
					return functorToAdjacencyList(gs.Source, gf().(al_graph))
				}
			} else {
				return gf()
			}
		}
	}
	panic("No graph implementation found for spec")
}
type al_basic struct {
	list map[Vertex]map[Vertex]struct{}
	size int
}
var keyExists = struct{}{}
func (g *al_basic) hasVertex(vertex Vertex) (exists bool) {
	_, exists = g.list[vertex]
	return
}
func (g *al_basic) Size() int {
	return g.size
}
func (g *al_basic) ensureVertex(vertices ...Vertex) {
	for _, vertex := range vertices {
		if !g.hasVertex(vertex) {
			g.list[vertex] = make(map[Vertex]struct{}, 10)
		}
	}
	return
}
type al_basic_immut struct {
	al_basic
}
func (g *al_basic_immut) Vertices(f VertexStep) {
	for v := range g.list {
		if f(v) {
			return
		}
	}
}
func (g *al_basic_immut) HasVertex(vertex Vertex) bool {
	return g.hasVertex(vertex)
}
func (g *al_basic_immut) Order() int {
	return len(g.list)
}
type al_basic_mut struct {
	al_basic
	mu sync.RWMutex
}
func (g *al_basic_mut) Vertices(f VertexStep) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	for v := range g.list {
		if f(v) {
			return
		}
	}
}
func (g *al_basic_mut) HasVertex(vertex Vertex) (exists bool) {
	g.mu.RLock()
	defer g.mu.RUnlock()
	exists = g.hasVertex(vertex)
	return
}