00001 #ifndef __2P_TIGHTEN_C__ 00002 #define __2P_TIGHTEN_C__ 00003 00004 /* ========================================================================= */ 00005 /* define the debug level to use for this program, the efect depend on the DEBUG 00006 * constant defined at compile time, if that variables is >= to the level 00007 * indicated here we will make more tests */ 00008 #define KPT_DBG 90 /* test basic conditions */ 00009 #define KPT_EDBG 90 /* make exhaustive test of conditions */ 00010 #define KPT_VRB 90 /* fully log the program trace */ 00011 00012 /* ========================================================================= */ 00013 /* given a residual graph G^*, and a valid 2P inequality, it will try to find a 00014 * 'more' violated 2P-inequality constraint; the function will not touch the 00015 * data abour the graph nor about the original inequality, but it will alloc 00016 * memory for all data in the new returned inequality. Note too that the number 00017 * of dominos of the new inequality is the same as in the original inequality. 00018 * Finaly, the violation (if it is negative) of the new inequality is returned 00019 * in (*violation). If an error occurs the function will return 1, zero on 00020 * success (this doesn't imply that we were able to find a violated constraint 00021 * from the original onw */ 00022 int KPtighten ( /* graph G* data */ 00023 int const n_nodes, 00024 int const n_edges, 00025 int const *const edges, 00026 double const *const weight, 00027 /* original constrain to tighten */ 00028 int const n2dominos, 00029 int const *const naset, 00030 int const *const nbset, 00031 int const *const ntset, 00032 int const nahandle, 00033 int const nbhandle, 00034 int **const aset, 00035 int **const bset, 00036 int **const tset, 00037 int const *const ahandle, 00038 int const *const bhandle, 00039 /* new generated constraint */ 00040 int **const new_naset, 00041 int **const new_nbset, 00042 int **const new_ntset, 00043 int *const new_nahandle, 00044 int *const new_nbhandle, 00045 int ***const new_aset, 00046 int ***const new_bset, 00047 int ***const new_tset, 00048 int **const new_ahandle, 00049 int **const new_bhandle, 00050 double *const violation); 00051 #endif