package
0.0.0-20210606180040-8ecfec1c2869
Repository: https://github.com/yourbasic/graph.git
Documentation: pkg.go.dev
# Functions
AllEdges returns the universe, the set containing all edges.
Circulant returns a virtual circulant graph with n vertices in which vertex i is adjacent to vertex (i + j) mod n and vertex (i - j) mod n for each j in the list s.
Cost returns a CostFunc that always returns n.
Cycle returns a virtual cycle graph with n vertices and the edges {0, 1}, {1, 2}, {2, 3},..
Edge returns a set consisting of a single edge {v, w}, v ≠ w, of zero cost.
Empty returns a virtual graph with n vertices and no edges.
Generic returns a virtual graph with n vertices; its edge set consists of all edges (v, w), v ≠ w, for which edge(v, w) returns true.
Grid returns a virtual graph whose vertices correspond to integer points in the plane: y-coordinates being in the range 0..m-1, and x-coordinates in the range 0..n-1.
Hyper returns a virtual hypercube graph with 2ⁿ vertices.
Kmn returns a virtual complete bipartite graph with m+n vertices.
Kn returns a complete simple graph with n vertices.
NoEdges returns a set that includes no edges.
Range returns a set containing all vertices v, a ≤ v < b.
Specific returns a cached copy of g with constant time performance for all basic operations.
Tree returns a full k-ary tree with n levels and (kⁿ-1)/(k-1) vertices.
Vertex returns a set containing the single vertex v.
# Type aliases
CostFunc is a function that computes the cost of an edge from v to w.
FilterFunc is a function that tells if there is a directed edge from v to w.