1 #define YAPB_NO_GAP
2 #include "simple_graph.h"
3
4 #include "problem.hpp"
5 #include "constraints/edgecolouredgraph.hpp"
6 #include "constraints/setstab.hpp"
7 #include "search/search.hpp"
8 #include <iostream>
9 #include <stdlib.h>
10 #include <stdio.h>
11
SolveGraph(const ParsedGraph & g,SearchOptions so,GraphConfig gc,GraphDirected graphDir)12 vec1<Permutation> SolveGraph(const ParsedGraph &g, SearchOptions so, GraphConfig gc, GraphDirected graphDir) {
13 Problem p(g.graph_size);
14
15 std::vector<AbstractConstraint*> cons;
16 for (const auto &part : g.parts)
17 cons.push_back(new SetStab(part, &p.p_stack));
18
19 if (graphDir == GraphDirected_yes)
20 cons.push_back(new EdgeColouredGraph<UncolouredEdge, GraphDirected_yes>(g.edges, gc, &p.p_stack));
21 else
22 cons.push_back(new EdgeColouredGraph<UncolouredEdge, GraphDirected_no>(g.edges, gc, &p.p_stack));
23
24 SolutionStore ss = doSearch(&p, cons, so);
25 return ss.sols();
26 }
27