4 * Copyright: (c) Universitaet Karlsruhe
5 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
7 * ILP formalization using G=(V, E, Q):
8 * - 1 class of variables: equal color vars
10 * - Clique path constraints
13 * \min \sum_{ (i,j) \in Q } w_ij y_ij
15 * y_ij = 1 (i,j) \in E
17 * \sum_c y_nc = |C| - 1 n \in N, c \in C
19 * y_nc = 1 n \in N, c \not\in C(n)
21 * \sum_{e \in p} y_e >= 1 p \in P path constraints
23 * \sum_{e \in cp} y_e >= |cp| - 1 cp \in CP clique-path constraints
25 * y_ij \in N, w_ij \in R^+
28 #include "becopyilp_t.h"
32 typedef struct _my_env_t {
37 static void ilp2_build(ilp_env_t *ienv) {
38 ienv->lp = new_lpp(ienv->co->name, lpp_minimize);
42 static void ilp2_apply(ilp_env_t *ienv) {
46 int co_solve_ilp2(copy_opt_t *co, double time_limit) {
47 lpp_sol_state_t sol_state;
50 firm_dbg_module_t *dbg = firm_dbg_register("ir.be.coilp2");
52 firm_dbg_set_mask(dbg, DEBUG_LVL);
56 ienv = new_ilp_env(co, dbg, ilp2_build, ilp2_apply, &my);
58 sol_state = ilp_go(ienv, time_limit);
62 return sol_state == lpp_optimal;