Graphs and colorings¶
vefr/graphs.hpp and vefr/properties.hpp.
What an algorithm takes¶
vefr’s algorithms take a graph by urd’s graph concepts (urd/graphs.hpp, after the Boost Graph Library’s), each
stating what it needs: a search urd::adjacency_graph, edge numbers urd::incidence_graph, vefr::reversed
urd::in_adjacency_graph, color refinement and the properties urd::graph_like (adjacency too). Every urd graph
is graph-like; one that keeps edge lists is an incidence and an edge list graph. A graph of one’s own with the same
primitives qualifies too.
Vertices are 0..n-1 by their index (urd::index_of). A graph that lost vertices has holes:
-
template<urd::vertex_list_graph G>
std::size_t vertex_bound(const G &g)¶ One past the largest vertex index. O(1) where the vertices can be read from the back; O(n) for a graph that lost vertices.
-
template<urd::vertex_list_graph G>
class Positions¶ The vertices numbered densely, in increasing order:
of(v)is a vertex’s position,at(position)the vertex there,size()their number. Certificates and canonical forms number vertices by position.
Colorings¶
A coloring is a function of a vertex; the graph does not hold it.
-
using Color = std::uint32_t¶
-
template<typename F, typename V>
concept coloring¶ std::regular_invocable<const F&, V>, returning an integer, an enum or an urd index (read as its index).
-
inline constexpr auto uncolored¶
Every vertex the same color: the default of every algorithm that takes a coloring.
Properties¶
Read from a graph’s neighbours, each in O(n + m) (is_multigraph sorts each row).