s
Size: a a a
s
s
s
MK
s
s
s
s
MK
s
s
s
ID
MK
s
d
ID
ID
s
class brute_force {
public:
void impl_fill(graph g) {
if(all_subgraphs.find(g) == all_subgraphs.end()) {
if(g.is_reachable(_s, _d)) {
all_subgraphs.insert(g);
for(size_t i = 0; i < g.num_edges(); ++i) {
g.erase_edge(i);
impl_fill(g);
}
}
}
}
void fill_set() {
impl_fill(_g); <--вот тут вылетает
}
private:
graph _g;
std::unordered_set<graph, graph_hash> all_subgraphs;
};
Код класса `graph`:
class graph {
public:
using byte = unsigned char;
using edge_type = std::vector<std::pair<byte, byte>>;
graph() = default;
graph(graph const& other) = default;
graph(edge_type edges, byte n) : edges(std::move(edges)), n(n) {};
private:
edge_type edges;
byte n = 0;
};
s