67 std::string lower_str = str;
68 std::ranges::transform(
69 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
72 if (lower_str ==
"dfs") {
75 if (lower_str ==
"depth-first") {
78 if (lower_str ==
"depth_first") {
81 if (lower_str ==
"depthfirst") {
85 if (lower_str ==
"bfs") {
88 if (lower_str ==
"breadth-first") {
91 if (lower_str ==
"breadth_first") {
94 if (lower_str ==
"breadthfirst") {
119 panic(
"unhandled SearchAlgorithm value");
138 constexpr auto parse(std::format_parse_context &ctx)
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
SearchAlgorithm
Search algorithm used by BacktrackingStrategy.
@ dfs
Depth-first search with in-place mutation and undo.
@ bfs
Breadth-first search with dual-queue heuristic and visited-state deduplication.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
std::optional< SearchAlgorithm > search_algorithm_from_str(const std::string &str)
Parses a string into a SearchAlgorithm with fuzzy matching.