/* * * Copyright (C) 2024 Brett Terpstra * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include inline constexpr char from_char(char c) { return c - 'a'; } struct vertex { char name; HASHSET neighbours; vertex(char name, const HASHSET& n): name(from_char(name)) { for (const auto& v : n) neighbours.insert(from_char(v)); } }; std::vector edges = { vertex{'a', {'i', 'e', 'b', 'j', 'h'}}, vertex{'b', {'a', 'e', 'c', 'j'}}, vertex{'c', {'e', 'd', 'f', 'j', 'b'}}, vertex{'d', {'e', 'f', 'c'}}, vertex{'e', {'h', 'f', 'd', 'c', 'b', 'a', 'i'}}, vertex{'f', {'d', 'e', 'h', 'g', 'j', 'c'}}, vertex{'g', {'j', 'f', 'h'}}, vertex{'h', {'j', 'g', 'f', 'e', 'i', 'a'}}, vertex{'i', {'e', 'a', 'h'}}, vertex{'j', {'a', 'b', 'c', 'f', 'g', 'h'}}, }; void calculate_ordering() { }