|
|
Go to the documentation of this file. 34 #define SDSP_BOUND 400 44 #include "scip/scip.h" 60 for( i = 0; i < arrsize; i++ ) 62 assert(arr[i] != NULL); 73 SCIP_Real* nodearrreal, 94 assert(state != NULL); 95 assert(vbase != NULL); 97 assert(nodearrreal != NULL); 98 assert(visited != NULL); 99 assert(minelims >= 0); 110 SCIP_CALL( nv_reductionAdv(scip, g, vnoi, nodearrreal, fixed, edgearrint, heap, state, vbase, neighb, distnode, &nvelims) ); 113 SCIPdebugMessage( "NV-reduction (in NVSL): %d \n", nvelims); 116 SCIP_CALL( sl_reduction(scip, g, vnoi, fixed, heap, state, vbase, neighb, visited, &slelims) ); 119 SCIPdebugMessage( "SL-reduction (in NVSL): %d \n", slelims); 127 SCIP_CALL( degree_test(scip, g, fixed, °elims) ); 136 SCIPdebugMessage( "Degree Test-reduction (in NVSL): %d \n", degelims); 139 } while( elims > minelims ); 141 *nelims = totalelims; 156 static int tt_aggregation( 169 assert(fixed != NULL); 171 SCIPdebugMessage( "T-T Aggregation: "); 174 mst = malloc(( size_t)g-> knots * sizeof( PATH)); 178 for(i = 0; i < g-> knots; i++) 187 for(i = 0; !retry && (i < g-> knots); i++) 189 assert((mst[i].edge >= 0) || (g-> grad[i] == 0) || (i == g-> source[0])); 191 if (mst[i].edge >= 0) 202 *fixed += mst[i]. dist; 216 SCIPdebugMessage( "%d Knots deleted\n", count); 232 static int tt_deletion( 246 SCIPdebugMessage( "T-T Edge deletion: "); 249 for(i = 0; i < g-> edges; i++) 253 assert( GT(max, 0.0)); 257 max = max * 2.0 + 1.0; 259 cost = malloc(( size_t)g-> edges * sizeof( double)); 261 assert(cost != NULL); 263 for(i = 0; i < g-> edges; i++) 266 mst = malloc(( size_t)g-> knots * sizeof( PATH)); 270 for(i = 0; i < g-> knots; i++) 275 for(i = 0; i < g-> knots; i++) 280 assert(g-> grad[i] > 0); 298 assert(g-> tail[f] == i); 299 assert(g-> head[f] == k); 301 if ((mst[k].edge == f) || (mst[k].edge == Edge_anti(f))) 304 if ((mst[i].edge == f) || (mst[i].edge == Edge_anti(f))) 317 for(i = 0; i < g-> knots; i++) 319 if ((e = mst[i].edge) < 0) 332 SCIPdebugMessage( "%d Edges deleted\n", count); 353 static int czv_reduction( 368 assert(fixed != NULL); 370 SCIPdebugMessage( "Lazy closest T-Edge Reduction: "); 373 for(i = 0; i < g-> knots; i++) 411 printf( "Error in czv_reduction (will be ignored) \n"); 443 if ( GE(min1 + min3, min2)) 446 assert(g-> tail[e1] == i); 454 SCIPdebugMessage( "%d Knots deleted\n", count); 469 static int lle_reduction( 483 SCIPdebugMessage( "Lazy Longest Edge Reduction: "); 486 for(i = 0; i < g-> knots; i++) 489 for(i = 0; i < g->knots; i++) 518 if (g-> head[l] == i2) 533 SCIPdebugMessage( "%d Edges deleted\n", count * 2); 548 static int le_reduction( 565 SCIPdebugMessage( "Longest Edge Reduction: "); 568 for(i = 0; i < g-> knots; i++) 572 term = malloc(( size_t)g-> knots * sizeof( int)); 574 assert(term != NULL); 576 used = malloc(( size_t)(g-> edges / 2) * sizeof( char)); 578 assert(used != NULL); 580 for(i = 0; i < g-> edges / 2; i++) 583 path = malloc(( size_t)g-> knots * sizeof( PATH*)); 585 assert(path != NULL); 587 for(i = 0; i < g-> knots; i++) 595 path[i] = malloc(( size_t)g-> knots * sizeof( PATH)); 597 assert(path[i] != NULL); 603 for(k = 0; k < g-> knots; k++) 605 assert((k == i) || !g-> mark[k] || (path[i][k]. edge >= 0)); 607 if (path[i][k].edge >= 0) 611 for(k = 0; k < g-> knots; k++) 616 for(i = 0; i < g-> knots; i++) 640 for(j = 0; j < terms; j++) 645 assert(g-> grad[i2] > 0); 646 assert(path[i2] != NULL); 650 if ( LE( Max(path[i2][i].dist, path[i2][i1].dist), g-> cost[k])) 659 for(i = 0; i < g-> knots; i++) 667 SCIPdebugMessage( "%d Edges deleted\n", count * 2); 676 static int hops_test( 679 const int max_hops = param_get( "MAX_HOPS")->i; 695 if (!param_get( "HOPS_SEP")->i) 700 SCIPdebugMessage( "Max-Hops reachability Test: "); 703 cost = malloc(( size_t)g-> edges * sizeof(*cost)); 704 path = malloc(( size_t)g-> knots * sizeof(*path)); 705 root = malloc(( size_t)g-> knots * sizeof(*root)); 706 mark = malloc(( size_t)g-> knots * sizeof(*mark)); 708 assert(cost != NULL); 709 assert(path != NULL); 710 assert(root != NULL); 711 assert(mark != NULL); 713 for(i = 0; i < g-> knots; i++) 716 for(i = 0; i < g->edges; i++) 723 for(i = 0; i < g-> knots; i++) 737 for(i = 0; i < g-> knots; i++) 744 if (root[i].dist > min_hops) 745 min_hops = root[i]. dist; 749 if (root[i].dist >= max_hops) 759 for(i = 0; i < g-> knots; i++) 760 mark[i] = g-> mark[i]; 765 for(i = 0; i < g-> knots; i++) 783 SCIPdebugMessage( "%d Knots removed (%d/%d)\n", count, min_hops, max_hops); 796 assert(scip != NULL); 799 for( k = 0; k < g-> knots; k++ ) 804 for( k = 0; k < g-> knots; k++ ) 806 if( !g-> mark[k] && (g-> grad[k] > 0) ) 831 SCIP_Real* nodearrreal; 833 SCIP_Real* nodearrreal2; 834 SCIP_Real* nodearrreal3; 836 SCIP_Real* edgearrreal; 837 SCIP_Real* edgearrreal2; 838 SCIP_Real upperbound; 862 SCIP_Bool da = dualascent; 863 SCIP_Bool sdc = TRUE; 864 SCIP_Bool bd3 = TRUE; 865 SCIP_Bool nvsl = TRUE; 866 SCIP_Bool bred = FALSE; 867 SCIP_Bool rerun = TRUE; 869 assert(scip != NULL); 871 assert(minelims >= 0); 878 if( SCIPisLE(scip, ( double) g-> terms / ( double) nnodes, 0.03 ) ) 892 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) ); 896 SCIP_CALL( SCIPallocBufferArray(scip, &gnodearr, nterms - 1) ); 897 for( i = 0; i < nterms - 1; i++ ) 899 SCIP_CALL( SCIPallocBuffer(scip, &gnodearr[i]) ); 908 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrint, nedges) ); 909 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrchar, nnodes) ); 910 SCIP_CALL( SCIPallocBufferArray(scip, &heap, nnodes + 1) ); 911 SCIP_CALL( SCIPallocBufferArray(scip, &state, 4 * nnodes) ); 912 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrreal, nnodes) ); 914 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrreal2, nnodes) ); 915 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrreal3, nnodes) ); 917 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrreal, nedges) ); 918 SCIP_CALL( SCIPallocBufferArray(scip, &vbase, 4 * nnodes) ); 919 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint, nnodes) ); 920 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint2, nnodes) ); 921 SCIP_CALL( SCIPallocBufferArray(scip, &vnoi, 4 * nnodes) ); 922 SCIP_CALL( SCIPallocBufferArray(scip, &path, nnodes) ); 926 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrreal2, nedges) ); 934 reductbound = MAX(nnodes / 1000, minelims); 936 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 938 while( rerun && !SCIPisStopped(scip) ) 940 if( SCIPgetTotalTime(scip) > timelimit ) 955 SCIP_CALL( ledge_reduction(scip, g, vnoi, heap, state, vbase, &lenelims) ); 957 if( lenelims <= reductbound ) 960 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 962 SCIPdebugMessage( "le: %d \n", lenelims); 963 if( SCIPgetTotalTime(scip) > timelimit ) 969 SCIP_CALL( sd_red(scip, g, vnoi, edgearrreal, nodearrreal, heap, state, vbase, nodearrint, nodearrint2, edgearrint, &sdnelims) ); 971 if( sdnelims <= reductbound ) 974 SCIPdebugMessage( "sd: %d, \n", sdnelims); 975 if( SCIPgetTotalTime(scip) > timelimit ) 981 SCIP_CALL( sdsp_reduction(scip, g, vnoi, path, heap, state, vbase, nodearrint, nodearrint2, &sdcnelims, SDSP_BOUND) ); 983 if( sdcnelims <= reductbound ) 986 SCIPdebugMessage( "sdsp: %d \n", sdcnelims); 987 if( SCIPgetTotalTime(scip) > timelimit ) 992 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 996 SCIP_CALL( bd3_reduction(scip, g, vnoi, path, heap, state, vbase, nodearrint, nodearrint2, &bd3nelims, BD3_BOUND) ); 997 if( bd3nelims <= reductbound ) 1000 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 1002 SCIPdebugMessage( "bd3: %d \n", bd3nelims); 1003 if( SCIPgetTotalTime(scip) > timelimit ) 1009 SCIP_CALL( nvsl_reduction(scip, g, vnoi, nodearrreal, fixed, edgearrint, heap, state, vbase, nodearrint, NULL, nodearrchar, &nvslnelims, reductbound) ); 1011 if( nvslnelims <= reductbound ) 1014 SCIPdebugMessage( "nvsl: %d \n", nvslnelims); 1015 if( SCIPgetTotalTime(scip) > timelimit ) 1021 SCIP_CALL( bound_reduce(scip, g, vnoi, edgearrreal, NULL, nodearrreal, edgearrreal2, fixed, &upperbound, heap, state, vbase, &brednelims) ); 1023 if( brednelims <= 2 * reductbound ) 1026 SCIPdebugMessage( "bnd: %d \n", brednelims); 1027 if( SCIPgetTotalTime(scip) > timelimit ) 1033 SCIP_CALL( da_reduce(scip, g, vnoi, gnodearr, edgearrreal, edgearrreal2, nodearrreal, edgearrint, vbase, heap, state, nodearrint2, nodearrchar, &danelims) ); 1035 if( danelims <= 5 * reductbound ) 1038 SCIPdebugMessage( "da: %d \n", danelims); 1039 if( SCIPgetTotalTime(scip) > timelimit ) 1043 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 1045 if( (danelims + sdnelims + bd3nelims + nvslnelims + lenelims + brednelims + sdcnelims) <= 2 * reductbound ) 1058 for( i = 0; i < nnodes; i++ ) 1060 for( i = 0; i < 5; i++ ) 1062 SCIP_CALL( sd_reduction(scip, g, nodearrreal, nodearrreal2, nodearrreal3, edgearrreal, edgearrreal2, heap, state, nodearrint, &nelims, runnum, &seed) ); 1065 if( nelims <= 5 * reductbound ) 1067 SCIP_CALL( degree_test(scip, g, fixed, °tnelims) ); 1070 printf( "final sd: %d, \n", sdnelims); 1071 if( sdnelims > 5 * reductbound ) 1086 SCIPdebugMessage( "Reduction Level 1: Fixed Cost = %.12e\n", *fixed); 1089 SCIPfreeBufferArrayNull(scip, &edgearrreal2); 1090 SCIPfreeBufferArray(scip, &path); 1091 SCIPfreeBufferArray(scip, &vnoi); 1092 SCIPfreeBufferArray(scip, &nodearrint2); 1093 SCIPfreeBufferArray(scip, &nodearrint); 1094 SCIPfreeBufferArray(scip, &vbase); 1095 SCIPfreeBufferArray(scip, &edgearrreal); 1097 SCIPfreeBufferArray(scip, &nodearrreal3); 1098 SCIPfreeBufferArray(scip, &nodearrreal2); 1100 SCIPfreeBufferArray(scip, &nodearrreal); 1101 SCIPfreeBufferArray(scip, &state); 1102 SCIPfreeBufferArray(scip, &heap); 1103 SCIPfreeBufferArray(scip, &nodearrchar); 1104 SCIPfreeBufferArray(scip, &edgearrint); 1106 if( gnodearr != NULL ) 1108 for( i = nterms - 2; i >= 0; i-- ) 1109 SCIPfreeBuffer(scip, &gnodearr[i]); 1110 SCIPfreeBufferArray(scip, &gnodearr); 1130 SCIP_Real* exedgearrreal; 1131 SCIP_Real* nodearrreal; 1132 SCIP_Real* exedgearrreal2; 1133 SCIP_Real timelimit; 1134 SCIP_Real upperbound; 1157 char da = dualascent; 1164 assert(scip != NULL); 1166 assert(minelims >= 0); 1176 extnedges = nedges + 2 * (g-> terms - 1); 1179 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) ); 1182 SCIP_CALL( SCIPallocBufferArray(scip, &heap, nnodes + 1) ); 1183 SCIP_CALL( SCIPallocBufferArray(scip, &state, 4 * nnodes) ); 1184 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrreal, nnodes + 1) ); 1185 SCIP_CALL( SCIPallocBufferArray(scip, &exedgearrreal, extnedges ) ); 1186 SCIP_CALL( SCIPallocBufferArray(scip, &vbase, 4 * nnodes) ); 1187 SCIP_CALL( SCIPallocBufferArray(scip, &vnoi, 4 * nnodes) ); 1188 SCIP_CALL( SCIPallocBufferArray(scip, &path, nnodes) ); 1189 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint, nnodes + 1) ); 1190 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint2, nnodes) ); 1191 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrchar, nnodes + 1) ); 1193 if( SCIPisLE(scip, ( double) g-> terms / ( double) nnodes, 0.03) ) 1198 SCIP_CALL( SCIPallocBufferArray(scip, &exedgearrreal2, extnedges) ); 1202 exedgearrreal2 = NULL; 1207 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrint, extnedges) ); 1208 SCIP_CALL( SCIPallocBufferArray(scip, &gnodearr, nterms - 1) ); 1209 for( i = 0; i < nterms - 1; i++ ) 1211 SCIP_CALL( SCIPallocBuffer(scip, &gnodearr[i]) ); 1217 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrint, nedges) ); 1222 reductbound = MAX(nnodes / 1000, minelims); 1228 while( rerun && !SCIPisStopped(scip) ) 1230 if( SCIPgetTotalTime(scip) > timelimit ) 1244 SCIP_CALL( sdsp_reduction(scip, g, vnoi, path, heap, state, vbase, nodearrint, nodearrint2, &sdcnelims, SDSP_BOUND) ); 1246 if( sdcnelims <= reductbound ) 1249 SCIPdebugMessage( "SDsp: %d \n", sdcnelims); 1250 if( SCIPgetTotalTime(scip) > timelimit ) 1256 SCIP_CALL( sdpc_reduction(scip, g, vnoi, exedgearrreal, heap, state, vbase, nodearrint, nodearrint2, &sdnelims) ); 1257 if( sdnelims <= reductbound ) 1260 SCIPdebugMessage( "SDpc: %d \n", sdnelims); 1261 if( SCIPgetTotalTime(scip) > timelimit ) 1266 degnelims += nelims; 1270 SCIP_CALL( bd3_reduction(scip, g, vnoi, path, heap, state, vbase, nodearrint, nodearrint2, &bd3nelims, BD3_BOUND) ); 1271 if( bd3nelims <= reductbound ) 1274 SCIPdebugMessage( "bd3: %d, ", bd3nelims); 1275 if( SCIPgetTotalTime(scip) > timelimit ) 1281 SCIP_CALL( nvsl_reduction(scip, g, vnoi, nodearrreal, fixed, edgearrint, heap, state, vbase, nodearrint, nodearrint2, nodearrchar, &nvslnelims, reductbound) ); 1283 if( nvslnelims <= 0.5 * reductbound ) 1286 SCIPdebugMessage( "nvsl: %d \n", nvslnelims); 1287 if( SCIPgetTotalTime(scip) > timelimit ) 1293 SCIP_CALL( bound_reduce(scip, g, vnoi, exedgearrreal, g-> prize, nodearrreal, exedgearrreal2, fixed, &upperbound, heap, state, vbase, &brednelims) ); 1294 if( brednelims <= reductbound ) 1297 SCIPdebugMessage( "bnd %d \n", brednelims); 1298 if( SCIPgetTotalTime(scip) > timelimit ) 1306 SCIP_CALL( da_reduce(scip, g, vnoi, gnodearr, exedgearrreal, exedgearrreal2, nodearrreal, edgearrint, vbase, heap, state, nodearrint2, nodearrchar, &danelims) ); 1310 SCIP_CALL( daPc_reduce(scip, g, vnoi, gnodearr, exedgearrreal, exedgearrreal2, nodearrreal, vbase, heap, edgearrint, state, nodearrchar, &danelims) ); 1313 if( danelims <= 2 * reductbound ) 1316 SCIPdebugMessage( "da: %d \n", danelims); 1319 if( degnelims + sdnelims + sdcnelims + bd3nelims + danelims + brednelims + nvslnelims <= reductbound ) 1324 SCIPdebugMessage( "Reduction Level PC 1: Fixed Cost = %.12e\n", *fixed); 1328 if( gnodearr != NULL ) 1330 for( i = nterms - 2; i >= 0; i-- ) 1331 SCIPfreeBuffer(scip, &gnodearr[i]); 1332 SCIPfreeBufferArray(scip, &gnodearr); 1334 SCIPfreeBufferArray(scip, &edgearrint); 1335 SCIPfreeBufferArrayNull(scip, &exedgearrreal2); 1336 SCIPfreeBufferArray(scip, &nodearrchar); 1337 SCIPfreeBufferArray(scip, &nodearrint2); 1338 SCIPfreeBufferArray(scip, &nodearrint); 1339 SCIPfreeBufferArray(scip, &path); 1340 SCIPfreeBufferArray(scip, &vnoi); 1341 SCIPfreeBufferArray(scip, &vbase); 1342 SCIPfreeBufferArray(scip, &exedgearrreal); 1343 SCIPfreeBufferArray(scip, &nodearrreal); 1344 SCIPfreeBufferArray(scip, &state); 1345 SCIPfreeBufferArray(scip, &heap); 1364 SCIP_Real* nodearrreal; 1365 SCIP_Real* edgearrreal; 1366 SCIP_Real* edgearrreal2; 1367 SCIP_Real timelimit; 1368 SCIP_Real upperbound; 1391 char da = dualascent; 1402 assert(scip != NULL); 1404 assert(fixed != NULL); 1410 boolarr[4] = &ansad; 1411 boolarr[5] = &ansad2; 1412 boolarr[6] = &chain2; 1418 redbound = MAX(nnodes / 1000, minelims); 1422 extnedges = nedges + 2 * (g-> terms - 1); 1425 SCIP_CALL( SCIPallocBufferArray(scip, &gnodearr, nterms - 1) ); 1426 for( i = 0; i < nterms - 1; i++ ) 1428 SCIP_CALL( SCIPallocBuffer(scip, &gnodearr[i]) ); 1430 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrint, extnedges) ); 1438 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) ); 1440 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint, nnodes + 1) ); 1441 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint2, nnodes) ); 1442 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint3, nnodes) ); 1443 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrchar, nnodes) ); 1444 SCIP_CALL( SCIPallocBufferArray(scip, &state, 3 * nnodes) ); 1445 SCIP_CALL( SCIPallocBufferArray(scip, &vbase, 3 * nnodes) ); 1446 SCIP_CALL( SCIPallocBufferArray(scip, &vnoi, 3 * nnodes) ); 1447 SCIP_CALL( SCIPallocBufferArray(scip, &path, nnodes) ); 1451 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrreal, nnodes + 1) ); 1452 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrreal, extnedges) ); 1453 SCIP_CALL( SCIPallocBufferArray(scip, &edgearrreal2, extnedges) ); 1459 edgearrreal2 = NULL; 1469 while( rerun && !SCIPisStopped(scip) ) 1483 if( SCIPgetTotalTime(scip) > timelimit ) 1488 SCIP_CALL( chain2Reduction(scip, g, vnoi, path, state, vbase, nodearrint, nodearrint2, nodearrint3, &chain2elims, 300) ); 1490 if( chain2elims <= redbound ) 1493 printf( "chain2 delete: %d \n", chain2elims); 1498 SCIP_CALL( npvReduction(scip, g, vnoi, path, state, vbase, nodearrint, nodearrint2, nodearrint3, &npvelims, 400) ); 1500 if( npvelims <= redbound ) 1503 printf( "npv delete: %d \n", npvelims); 1509 SCIP_CALL( ansReduction(scip, g, fixed, nodearrint2, &anselims) ); 1511 if( anselims <= redbound ) 1514 SCIPdebugMessage( "ans deleted: %d \n", anselims); 1519 SCIP_CALL( ansadvReduction(scip, g, fixed, nodearrint2, &ansadelims) ); 1521 if( ansadelims <= redbound ) 1524 SCIPdebugMessage( "ans advanced deleted: %d \n", ansadelims); 1531 if( ansad2elims <= redbound ) 1536 printf( "ans advanced 2 deleted: %d \n", degelims); 1545 SCIP_CALL( chain2Reduction(scip, g, vnoi, path, state, vbase, nodearrint, nodearrint2, nodearrint3, &chain2elims, 300) ); 1547 if( chain2elims <= redbound ) 1550 SCIPdebugMessage( "chain2 delete: %d \n", chain2elims); 1555 SCIP_CALL( npvReduction(scip, g, vnoi, path, state, vbase, nodearrint, nodearrint2, nodearrint3, &npvelims, 400) ); 1557 if( npvelims <= redbound ) 1560 SCIPdebugMessage( "npv delete: %d \n", npvelims); 1566 SCIP_CALL( nnpReduction(scip, g, fixed, nodearrint, nodearrint2, nodearrint3, &nnpelims, 300, nodearrchar) ); 1568 if( nnpelims <= redbound ) 1571 SCIPdebugMessage( "nnp deleted: %d \n", nnpelims); 1576 SCIP_CALL( chain2Reduction(scip, g, vnoi, path, state, vbase, nodearrint, nodearrint2, nodearrint3, &chain2elims, 500) ); 1578 if( chain2elims <= redbound ) 1581 SCIPdebugMessage( "chain2 delete: %d \n", chain2elims); 1583 if( SCIPgetTotalTime(scip) > timelimit ) 1593 if( ansad2elims <= redbound ) 1598 SCIPdebugMessage( "ans advanced 2 deleted: %d \n", degelims); 1604 SCIP_CALL( bound_reduce(scip, g, vnoi, edgearrreal, g-> prize, nodearrreal, edgearrreal2, fixed, &upperbound, nodearrint, state, vbase, &bredelims) ); 1606 if( bredelims <= redbound ) 1611 SCIPdebugMessage( "bound_reduce: %d \n", bredelims); 1616 SCIP_CALL( daPc_reduce(scip, g, vnoi, gnodearr, edgearrreal, edgearrreal2, nodearrreal, vbase, nodearrint, edgearrint, nodearrint2, nodearrchar, &daelims) ); 1618 if( daelims <= 2 * redbound ) 1624 if( anselims + nnpelims + chain2elims + bredelims + npvelims + ansadelims + ansad2elims + daelims <= redbound ) 1627 if( !rerun && dualascent ) 1629 int cnsadvelims = 0; 1633 if( cnsadvelims > 2 * redbound ) 1639 SCIPdebugMessage( "RELAOD! %d\n\n ", cnsadvelims); 1652 SCIPfreeBufferArrayNull(scip, &edgearrreal2); 1653 SCIPfreeBufferArrayNull(scip, &edgearrreal); 1654 SCIPfreeBufferArrayNull(scip, &nodearrreal); 1655 SCIPfreeBufferArray(scip, &path); 1656 SCIPfreeBufferArray(scip, &vnoi); 1657 SCIPfreeBufferArray(scip, &vbase); 1658 SCIPfreeBufferArray(scip, &state); 1659 SCIPfreeBufferArray(scip, &nodearrchar); 1660 SCIPfreeBufferArray(scip, &nodearrint3); 1661 SCIPfreeBufferArray(scip, &nodearrint2); 1662 SCIPfreeBufferArray(scip, &nodearrint); 1663 SCIPfreeBufferArrayNull(scip, &edgearrint); 1665 if( gnodearr != NULL ) 1667 for( i = nterms - 2; i >= 0; i-- ) 1668 SCIPfreeBuffer(scip, &gnodearr[i]); 1669 SCIPfreeBufferArray(scip, &gnodearr); 1689 SCIP_Real timelimit; 1690 SCIP_Real upperbound; 1708 DOES NOT WORK for HC! 1716 assert(scip != NULL); 1718 assert(minelims >= 0); 1724 redbound = MAX(g-> knots / 1000, minelims); 1725 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) ); 1728 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrchar, nnodes) ); 1729 SCIP_CALL( SCIPallocBufferArray(scip, &heap, nnodes + 1) ); 1730 SCIP_CALL( SCIPallocBufferArray(scip, &state, 3 * nnodes) ); 1731 SCIP_CALL( SCIPallocBufferArray(scip, &cost, nedges) ); 1732 SCIP_CALL( SCIPallocBufferArray(scip, &radius, nnodes) ); 1733 SCIP_CALL( SCIPallocBufferArray(scip, &costrev, nedges) ); 1734 SCIP_CALL( SCIPallocBufferArray(scip, &vbase, 3 * nnodes) ); 1735 SCIP_CALL( SCIPallocBufferArray(scip, &pathedge, nnodes) ); 1736 SCIP_CALL( SCIPallocBufferArray(scip, &vnoi, 3 * nnodes) ); 1740 while( (bred || hbred || rbred || rcbred) && !SCIPisStopped(scip) ) 1742 if( SCIPgetTotalTime(scip) > timelimit ) 1747 SCIP_CALL( hcrbound_reduce(scip, g, vnoi, cost, costrev, radius, heap, state, vbase, &hcrnelims, pathedge) ); 1748 if( hcrnelims <= redbound ) 1754 SCIP_CALL( hcrcbound_reduce(scip, g, vnoi, cost, costrev, radius, -1.0, heap, state, vbase, &hcrcnelims, pathedge, FALSE) ); 1755 if( hcrcnelims <= redbound ) 1761 SCIP_CALL( bound_reduce(scip, g, vnoi, cost, NULL, radius, costrev, fixed, &upperbound, heap, state, vbase, &brednelims) ); 1762 if( brednelims <= redbound ) 1766 if( SCIPgetTotalTime(scip) > timelimit ) 1771 SCIP_CALL( hopbound_reduce(scip, g, vnoi, cost, radius, costrev, heap, state, vbase, &hbrednelims) ); 1772 if( hbrednelims <= redbound ) 1774 if( SCIPgetTotalTime(scip) > timelimit ) 1780 SCIP_CALL( da_reduce(scip, g, vnoi, gnodarr, cost, costrev, radius, vbase, heap, state, pathedge, nodearrchar, &danelims) ); 1781 if( danelims <= 2 * redbound ) 1789 SCIPfreeBufferArray(scip, &vnoi); 1790 SCIPfreeBufferArray(scip, &pathedge); 1791 SCIPfreeBufferArray(scip, &vbase); 1792 SCIPfreeBufferArray(scip, &costrev); 1793 SCIPfreeBufferArray(scip, &radius); 1794 SCIPfreeBufferArray(scip, &cost); 1795 SCIPfreeBufferArray(scip, &state); 1796 SCIPfreeBufferArray(scip, &heap); 1797 SCIPfreeBufferArray(scip, &nodearrchar); 1813 SCIP_Real timelimit; 1830 redbound = MAX(nnodes / 1000, minelims); 1831 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) ); 1833 SCIP_CALL( SCIPallocBufferArray(scip, &vnoi, nnodes) ); 1834 SCIP_CALL( SCIPallocBufferArray(scip, &path, nnodes) ); 1835 SCIP_CALL( SCIPallocBufferArray(scip, &heap, nnodes) ); 1836 SCIP_CALL( SCIPallocBufferArray(scip, &state, nnodes) ); 1837 SCIP_CALL( SCIPallocBufferArray(scip, &vbase, nnodes) ); 1838 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint, nnodes) ); 1839 SCIP_CALL( SCIPallocBufferArray(scip, &nodearrint2, nnodes) ); 1842 for( e = 0; e < g-> edges; e++ ) 1843 if( SCIPisEQ(scip, g-> cost[e], 20000.0) ) 1847 while( (sd || rpt) && !SCIPisStopped(scip) ) 1849 if( SCIPgetTotalTime(scip) > timelimit ) 1854 SCIP_CALL( sdsp_sap_reduction(scip, g, vnoi, path, heap, state, vbase, nodearrint, nodearrint2, &sdnelims, 300) ); 1855 if( sdnelims <= redbound ) 1865 if( rptnelims <= redbound ) 1873 SCIPfreeBufferArray(scip, &vnoi); 1874 SCIPfreeBufferArray(scip, &path); 1875 SCIPfreeBufferArray(scip, &heap); 1876 SCIPfreeBufferArray(scip, &state); 1877 SCIPfreeBufferArray(scip, &vbase); 1878 SCIPfreeBufferArray(scip, &nodearrint); 1879 SCIPfreeBufferArray(scip, &nodearrint2); 1896 assert((*graph) != NULL); 1897 assert((*graph)->fixedges == NULL); 1898 assert(level >= 0 && level <= 2); 1899 assert(minelims >= 0); 1900 assert((*graph)->layers == 1); 1904 stp_type = (*graph)->stp_type; 1921 SCIP_CALL( reducePc(scip, (graph), offset, minelims, FALSE) ); 1925 SCIP_CALL( reduceHc(scip, (graph), offset, minelims) ); 1927 SCIP_CALL( reduceSap(scip, (graph), offset, minelims) ); 1931 else if( level == 2 ) 1934 SCIP_CALL( reducePc(scip, (graph), offset, minelims, TRUE) ); 1938 SCIP_CALL( reduceHc(scip, (graph), offset, minelims) ); 1940 SCIP_CALL( reduceSap(scip, (graph), offset, minelims) ); 1942 SCIP_CALL( reduceStp(scip, (graph), offset, minelims, TRUE) ); 1944 SCIPdebugMessage( "offset : %f \n", *offset); SCIP_RETCODE graph_path_init(SCIP *, GRAPH *)
int graph_valid(const GRAPH *)
SCIP_RETCODE hcrcbound_reduce(SCIP *, GRAPH *, PATH *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real, int *, int *, int *, int *, int *, SCIP_Bool)
SCIP_RETCODE nnpReduction(SCIP *, GRAPH *, SCIP_Real *, int *, int *, int *, int *, int, char *)
SCIP_RETCODE sdpc_reduction(SCIP *, GRAPH *, PATH *, SCIP_Real *, int *, int *, int *, int *, int *, int *)
SCIP_RETCODE graph_init_history(SCIP *, GRAPH *)
SCIP_RETCODE pcgraphtrans(SCIP *, GRAPH *)
Problem data for stp problem.
SCIP_RETCODE graph_knot_contract(SCIP *, GRAPH *, int, int)
void graph_path_exit(SCIP *, GRAPH *)
SCIP_RETCODE npvReduction(SCIP *, GRAPH *, PATH *, PATH *, int *, int *, int *, int *, int *, int *, int)
SCIP_RETCODE degree_test(SCIP *, GRAPH *, SCIP_Real *, int *)
void level0(SCIP *scip, GRAPH *g)
static SCIP_RETCODE reduceStp(SCIP *scip, GRAPH **graph, SCIP_Real *fixed, int minelims, SCIP_Bool dualascent)
SCIP_RETCODE pcgraphorg(SCIP *, GRAPH *)
static SCIP_RETCODE reducePc(SCIP *scip, GRAPH **graph, SCIP_Real *fixed, int minelims, char dualascent)
SCIP_RETCODE ansadvReduction(SCIP *, GRAPH *, SCIP_Real *, int *, int *)
static SCIP_RETCODE reduceHc(SCIP *scip, GRAPH **graph, SCIP_Real *fixed, int minelims)
SCIP_RETCODE hopbound_reduce(SCIP *, GRAPH *, PATH *, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *)
miscellaneous methods used for solving Steiner problems
SCIP_RETCODE sd_red(SCIP *, GRAPH *, PATH *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *, int *, int *, int *)
SCIP_RETCODE sdsp_sap_reduction(SCIP *, GRAPH *, PATH *, PATH *, int *, int *, int *, int *, int *, int *, int)
static SCIP_RETCODE reduceMwcs(SCIP *scip, GRAPH **graph, SCIP_Real *fixed, int minelims, char dualascent)
#define STP_MAX_NODE_WEIGHT
SCIP_RETCODE rptReduction(SCIP *, GRAPH *, SCIP_Real *, int *)
propagator for Steiner tree problems, using the LP reduced costs
SCIP_RETCODE degree_test_mw(SCIP *, GRAPH *, SCIP_Real *, int *)
SCIP_RETCODE sd_reduction(SCIP *, GRAPH *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *, int, unsigned int *)
SCIP_RETCODE degree_test_pc(SCIP *, GRAPH *, SCIP_Real *, int *)
static SCIP_RETCODE reduceSap(SCIP *scip, GRAPH **graph, SCIP_Real *fixed, int minelims)
SCIP_RETCODE reduce(SCIP *scip, GRAPH **graph, SCIP_Real *offset, int level, int minelims)
SCIP_RETCODE chain2Reduction(SCIP *, GRAPH *, PATH *, PATH *, int *, int *, int *, int *, int *, int *, int)
#define STP_PRIZE_COLLECTING
void graph_edge_del(SCIP *, GRAPH *, int, SCIP_Bool)
SCIP_RETCODE degree_test_hc(SCIP *, GRAPH *, SCIP_Real *, int *)
SCIP_RETCODE ledge_reduction(SCIP *, GRAPH *, PATH *, int *, int *, int *, int *)
includes various files containing graph methods used for Steiner problems
SCIP_RETCODE daPc_reduce(SCIP *, GRAPH *, PATH *, GNODE **, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *, char *, int *)
SCIP_RETCODE bd3_reduction(SCIP *, GRAPH *, PATH *, PATH *, int *, int *, int *, int *, int *, int *, int)
#define STP_ROOTED_PRIZE_COLLECTING
static void setTrue(char **arr, int arrsize)
static SCIP_RETCODE nvsl_reduction(SCIP *scip, GRAPH *g, PATH *vnoi, SCIP_Real *nodearrreal, SCIP_Real *fixed, int *edgearrint, int *heap, int *state, int *vbase, int *neighb, int *distnode, char *visited, int *nelims, int minelims)
SCIP_RETCODE ansadv2Reduction(SCIP *, GRAPH *, SCIP_Real *, int *, int *)
shortest paths based primal heuristics for Steiner problems
SCIP_RETCODE sl_reduction(SCIP *, GRAPH *, PATH *, double *, int *, int *, int *, int *, char *, int *)
SCIP_RETCODE degree_test_sap(SCIP *, GRAPH *, SCIP_Real *, int *)
SCIP_RETCODE bound_reduce(SCIP *, GRAPH *, PATH *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *)
SCIP_RETCODE cnsAdvReduction(SCIP *, GRAPH *, int *, int *)
SCIP_RETCODE hcrbound_reduce(SCIP *, GRAPH *, PATH *, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *, int *)
SCIP_RETCODE ansReduction(SCIP *, GRAPH *, SCIP_Real *, int *, int *)
SCIP_RETCODE da_reduce(SCIP *, GRAPH *, PATH *, GNODE **, SCIP_Real *, SCIP_Real *, SCIP_Real *, int *, int *, int *, int *, int *, char *, int *)
SCIP_RETCODE sdsp_reduction(SCIP *, GRAPH *, PATH *, PATH *, int *, int *, int *, int *, int *, int *, int)
void graph_trail(const GRAPH *, int)
void graph_path_exec(SCIP *, const GRAPH *, int, int, SCIP_Real *, PATH *)
SCIP_RETCODE nv_reductionAdv(SCIP *, GRAPH *, PATH *, SCIP_Real *, double *, int *, int *, int *, int *, int *, int *, int *)
|