42 #define STP_BD_MAXDEGREE 4 43 #define STP_BD_MAXDNEDGES 6 44 #define STP_SDWALK_MAXNPREVS 8 58 int*RESTRICT* star_base,
64 int* RESTRICT star_base_d;
70 (*dijkdata)->edgelimit = edgelimit;
74 SCIP_Real* dist = (*dijkdata)->node_distance;
75 STP_Bool* visited = (*dijkdata)->node_visited;
78 for(
int i = 0; i <
nnodes; i++ )
89 edge_deletable_d = *edge_deletable;
90 for(
int e = 0; e < nedges / 2; e++ )
91 edge_deletable_d[e] =
FALSE;
93 star_base_d = *star_base;
94 for(
int i = 0; i <
nnodes; i++ )
107 int*RESTRICT* star_base,
114 SCIP_Bool* RESTRICT edge_deletable_d = *edge_deletable;
116 for(
int e = 0; e < nedges / 2; e++ )
118 if( edge_deletable_d[e] )
138 const int* visitlist,
139 int* RESTRICT star_base,
142 DHEAP* RESTRICT dheap
145 int*
const state = dheap->position;
147 for(
int k = 0; k < nvisits; k++ )
149 const int node = visitlist[k];
150 visited[node] =
FALSE;
159 for(
int k = 0; k <
nnodes; k++ )
162 assert(visited[k] ==
FALSE);
179 int* RESTRICT star_base,
188 int*
const head_csr = dcsr->
head;
189 int*
const edgeid_csr = dcsr->
edgeid;
191 assert(g->
mark[node]);
196 const int start = range_csr[node].
start;
199 if( range_csr[node].end - start <= 1 )
212 for(
int e = start; e < range_csr[node].
end; e = enext )
214 const int starnode = head_csr[e];
215 const int starbase = star_base[starnode];
216 assert(star_base[starnode] >= 0);
218 assert(star_base[starnode] == starnode || star_base[starnode] >= 0);
223 if( starnode != starbase )
231 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
251 const int* visitlist,
257 for(
int k = 0; k < nvisits; k++ )
259 const int node = visitlist[k];
260 visited[node] =
FALSE;
266 for(
int k = 0; k <
nnodes; k++ )
268 assert(visited[k] ==
FALSE);
279 const int* visitlist,
281 int* RESTRICT nprevterms,
286 for(
int k = 0; k < nvisits; k++ )
288 const int node = visitlist[k];
289 visited[node] =
FALSE;
292 nprevterms[node] = 0;
296 for(
int k = 0; k <
nnodes; k++ )
298 assert(visited[k] ==
FALSE);
301 assert(nprevterms[k] == 0);
310 const int* visitlist,
319 for(
int k = 0; k < nvisits; k++ )
321 const int node = visitlist[k];
322 visited[node] =
FALSE;
325 nprevterms[node] = 0;
326 nprevNPterms[node] = 0;
327 nprevedges[node] = 0;
331 for(
int k = 0; k <
nnodes; k++ )
333 assert(visited[k] ==
FALSE);
336 assert(nprevterms[k] == 0);
337 assert(nprevNPterms[k] == 0);
338 assert(nprevedges[k] == 0);
363 assert(path !=
NULL);
364 assert(scip !=
NULL);
365 assert(vbase !=
NULL);
366 assert(forbidden !=
NULL);
380 if( forbidden[edge] )
396 assert(g->
head[e] == tail);
398 if( g->
tail[e] == head )
408 assert(g->
head[e] == head);
410 if( g->
tail[e] == tail )
474 assert(scip !=
NULL);
475 assert(vnoi !=
NULL);
476 assert(vbase !=
NULL);
477 assert(termdist !=
NULL);
478 assert(neighbterms !=
NULL);
480 for( k = 0; k < 4; k++ )
482 if(
SCIPisLT(scip, vnoi[pos].dist, ecost) )
484 neighbterms[nnterms] = vbase[pos];
485 termdist[nnterms++] = vnoi[pos].
dist;
501 const GRAPH* netgraph,
512 for(
int k = 0; k < 4; k++ )
521 int j = nodesorg[netgraph->
head[ne]];
528 for(
int k = 0; k < 4; k++ )
532 for(
int l = 3; l > k; l-- )
534 neighbterms[l] = neighbterms[l - 1];
535 termdist[l] = termdist[l - 1];
538 termdist[k] = necost;
564 assert(scip !=
NULL);
565 assert(vnoi !=
NULL);
566 assert(vbase !=
NULL);
567 assert(termdist !=
NULL);
568 assert(neighbterms !=
NULL);
570 for( k = 0; k < 4; k++ )
572 if(
SCIPisLE(scip, vnoi[pos].dist, ecost) )
574 neighbterms[nnterms] = vbase[pos];
575 termdist[nnterms++] = vnoi[pos].
dist;
608 range_csr = dcsr->
range;
609 head_csr = dcsr->
head;
610 cost_csr = dcsr->
cost;
618 for(
int k = 0; k <
nnodes; k++ )
621 mincost_in[k] = g->
prize[k];
626 for(
int k = 0; k <
nnodes; k++ )
630 const int end = range_csr[k].
end;
632 for(
int e = range_csr[k].start; e < end; e++ )
634 const int head = head_csr[e];
638 assert(g->
mark[head]);
640 assert(
LT(costbiased[e],
FARAWAY) && costbiased[e] > 0.0);
642 if( costbiased[e] < mincost_in[head] )
643 mincost_in[head] = costbiased[e];
653 for(
int k = 0; k <
nnodes; k++ )
657 const int end = range_csr[k].
end;
659 for(
int e = range_csr[k].start; e < end; e++ )
661 assert(g->
mark[head_csr[e]]);
662 costbiased[e] -= mincost_in[k];
672 for(
int k = 0; k <
nnodes; k++ )
676 const int end = range_csr[k].
end;
678 for(
int e = range_csr[k].start; e < end; e++ )
680 const int head = head_csr[e];
684 assert(g->
mark[head]);
685 costbiased[e] -= mincost_in[head];
719 assert(scip !=
NULL);
722 if( sd_initial >= 0.0 )
728 for(
int e = g->
outbeg[i], l = 0; (l <= limit) && (e !=
EAT_LAST); e = g->
oeat[e], l++ )
730 if( g->
head[e] == i2 )
732 if( g->
cost[e] < sd )
747 nnterms1 =
getcloseterms(scip, vnoi, termdist1, sd, vbase, neighbterms1, i, nnodes);
758 neighbterms2[0] = i2;
763 nnterms2 =
getcloseterms(scip, vnoi, termdist2, sd, vbase, neighbterms2, i2, nnodes);
769 for(
int j = 0; j < nnterms1; j++ )
771 const int tj = neighbterms1[j];
774 for(
int k = 0; k < nnterms2; k++ )
777 const int tk = neighbterms2[k];
783 maxdist =
MAX(termdist1[j], termdist2[k]);
789 if(
GE(maxdist, sd) )
795 if(
GT(dist, maxdist) )
799 if(
LT(maxdist, sd) )
828 const SCIP_Bool terminateEarly =
GT(sd_sufficient, 0.0);
837 if( onlyIntermedTerms )
850 for(
int j = 0; j < nnterms1; j++ )
852 const int tj = neighbterms1[j];
855 for(
int k = 0; k < nnterms2; k++ )
858 const int tk = neighbterms2[k];
869 if( onlyIntermedTerms )
871 if( tj == i2 || tk == i )
874 assert(
EQ(termdist1[j], 0.0) ||
EQ(termdist2[k], 0.0));
893 if( terminateEarly &&
LT(sd, sd_sufficient) )
925 const SCIP_Bool terminateEarly =
GT(sd_sufficient, 0.0);
932 assert(sdgraph && sdneighbors);
943 assert(nnterms1 <= 4 && nnterms2 <= 4);
945 for(
int j = 0; j < nnterms1; j++ )
947 const int tj = neighbterms1[j];
950 for(
int k = 0; k < nnterms2; k++ )
953 const int tk = neighbterms2[k];
971 if( terminateEarly &&
LT(sd, sd_sufficient) )
993 assert(scip && g && sdsK3 && edgesK3);
994 assert(costK3 >= 0.0);
998 if(
SCIPisLE(scip, sdsK3[0] + sdsK3[1], costK3) )
1001 if(
SCIPisLE(scip, sdsK3[0] + sdsK3[2], costK3) )
1004 if(
SCIPisLE(scip, sdsK3[1] + sdsK3[2], costK3) )
1009 if(
SCIPisLT(scip, sdsK3[0] + sdsK3[1], costK3) )
1012 if(
SCIPisLT(scip, sdsK3[0] + sdsK3[2], costK3) )
1015 if(
SCIPisLT(scip, sdsK3[1] + sdsK3[2], costK3) )
1038 const SCIP_Real costsum = ecost[0] + ecost[1] + ecost[2] + ecost[3];
1048 assert(degree == 4);
1059 mstcost += mst[l].dist;
1061 if(
SCIPisGT(scip, mstcost, costsum) )
1072 for(
int k = 0; k < 4; k++ )
1074 const int auxvertex1 = (k + 1) % 4;
1075 const int auxvertex2 = (k + 2) % 4;
1076 const int auxvertex3 = (k + 3) % 4;
1077 const int edgesK3[] = { edges[auxvertex1], edges[auxvertex2], edges[auxvertex3] };
1082 assert(auxvertex1 != k && auxvertex2 != k && auxvertex3 != k);
1086 if( auxg->
head[e] != k )
1088 assert(sdcount < 2);
1089 sdK3[sdcount++] = auxg->
cost[e];
1093 assert(sdcount == 2);
1097 if( auxg->
head[e] == auxvertex3 )
1099 sdK3[sdcount++] = auxg->
cost[e];
1104 assert(sdcount == 3);
1106 assert(success_debug);
1121 const GRAPH* cliquegraph,
1122 const int* cliqueNodeMap,
1130 const int*
const nodemark = cliquegraph->
mark;
1131 int nnodes_clique = 0;
1137 for(
int i = 0; i < nnodes_cliquegraph; ++i )
1140 cliquenodes[nnodes_clique++] = cliqueNodeMap[i];
1144 for(
int i = nnodes_clique; i < nnodes_cliquegraph; ++i )
1145 cliquenodes[i] = -1;
1151 sdclique->
sds = sds_buffer;
1183 const int*
const nodemark = cliquegraph->
mark;
1188 sds_buffer = sdclique->
sds;
1190 for(
int k1 = 0; k1 < nnodes_cliquegraph; k1++ )
1197 const int k2 = cliquegraph->
head[e];
1206 const int v1 = cliqueNodeMap[k1];
1207 const int v2 = cliqueNodeMap[k2];
1208 assert(0 <= v1 && v1 < g->knots);
1210 assert(0 <= v2 && v2 < g->knots);
1214 assert(
GT(sds_buffer[nsds], 0.0));
1215 assert(
LE(sds_buffer[nsds], cliquegraph->
cost[e]));
1218 if( sds_buffer[nsds] < cliquegraph->
cost[e] )
1220 cliquegraph->
cost[e] = sds_buffer[nsds];
1225 assert(nsds <= cliquegraph->edges / 2);
1239 SD* RESTRICT sddata,
1240 GRAPH* RESTRICT cliquegraph,
1246 const int*
const nodemark = cliquegraph->mark;
1247 const int* cliqueNodeMap = sdclique->cliqueToNodeMap;
1248 SCIP_Real* RESTRICT sds_buffer = sdclique->sds;
1251 assert(cliqueNodeMap && sddata);
1252 assert(2 <= nnodes_clique);
1254 for(
int k1 = 0; k1 < nnodes_clique; k1++ )
1261 v1 = cliqueNodeMap[k1];
1262 assert(0 <= v1 && v1 < g->knots);
1264 for(
int e = cliquegraph->outbeg[k1]; e !=
EAT_LAST; e = cliquegraph->oeat[e] )
1266 const int k2 = cliquegraph->head[e];
1273 const int v2 = cliqueNodeMap[k2];
1274 assert(0 <= v2 && v2 < g->knots);
1277 sds_buffer[nsds] =
sdGetSd(g, v1, v2, maxtreecost, 0.0,
FALSE, sddata);
1278 cliquegraph->cost[e] = sds_buffer[nsds];
1279 cliquegraph->cost[
flipedge(e)] = sds_buffer[nsds];
1282 assert(nsds <= cliquegraph->edges / 2);
1288 for(
int k = nsds; k < cliquegraph->edges / 2; k++ )
1298 const GRAPH* netgraph,
1313 assert(*nelims == 0);
1317 for(
int e = 0; e < nedges / 2; e++ )
1323 assert(mst[0].edge == -1);
1325 for(
int k = 1; k < netnnodes; k++ )
1329 const int e = mst[k].
edge;
1333 cost = netgraph->
cost[e];
1335 if(
SCIPisGT(scip, cost, maxcost) )
1339 blocked[ne / 2] =
TRUE;
1340 for(
int v1 = g->
head[ne]; v1 != vbase[v1]; v1 = g->
tail[vnoi[v1].
edge] )
1343 for(
int v1 = g->
tail[ne]; v1 != vbase[v1]; v1 = g->
tail[vnoi[v1].edge] )
1344 blocked[vnoi[v1].edge / 2] =
TRUE;
1347 for(
int k = 0; k <
nnodes; k++ )
1354 if(
SCIPisGE(scip, g->
cost[e], maxcost) && !blocked[e / 2] )
1356 const int nextedge = g->
oeat[e];
1393 const int* cliqueNodeMap,
1401 assert(scip && g && cliqueNodeMap && dijkdata && sddata && cliquegraph);
1402 assert(cliquegraph->
edges == (cliquegraph->
knots) * (cliquegraph->
knots - 1));
1418 const int* edgestate,
1434 assert(scip && nelims);
1435 assert(*nelims >= 0);
1440 withBlockedNodes =
TRUE;
1441 assert(nodes_isBlocked);
1447 allowEquality =
TRUE;
1448 assert(edges_isBlocked);
1452 edges_isBlocked =
FALSE;
1453 allowEquality =
FALSE;
1456 for(
int k = 0; k <
nnodes; k++ )
1460 if( withBlockedNodes && nodes_isBlocked[k] )
1467 (checkstate && edgestate[e] ==
EDGE_BLOCKED) || (withBlockedNodes && nodes_isBlocked[g->
head[e]]);
1469 if( edgeIsForbidden )
1476 deleteEdge =
SCIPisGE(scip, g->
cost[e], maxcost) && !edges_isBlocked[e / 2];
1482 const int enext = g->
oeat[e];
1500 if( nelims_new > 0 )
1505 *nelims += nelims_new;
1524 PATH* RESTRICT vnoi = redbase->
vnoi;
1525 int* RESTRICT state = redbase->
state;
1526 int* RESTRICT vbase = redbase->
vbase;
1529 int* RESTRICT forbidden = redbase->
edgearrint;
1532 int neighbterms1[4];
1533 int neighbterms2[4];
1534 int* RESTRICT edgepreds;
1545 assert(scip !=
NULL);
1546 assert(vnoi !=
NULL);
1547 assert(state !=
NULL);
1548 assert(vbase !=
NULL);
1549 assert(nelims !=
NULL);
1550 assert(nodesid !=
NULL);
1551 assert(nodesorg !=
NULL);
1552 assert(forbidden !=
NULL);
1555 maxnedges = MIN(nedges, (nterms - 1) * nterms);
1572 for(
int k = 0; k <
nnodes; k++ )
1576 assert(g->
grad[k] > 0);
1589 for(
int k = 0; k < nedges; k++ )
1591 forbidden[k] =
FALSE;
1595 assert(netgraph->
knots == j);
1596 assert(netgraph->
knots == nterms);
1598 for(
int k = 0; k <
nnodes; k++ )
1602 if( g->
grad[k] == 0 )
1610 if( i != vbase[g->
head[e]] )
1613 const int i2 = vbase[g->
head[e]];
1614 const int id2 = nodesid[i2];
1622 if( netgraph->
head[ne] == id2 )
1626 ecost = g->
cost[e] + vnoi[g->
head[e]].dist + vnoi[g->
tail[e]].dist;
1632 assert(netgraph->
tail[ne] == id1);
1633 assert(netgraph->
head[ne] == id2);
1636 if(
GT(netgraph->
cost[ne], ecost) )
1638 netgraph->
cost[ne] = ecost;
1644 assert(ne <= maxnedges);
1649 edgepreds[netgraph->
edges] = e;
1654 assert(netgraph->
edges <= maxnedges);
1675 for(
int k = 1; k < netgraph->
knots; k++ )
1678 assert(mst[k].edge != -1);
1679 assert(edgepreds[mst[k].edge] != -1);
1680 assert(edgepreds[
flipedge(mst[k].edge)] != -1);
1682 e = edgepreds[mst[k].
edge];
1684 assert(vbase[g->
tail[e]] == nodesorg[k] || vbase[g->
head[e]] == nodesorg[k]);
1688 forbidden[e] =
TRUE;
1694 for(
int i = 0; i <
nnodes; i++ )
1697 if( g->
grad[i] == 0 )
1704 neighbterms1[0] = i;
1710 const int e = enext;
1711 const int i2 = g->
head[e];
1714 if( i2 < i || !g->mark[i2] )
1722 nnterms1 =
getlecloseterms(scip, vnoi, termdist1, ecost, vbase, neighbterms1, i, nnodes);
1732 neighbterms2[0] = i2;
1737 nnterms2 =
getlecloseterms(scip, vnoi, termdist2, ecost, vbase, neighbterms2, i2, nnodes);
1743 for( j = 0; j < nnterms1; j++ )
1751 tj = neighbterms1[j];
1755 for(
int k = 0; k < nnterms2; k++ )
1757 const int tk = neighbterms2[k];
1765 if(
GE(termdist1[j], termdist2[k] ) )
1766 dist = termdist1[j];
1768 dist = termdist2[k];
1770 assert(
SCIPisGE(scip, ecost, dist));
1774 if( !usestrongreds )
1777 if( !
sddeltable(scip, g, vnoi, vbase, forbidden, j, k, i, i2, e, nnodes ) )
1789 if(
LT(dist, termdist1[j]) )
1790 dist = termdist1[j];
1792 if(
LT(dist, termdist2[k]) )
1793 dist = termdist2[k];
1799 if( !usestrongreds )
1802 if( !(
sddeltable(scip, g, vnoi, vbase, forbidden, j, k, i, i2, e, nnodes)) )
1806 assert(
SCIPisGE(scip, ecost, termdist1[j]));
1807 assert(
SCIPisGE(scip, ecost, termdist2[k]));
1852 assert(scip && nelims);
1853 assert(*nelims >= 0);
1863 for(
int i = 0; i <
nnodes; i++ )
1875 const int e = enext;
1876 const int i2 = g->
head[e];
1881 if( i2 < i || !g->mark[i2] )
1884 sd =
sdGetSd(g, i, i2, maxmstcost, ecost,
FALSE, sdistance);
1886 deleteEdge =
SCIPisLT(scip, sd, ecost);
1888 if( !deleteEdge &&
SCIPisEQ(scip, sd, ecost) )
1893 if(
EQ(profit1, 0.0) &&
EQ(profit2, 0.0) )
1935 assert(scip && nelims);
1936 assert(sdneighbors);
1937 assert(*nelims >= 0);
1938 assert(nodes_isBlocked);
1964 for(
int i = 0; i <
nnodes; i++ )
1968 if( !g->
mark[i] || nodes_isBlocked[i] )
1976 const int e = enext;
1977 const int i2 = g->
head[e];
1981 if( i2 < i || !g->mark[i2] || nodes_isBlocked[i2] )
1984 sd =
sdGetSd(g, i, i2, maxmstcost, ecost,
FALSE, sdistance);
1986 deleteEdge =
SCIPisLT(scip, sd, ecost);
1991 deleteEdge =
SCIPisLT(scip, sd, ecost);
2033 int neighbterms1[4];
2034 int neighbterms2[4];
2038 const int root = g->
source;
2041 const int nedges = g->
edges;
2044 assert(heap !=
NULL);
2045 assert(vnoi !=
NULL);
2046 assert(state !=
NULL);
2047 assert(vbase !=
NULL);
2048 assert(scip !=
NULL);
2049 assert(nelims !=
NULL);
2050 assert(nodesid !=
NULL);
2051 assert(nodesorg !=
NULL);
2065 if( longedges <= longtermsq )
2068 maxnedges = ((nterms - 1) * nterms);
2081 for(
int k = 0; k < 4; k++ )
2088 for(
int k = 0; k <
nnodes; k++ )
2102 assert(netgraph->
knots == j);
2103 assert(netgraph->
knots == nterms);
2106 for(
int k = 0; k <
nnodes; k++ )
2118 if( i != vbase[g->
head[e]] )
2122 const int i2 = vbase[g->
head[e]];
2127 assert(nodesid[i] >= 0);
2128 assert(nodesid[i2] >= 0);
2131 if( netgraph->
head[ne] == nodesid[i2] )
2140 assert(netgraph->
head[ne] == nodesid[i2]);
2141 assert(netgraph->
tail[ne] == nodesid[i]);
2145 netgraph->
cost[ne] = ecost;
2147 assert(ne <= maxnedges);
2152 graph_edge_add(scip, netgraph, nodesid[i], nodesid[i2], ecost, ecost);
2153 assert(netgraph->
edges <= maxnedges);
2163 for(
int i = 0; i <
nnodes; i++ )
2176 const int i2 = g->
head[e];
2186 nnterms1 =
getcloseterms2term(scip, g, netgraph, termdist1, ecost, neighbterms1, nodesid, nodesorg, i);
2188 nnterms1 =
getcloseterms(scip, vnoi, termdist1, ecost, vbase, neighbterms1, i, nnodes);
2193 nnterms1 =
getcloseterms(scip, vnoi, termdist1, ecost, vbase, neighbterms1, i, nnodes);
2202 nnterms2 =
getcloseterms2term(scip, g, netgraph, termdist2, ecost, neighbterms2, nodesid, nodesorg, i2);
2204 nnterms2 =
getcloseterms(scip, vnoi, termdist2, ecost, vbase, neighbterms2, i2, nnodes);
2209 nnterms2 =
getcloseterms(scip, vnoi, termdist2, ecost, vbase, neighbterms2, i2, nnodes);
2216 for( j = 0; j < nnterms1; j++ )
2224 tj = neighbterms1[j];
2229 for(
int k = 0; k < nnterms2; k++ )
2231 const int tk = neighbterms2[k];
2238 if(
SCIPisGT(scip, ecost, termdist1[j] + termdist2[k] - g->
prize[tj]) || tj == root )
2254 if( netgraph->
head[e2] == nodesid[tk] )
2256 necost = netgraph->
cost[e2];
2261 for(
int l = 0; l < 4; l++ )
2265 if( vbase[pos] == tk &&
SCIPisLT(scip, vnoi[pos].dist, necost) )
2267 necost = vnoi[pos].
dist;
2274 &&
SCIPisGT(scip, ecost, necost + termdist1[j] - g->
prize[tj])
2275 &&
SCIPisGT(scip, ecost, necost + termdist2[k] - g->
prize[tk])
2276 &&
SCIPisGT(scip, ecost, necost + termdist1[j] + termdist2[k] - g->
prize[tj] - g->
prize[tk]) )
2329 assert(scip !=
NULL);
2330 assert(pathtail !=
NULL);
2331 assert(pathhead !=
NULL);
2332 assert(heap !=
NULL);
2333 assert(statetail !=
NULL);
2334 assert(statehead !=
NULL);
2335 assert(memlbltail !=
NULL);
2336 assert(memlblhead !=
NULL);
2337 assert(sdist !=
NULL);
2342 graph_sdPaths(g, pathtail, g->
cost, distlimit, heap, statetail, memlbltail, &nlbltail, i, i2, limit);
2345 graph_sdPaths(g, pathhead, g->
cost, distlimit, heap, statehead, memlblhead, &nlblhead, i2, i, limit);
2350 for( k = 0; k < nlbltail; k++ )
2353 assert(statetail[l] !=
UNKNOWN);
2361 if(
SCIPisLT(scip, dist, pathhead[l].dist) )
2362 dist = pathhead[l].
dist;
2363 if(
SCIPisLT(scip, dist, pathtail[l].dist) )
2364 dist = pathtail[l].
dist;
2365 if( pcmw &&
SCIPisLT(scip, dist, pathhead[l].dist + pathtail[l].dist - g->
prize[l]) )
2372 if( mw && l != i && l != i2 )
2377 dist = pathhead[l].
dist + pathtail[l].
dist;
2388 for( k = 0; k < nlblhead; k++ )
2397 for( k = 0; k <
nnodes; k++ )
2399 assert(statetail[k] ==
UNKNOWN);
2400 assert(pathtail[k].dist ==
FARAWAY);
2401 assert(pathtail[k].edge ==
UNKNOWN);
2402 assert(statehead[k] ==
UNKNOWN);
2403 assert(pathhead[k].dist ==
FARAWAY);
2404 assert(pathhead[k].edge ==
UNKNOWN);
2412 if( g->
head[e] == i2 )
2437 assert(g && sddata);
2439 return sdGetSd(g, i, i2, sd_upper, sd_sufficient,
FALSE, sddata);
2453 assert(g && sddata);
2455 return sdGetSd(g, i, i2, sd_upper, sd_sufficient,
TRUE, sddata);
2473 int *heap = sd1pc->
heap;
2488 assert(scip !=
NULL);
2489 assert(pathtail !=
NULL);
2490 assert(pathhead !=
NULL);
2491 assert(heap !=
NULL);
2492 assert(statetail !=
NULL);
2493 assert(statehead !=
NULL);
2494 assert(memlbltail !=
NULL);
2495 assert(memlblhead !=
NULL);
2496 assert(pathmaxnodetail !=
NULL);
2497 assert(pathmaxnodehead !=
NULL);
2499 graph_path_PcMwSd(scip, g, pathtail, g->
cost, distlimit, pathmaxnodetail, heap, statetail,
NULL, memlbltail, &nlbltail, i, i2, edgelimit);
2500 graph_path_PcMwSd(scip, g, pathhead, g->
cost, distlimit, pathmaxnodehead, heap, statehead, statetail, memlblhead, &nlblhead, i2, i, edgelimit);
2505 for(
int k = 0; k < nlbltail; k++ )
2507 const int l = memlbltail[k];
2508 assert(statetail[l] !=
UNKNOWN);
2513 const int tailmaxterm = pathmaxnodetail[l];
2514 const int headmaxterm = pathmaxnodehead[l];
2518 assert(tailmaxterm != i && headmaxterm != i);
2519 assert(tailmaxterm != i2 && headmaxterm != i2);
2522 if( tailmaxterm >= 0 || headmaxterm >= 0 )
2524 if( tailmaxterm == headmaxterm )
2526 assert(tailmaxterm == l);
2530 pathhead[headmaxterm].
dist,
2531 pathtail[tailmaxterm].
dist,
2536 else if( tailmaxterm >= 0 && headmaxterm >= 0 )
2541 assert(tailmaxterm != headmaxterm);
2547 pathhead[headmaxterm].
dist,
2548 pathtail[tailmaxterm].
dist,
2549 distl2tailmax + distl2headmax,
2550 distl2tailmax + pathhead[l].
dist - g->
prize[headmaxterm],
2551 distl2headmax + pathtail[l].
dist - g->
prize[tailmaxterm],
2556 else if( tailmaxterm >= 0 )
2560 assert(headmaxterm < 0);
2564 pathtail[tailmaxterm].
dist,
2565 distl2tailmax + pathhead[l].
dist,
2570 else if( headmaxterm >= 0 )
2574 assert(tailmaxterm < 0);
2578 pathhead[headmaxterm].
dist,
2579 distl2headmax + pathtail[l].
dist,
2587 dist = pathhead[l].
dist + pathtail[l].
dist;
2608 for(
int k = 0; k < nlbltail; k++ )
2610 const int l = memlbltail[k];
2614 pathmaxnodetail[l] = -1;
2617 for(
int k = 0; k < nlblhead; k++ )
2619 const int l = memlblhead[k];
2623 pathmaxnodehead[l] = -1;
2626 for(
int k = 0; k <
nnodes; k++ )
2628 assert(statetail[k] ==
UNKNOWN);
2629 assert(pathtail[k].dist ==
FARAWAY);
2630 assert(pathtail[k].edge ==
UNKNOWN);
2631 assert(statehead[k] ==
UNKNOWN);
2632 assert(pathhead[k].dist ==
FARAWAY);
2633 assert(pathhead[k].edge ==
UNKNOWN);
2634 assert(pathmaxnodehead[k] == -1);
2635 assert(pathmaxnodetail[k] == -1);
2639 for(
int e = g->
outbeg[i], count = 0; (count++ <= edgelimit) && (e !=
EAT_LAST); e = g->
oeat[e] )
2641 if( g->
head[e] == i2 )
2645 else if( sd > g->
cost[e] )
2684 assert(scip !=
NULL);
2685 assert(pathtail !=
NULL);
2686 assert(pathhead !=
NULL);
2687 assert(heap !=
NULL);
2688 assert(statetail !=
NULL);
2689 assert(statehead !=
NULL);
2690 assert(memlbltail !=
NULL);
2691 assert(memlblhead !=
NULL);
2692 assert(nelims !=
NULL);
2698 for( i = 0; i <
nnodes; i++ )
2711 for( e = 0; e < nedges; e++ )
2715 for( i = 0; i <
nnodes; i++ )
2726 assert(g->
mark[i2]);
2729 graph_sdPaths(g, pathtail, g->
cost, g->
cost[e], heap, statetail, memlbltail, &nlbltail, i, i2, limit);
2732 graph_sdPaths(g, pathhead, costrev, g->
cost[e], heap, statehead, memlblhead, &nlblhead, i2, i, limit);
2735 #ifdef SCIP_DISABLED 2736 if( statetail[i2] !=
UNKNOWN )
2738 sdist = pathtail[i2].
dist;
2741 if( statehead[i] !=
UNKNOWN &&
SCIPisGT(scip, sdist, pathhead[i].dist) )
2743 sdist = pathhead[i].
dist;
2748 for( k = 0; k < nlbltail; k++ )
2752 assert(statetail[l] !=
UNKNOWN);
2758 if(
SCIPisGT(scip, sdist, pathhead[l].dist + pathtail[l].dist) )
2759 sdist = pathhead[l].
dist + pathtail[l].
dist;
2767 for( k = 0; k < nlblhead; k++ )
2797 for( k = 0; k <
nnodes; k++ )
2799 assert(statetail[k] ==
UNKNOWN);
2800 assert(pathtail[k].dist ==
FARAWAY);
2801 assert(pathtail[k].edge ==
UNKNOWN);
2802 assert(statehead[k] ==
UNKNOWN);
2803 assert(pathhead[k].dist ==
FARAWAY);
2804 assert(pathhead[k].edge ==
UNKNOWN);
2816 const int* edgestate,
2833 const int nedges = g->
edges;
2836 assert(g && scip && nelims && visited && visitlist && dheap);
2840 if( edgelimit <= 0 )
2843 for(
int i = 0; i <
nnodes; i++ )
2853 range_csr = dcsr->
range;
2854 head_csr = dcsr->
head;
2855 edgeid_csr = dcsr->
edgeid;
2856 cost_csr = dcsr->
cost;
2860 for(
int e = 0; e < nedges / 2; e++ )
2861 edge_deletable[e] =
FALSE;
2863 assert(dcsr && range_csr && edgeid_csr && cost_csr);
2867 for(
int i = 0; i <
nnodes; i++ )
2870 const int start = range_csr[i].
start;
2873 if( range_csr[i].end - start <= 1 )
2877 for(
int e = start; e < range_csr[i].
end; e = enext )
2882 const int i2 = head_csr[e];
2890 const int orgedge = edgeid_csr[e];
2895 success =
graph_sdWalks_csr(scip, g, termmark, ecost, i, i2, edgelimit, dist, visitlist, &nvisits, dheap, visited);
2901 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
2907 if( range_csr[i].end - start <= 1 )
2914 for(
int e = 0; e < nedges / 2; e++ )
2916 if( edge_deletable[e] )
2945 SDCLIQUE cliquedata = { .
dijkdata =
NULL, .cliquenodes = cliquenodes, .ncliquenodes = 2, .sds = &sds };
2957 for(
int i = 0; i <
nnodes; i++ )
2966 const int e = enext;
2967 const int i2 = g->
head[e];
2972 if( i2 < i || !g->mark[i2] )
2977 cliquenodes[1] = i2;
2986 printf(
"SD biased deletes (sd=%f): ", sds);
3031 const int nedges = g->
edges;
3033 assert(g && scip && nelims && visited && visitlist && dheap);
3037 if( edgelimit <= 0 )
3044 range_csr = dcsr->
range;
3045 head_csr = dcsr->
head;
3046 edgeid_csr = dcsr->
edgeid;
3047 cost_csr = dcsr->
cost;
3056 for(
int i = 0; i <
nnodes; i++ )
3059 visited2[i] =
FALSE;
3065 for(
int e = 0; e < nedges / 2; e++ )
3066 edge_deletable[e] =
FALSE;
3068 assert(dcsr && range_csr && edgeid_csr && cost_csr);
3073 for(
int i = 0; i <
nnodes; i++ )
3076 const int start = range_csr[i].
start;
3079 if( range_csr[i].end - start <= 1 )
3083 for(
int e = start; e < range_csr[i].
end; e = enext )
3088 const int i2 = head_csr[e];
3098 success =
graph_sdWalksTriangle(scip, g, termmark,
NULL, ecost, i, i2, edgelimit,
NULL, dist, visitlist, &nvisits, dheap, visited);
3104 int*
const state = dheap->
position;
3110 for(
int k = 0; k <
nnodes; k++ )
3115 success =
graph_sdWalksTriangle(scip, g, termmark, state, ecost, i2, i, edgelimit, prizeoffset, dist2, visitlist2, &nvisits2, dheap, visited2);
3120 assert(nvisits2 > 0 && visitlist2[0] == i2);
3123 for(
int k = 1; k < nvisits2; k++ )
3125 const int node = visitlist2[k];
3128 assert(visited2[node]);
3129 assert(node != i && node != i2);
3131 if( !visited[node] )
3134 dist_combined = dist[node] + dist2[node];
3135 assert(dist_combined <
FARAWAY);
3137 if( termmark[node] != 0 )
3139 dist_combined += prizeoffset[node];
3140 assert(prizeoffset[node] >= 0.0);
3143 if(
SCIPisLE(scip, dist_combined, ecost) )
3152 sdwalkReset(nnodes, nvisits2, visitlist2, dist2, state2, visited2);
3160 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
3166 if( range_csr[i].end - start <= 1 )
3173 for(
int e = 0; e < nedges / 2; e++ )
3175 if( edge_deletable[e] )
3216 const int nedges = g->
edges;
3218 assert(g && scip && nelims && visited && visitlist && dheap && star_base);
3221 if( edgelimit <= 0 )
3228 range_csr = dcsr->
range;
3229 head_csr = dcsr->
head;
3230 edgeid_csr = dcsr->
edgeid;
3234 for(
int e = 0; e < nedges / 2; e++ )
3235 edge_deletable[e] =
FALSE;
3237 assert(dcsr && range_csr && edgeid_csr);
3239 for(
int i = 0; i <
nnodes; i++ )
3246 for(
int i = 0; i <
nnodes; i++ )
3262 const int start = range_csr[i].
start;
3264 if( range_csr[i].end - start <= 1 )
3270 graph_sdStar(scip, g,
FALSE, i, edgelimit, star_base, dist, visitlist, &nvisits, dheap, visited, &success);
3277 for(
int e = start; e < range_csr[i].
end; e = enext )
3279 const int starnode = head_csr[e];
3280 const int starbase = star_base[starnode];
3281 assert(star_base[starnode] >= 0);
3283 assert(star_base[starnode] == starnode || star_base[starnode] >= 0);
3288 if( starnode != starbase )
3293 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
3302 sdStarReset(nnodes, nvisits, visitlist, star_base, dist, visited, dheap);
3307 for(
int e = 0; e < nedges / 2; e++ )
3309 if( edge_deletable[e] )
3337 assert(scip && nelims);
3359 int* RESTRICT star_base;
3363 assert(scip && nelims);
3364 assert(edgelimit > 0);
3370 for(
int i = 0; i <
nnodes; i++ )
3410 const int nedges = g->
edges;
3412 assert(g && scip && nelims && visited && visitlist && dheap && star_base);
3415 if( edgelimit <= 0 )
3423 range_csr = dcsr->
range;
3424 head_csr = dcsr->
head;
3425 edgeid_csr = dcsr->
edgeid;
3426 cost_dcsr_org = dcsr->
cost;
3431 for(
int e = 0; e < nedges / 2; e++ )
3432 edge_deletable[e] =
FALSE;
3434 assert(dcsr && range_csr && edgeid_csr);
3438 dcsr->
cost = cost_dcsr_biased;
3440 for(
int i = 0; i <
nnodes; i++ )
3447 for(
int i = 0; i <
nnodes; i++ )
3463 const int start = range_csr[i].
start;
3465 if( range_csr[i].end - start <= 1 )
3471 graph_sdStar(scip, g,
TRUE, i, 2 * edgelimit, star_base, dist, visitlist, &nvisits, dheap, visited, &success);
3478 for(
int e = start; e < range_csr[i].
end; e = enext )
3480 const int starnode = head_csr[e];
3481 const int starbase = star_base[starnode];
3482 assert(star_base[starnode] >= 0);
3484 assert(star_base[starnode] == starnode || star_base[starnode] >= 0);
3489 if( starnode != starbase )
3493 if( !usestrongreds &&
EQ(dist[starnode], dcsr->
cost[e]) )
3497 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
3499 dcsr->
cost = cost_dcsr_org;
3500 dcsr->
cost2 = cost_dcsr_biased;
3502 dcsr->
cost = cost_dcsr_biased;
3511 sdStarReset(nnodes, nvisits, visitlist, star_base, dist, visited, dheap);
3516 for(
int e = 0; e < nedges / 2; e++ )
3518 if( edge_deletable[e] )
3527 dcsr->
cost = cost_dcsr_org;
3544 const int* edgestate,
3564 const int nedges = g->
edges;
3567 assert(g && scip && nelims && visited && visitlist && dheap && star_base);
3570 if( edgelimit <= 0 )
3577 range_csr = dcsr->
range;
3578 head_csr = dcsr->
head;
3579 edgeid_csr = dcsr->
edgeid;
3580 cost_csr = dcsr->
cost;
3582 assert(dcsr && range_csr && edgeid_csr && cost_csr);
3589 for(
int e = 0; e < nedges / 2; e++ )
3590 edge_deletable[e] =
FALSE;
3595 for(
int i = 0; i <
nnodes; i++ )
3603 for(
int i = 0; i <
nnodes; i++ )
3619 const int start = range_csr[i].
start;
3621 if( range_csr[i].end - start <= 1 )
3628 dcsr->
cost = costbiased_out;
3629 graph_sdStar(scip, g,
TRUE, i, edgelimit, star_base, dist, visitlist, &nvisits, dheap, visited, &success);
3633 for(
int e = start; e < range_csr[i].
end; e++ )
3634 star_base_out[head_csr[e]] = star_base[head_csr[e]];
3637 sdStarReset(nnodes, nvisits, visitlist, star_base, dist, visited, dheap);
3641 dcsr->
cost = costbiased_in;
3642 graph_sdStar(scip, g,
TRUE, i, edgelimit, star_base, dist, visitlist, &nvisits, dheap, visited, &success);
3647 int*
const star_base_in = star_base;
3650 dcsr->
cost = cost_csr;
3651 dcsr->
cost2 = costbiased_in;
3652 dcsr->
cost3 = costbiased_out;
3655 for(
int e = start; e < range_csr[i].
end; e = enext )
3657 const int starnode = head_csr[e];
3658 const int starbase_in = star_base_in[starnode];
3659 const int starbase_out = star_base_out[starnode];
3661 assert(starbase_in >= 0 && starbase_out >= 0);
3663 assert(
SCIPisLE(scip, dist[starnode], costbiased_in[e]));
3669 const int orgedge = edgeid_csr[e];
3675 if( starnode != starbase_in && starnode != starbase_out )
3686 edge_deletable[edgeid_csr[e] / 2] =
TRUE;
3701 for(
int k = 0; k < nvisits; k++ )
3704 sdStarReset(nnodes, nvisits, visitlist, star_base, dist, visited, dheap);
3707 for(
int k = 0; k <
nnodes; k++ )
3714 for(
int e = 0; e < nedges / 2; e++ )
3716 if( edge_deletable[e] )
3730 dcsr->
cost = cost_csr;
3741 const int* edgestate,
3756 assert(scip !=
NULL);
3757 assert(heap !=
NULL);
3758 assert(nelims !=
NULL);
3759 assert(visited !=
NULL);
3760 assert(visitlist !=
NULL);
3764 if( edgelimit <= 0 )
3767 for(
int i = 0; i <
nnodes; i++ )
3776 for(
int i = 0; i <
nnodes; i++ )
3789 const int i2 = g->
head[e];
3790 const int enext = g->
oeat[e];
3804 success =
graph_sdWalks(scip, g, g->
cost, termmark, ecost, i2, i, edgelimit, dist, heap, state, visitlist, &nvisits, visited);
3805 sdwalkReset(nnodes, nvisits, visitlist, dist, state, visited);
3840 assert(scip !=
NULL);
3841 assert(heap !=
NULL);
3842 assert(nelims !=
NULL);
3843 assert(visited !=
NULL);
3844 assert(visitlist !=
NULL);
3848 if( edgelimit <= 0 )
3854 for(
int i = 0; i <
nnodes; i++ )
3862 for(
int i = 0; i <
nnodes; i++ )
3875 const int i2 = g->
head[e];
3876 const int enext = g->
oeat[e];
3885 success =
graph_sdWalksExt(scip, g, g->
cost, ecost, i2, i, edgelimit, STP_SDWALK_MAXNPREVS, dist, prevterms, nprevterms, heap, state, visitlist, &nvisits, visited);
3886 sdwalkResetExt(nnodes, nvisits, visitlist, dist, nprevterms, state, visited);
3908 const int* edgestate,
3929 assert(scip !=
NULL);
3930 assert(heap !=
NULL);
3931 assert(nelims !=
NULL);
3932 assert(visited !=
NULL);
3933 assert(visitlist !=
NULL);
3937 if( edgelimit <= 0 )
3940 assert(0 &&
"triggers bug in STP-DIMACS/PCSPG-hand/HAND_SMALL_ICERM/handsi04.stp");
3949 for(
int i = 0; i <
nnodes; i++ )
3955 nprevNPterms[i] = 0;
3961 for(
int i = 0; i <
nnodes; i++ )
3974 const int i2 = g->
head[e];
3975 const int enext = g->
oeat[e];
3990 success =
graph_sdWalksExt2(scip, g, g->
cost, termmark, ecost, i2, i, edgelimit, STP_SDWALK_MAXNPREVS, dist, prevterms, nprevterms,
3991 prevNPterms, nprevNPterms, prevedges, nprevedges, heap, state, visitlist, &nvisits, visited);
3992 sdwalkResetExt2(nnodes, nvisits, visitlist, dist, nprevterms, nprevNPterms, nprevedges, state, visited);
4030 int* pathmaxnodetail =
NULL;
4031 int* pathmaxnodehead =
NULL;
4035 assert(scip !=
NULL);
4036 assert(pathtail !=
NULL);
4037 assert(heap !=
NULL);
4038 assert(statetail !=
NULL);
4039 assert(statehead !=
NULL);
4040 assert(memlbltail !=
NULL);
4041 assert(memlblhead !=
NULL);
4042 assert(nelims !=
NULL);
4057 for(
int i = 0; i <
nnodes; i++ )
4059 pathmaxnodetail[i] = -1;
4060 pathmaxnodehead[i] = -1;
4065 for(
int i = 0; i <
nnodes; i++ )
4069 for(
int i = 0; i <
nnodes; i++ )
4080 for(
int i = 0; i <
nnodes; i++ )
4091 const int i2 = g->
head[e];
4092 const int enext = g->
oeat[e];
4098 if( i2 < i || !g->mark[i2] )
4108 graph_path_PcMwSd(scip, g, pathtail, g->
cost, ecost, pathmaxnodetail, heap, statetail,
NULL, memlbltail, &nlbltail, i, i2, limit);
4109 graph_path_PcMwSd(scip, g, pathhead, g->
cost, ecost, pathmaxnodehead, heap, statehead, statetail, memlblhead, &nlblhead, i2, i, limit);
4113 graph_sdPaths(g, pathtail, g->
cost, ecost, heap, statetail, memlbltail, &nlbltail, i, i2, limit);
4114 graph_sdPaths(g, pathhead, g->
cost, ecost, heap, statehead, memlblhead, &nlblhead, i2, i, limit);
4120 for(
int k = 0; k < nlbltail && !deletable; k++ )
4122 const int l = memlbltail[k];
4125 assert(statetail[l] !=
UNKNOWN);
4134 const int tailmaxterm = pathmaxnodetail[l];
4135 const int headmaxterm = pathmaxnodehead[l];
4137 assert(tailmaxterm != i && headmaxterm != i);
4138 assert(tailmaxterm != i2 && headmaxterm != i2);
4141 if( tailmaxterm >= 0 || headmaxterm >= 0 )
4143 if( tailmaxterm == headmaxterm )
4145 assert(tailmaxterm == l);
4147 assert(
SCIPisGE(scip, ecost, pathhead[headmaxterm].dist) &&
SCIPisGE(scip, ecost, pathtail[tailmaxterm].dist));
4149 if(
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist - g->
prize[l]) )
4155 else if( tailmaxterm >= 0 && headmaxterm >= 0 )
4160 assert(tailmaxterm != headmaxterm);
4164 assert(
SCIPisGE(scip, ecost, pathhead[headmaxterm].dist) &&
SCIPisGE(scip, ecost, pathtail[tailmaxterm].dist));
4166 if(
SCIPisGE(scip, ecost, distl2tailmax + distl2headmax)
4167 &&
SCIPisGE(scip, ecost, distl2tailmax + pathhead[l].dist - g->
prize[headmaxterm])
4168 &&
SCIPisGE(scip, ecost, distl2headmax + pathtail[l].dist - g->
prize[tailmaxterm])
4169 &&
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist - g->
prize[tailmaxterm] - g->
prize[headmaxterm]) )
4175 else if( tailmaxterm >= 0 )
4179 assert(headmaxterm < 0);
4180 assert(
SCIPisGE(scip, ecost, pathtail[tailmaxterm].dist));
4183 if(
SCIPisGE(scip, ecost, distl2tailmax + pathhead[l].dist)
4184 &&
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist - g->
prize[tailmaxterm]) )
4190 else if( headmaxterm >= 0 )
4194 assert(tailmaxterm < 0);
4195 assert(
SCIPisGE(scip, ecost, pathhead[headmaxterm].dist));
4198 if(
SCIPisGE(scip, ecost, distl2headmax + pathtail[l].dist)
4199 &&
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist - g->
prize[headmaxterm]) )
4206 else if(
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist) )
4213 if(
SCIPisGE(scip, ecost, pathhead[l].dist) &&
SCIPisGE(scip, ecost, pathtail[l].dist)
4214 &&
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist - g->
prize[l]) )
4222 if(
SCIPisGE(scip, ecost, pathhead[l].dist) &&
SCIPisGE(scip, ecost, pathtail[l].dist) )
4226 if( !usestrongreds &&
SCIPisEQ(scip, ecost, pathhead[l].dist) &&
SCIPisEQ(scip, ecost, pathtail[l].dist) )
4232 if(
SCIPisGE(scip, ecost, pathhead[l].dist + pathtail[l].dist) )
4236 if( !usestrongreds &&
SCIPisEQ(scip, ecost, pathhead[l].dist + pathtail[l].dist) )
4246 for(
int k = 0; k < nlbltail; k++ )
4248 const int l = memlbltail[k];
4253 pathmaxnodetail[l] = -1;
4256 for(
int k = 0; k < nlblhead; k++ )
4258 const int l = memlblhead[k];
4263 pathmaxnodehead[l] = -1;
4267 for(
int k = 0; k <
nnodes; k++ )
4269 assert(statetail[k] ==
UNKNOWN);
4270 assert(pathtail[k].dist ==
FARAWAY);
4271 assert(pathtail[k].edge ==
UNKNOWN);
4272 assert(statehead[k] ==
UNKNOWN);
4273 assert(pathhead[k].dist ==
FARAWAY);
4274 assert(pathhead[k].edge ==
UNKNOWN);
4277 assert(pathmaxnodetail[k] == -1);
4278 assert(pathmaxnodehead[k] == -1);
4323 assert(scip && g && vnoi);
4345 for(
int i = 0; i <
nnodes; i++ )
4357 ecost[k] = g->
cost[e];
4358 adjvert[k++] = g->
head[e];
4360 assert(k == degree);
4368 const SCIP_Real costsum = ecost[0] + ecost[1] + ecost[2];
4370 sd[0] =
getSd(scip, g, sdgraph, vnoi, ecost[0] + ecost[1], vbase, adjvert[0], adjvert[1], 300);
4371 sd[1] =
getSd(scip, g, sdgraph, vnoi, ecost[1] + ecost[2], vbase, adjvert[1], adjvert[2], 300);
4372 sd[2] =
getSd(scip, g, sdgraph, vnoi, ecost[2] + ecost[0], vbase, adjvert[2], adjvert[0], 300);
4385 assert(g->
grad[i] == 0);
4387 SCIPdebugMessage(
"BD3-R Reduction: %f %f %f csum: %f\n ", sd[0], sd[1], sd[2], costsum);
4392 else if( degree == 4 )
4399 adjsds[0] =
getSd(scip, g, sdgraph, vnoi, ecost[0] + ecost[1], vbase, adjvert[0], adjvert[1], 200);
4400 adjsds[1] =
getSd(scip, g, sdgraph, vnoi, ecost[0] + ecost[2], vbase, adjvert[0], adjvert[2], 200);
4401 adjsds[3] =
getSd(scip, g, sdgraph, vnoi, ecost[1] + ecost[2], vbase, adjvert[1], adjvert[2], 200);
4404 (
int[3]){ edges[0], edges[1], edges[2]},
4405 ecost[0] + ecost[1] + ecost[2],
TRUE) )
4410 adjsds[2] =
getSd(scip, g, sdgraph, vnoi, ecost[0] + ecost[3], vbase, adjvert[0], adjvert[3], 200);
4411 adjsds[4] =
getSd(scip, g, sdgraph, vnoi, ecost[1] + ecost[3], vbase, adjvert[1], adjvert[3], 200);
4414 (
int[3]){ edges[0], edges[1], edges[3]},
4415 ecost[0] + ecost[1] + ecost[3],
TRUE) )
4420 adjsds[5] =
getSd(scip, g, sdgraph, vnoi, ecost[2] + ecost[3], vbase, adjvert[2], adjvert[3], 200);
4423 (
int[3]){ edges[0], edges[2], edges[3]},
4424 ecost[0] + ecost[2] + ecost[3],
TRUE) )
4430 (
int[3]){ edges[1], edges[2], edges[3]},
4431 ecost[1] + ecost[2] + ecost[3],
TRUE) )
4436 for(
int k = 0; k < 4; k++ )
4439 for(
int k = 0; k < 3; k++ )
4443 const int k2 = auxg->
head[e];
4447 auxg->
cost[e] = adjsds[k2 - 1];
4449 auxg->
cost[e] = adjsds[k + k2];
4451 assert(
EQ(auxg->
cost[e],
getSd(scip, g, sdgraph, vnoi, ecost[k] + ecost[k2], vbase,
4452 adjvert[k], adjvert[k2], 200)));
4464 for(
int k = 0; k < 3; k++ )
4468 const int k2 = auxg->
head[e];
4470 cutoffs[edgecount++] = auxg->
cost[e];
4494 *nelims += nnewelims;
4531 int* pathmaxnodetail =
NULL;
4532 int* pathmaxnodehead =
NULL;
4535 const int limit4 = limit / 3;
4539 assert(scip && g && heap && nelims);
4542 assert(limit > 0 && limit4 > 0);
4556 for(
int i = 0; i <
nnodes; i++ )
4565 pathmaxnodetail[i] = -1;
4566 pathmaxnodehead[i] = -1;
4569 sd1pc = (
SD1PC) { .
pathtail = pathtail, .pathhead = pathhead, .heap = heap,
4570 .statetail = statetail, .statehead = statehead, .memlbltail = memlbltail,
4571 .memlblhead = memlblhead, .pathmaxnodetail = pathmaxnodetail, .pathmaxnodehead = pathmaxnodehead };
4575 for(
int i = 0; i <
nnodes; i++ )
4590 if( pcdegree != degree )
4598 const int head = g->
head[e];
4602 edges[edgecount] = e;
4603 ecost[edgecount] = g->
cost[e];
4604 adjvert[edgecount++] = g->
head[e];
4612 assert(edgecount == degree);
4619 const SCIP_Real csum = ecost[0] + ecost[1] + ecost[2] - iprize;
4621 assert(edgecount == 3);
4622 assert(iprize <= ecost[0] && iprize <= ecost[1] && iprize <= ecost[2]);
4624 sd[0] =
sdGetSdPcMw(scip, g, ecost[0] + ecost[1], adjvert[0], adjvert[1], limit, &sd1pc);
4625 sd[1] =
sdGetSdPcMw(scip, g, ecost[1] + ecost[2], adjvert[1], adjvert[2], limit, &sd1pc);
4626 sd[2] =
sdGetSdPcMw(scip, g, ecost[2] + ecost[0], adjvert[2], adjvert[0], limit, &sd1pc);
4638 assert(offset !=
NULL);
4641 *offset += g->
prize[i];
4646 assert(g->
grad[i] == 0);
4648 SCIPdebugMessage(
"BD3 Reduction: %f %f %f csum: %f\n ", sd[0], sd[1], sd[2], csum);
4659 adjsds[0] =
sdGetSdPcMw(scip, g, ecost[0] + ecost[1], adjvert[0], adjvert[1], limit4, &sd1pc);
4660 adjsds[1] =
sdGetSdPcMw(scip, g, ecost[0] + ecost[2], adjvert[0], adjvert[2], limit4, &sd1pc);
4661 adjsds[3] =
sdGetSdPcMw(scip, g, ecost[1] + ecost[2], adjvert[1], adjvert[2], limit4, &sd1pc);
4664 (
int[3]){ edges[0], edges[1], edges[2]},
4665 ecost[0] + ecost[1] + ecost[2],
TRUE) )
4670 adjsds[2] =
sdGetSdPcMw(scip, g, ecost[0] + ecost[3], adjvert[0], adjvert[3], limit4, &sd1pc);
4671 adjsds[4] =
sdGetSdPcMw(scip, g, ecost[1] + ecost[3], adjvert[1], adjvert[3], limit4, &sd1pc);
4674 (
int[3]){ edges[0], edges[1], edges[3]},
4675 ecost[0] + ecost[1] + ecost[3],
TRUE) )
4680 adjsds[5] =
sdGetSdPcMw(scip, g, ecost[2] + ecost[3], adjvert[2], adjvert[3], limit4, &sd1pc);
4683 (
int[3]){ edges[0], edges[2], edges[3]},
4684 ecost[0] + ecost[2] + ecost[3],
TRUE) )
4690 (
int[3]){ edges[1], edges[2], edges[3]},
4691 ecost[1] + ecost[2] + ecost[3],
TRUE) )
4696 for(
int k = 0; k < 4; k++ )
4699 for(
int k = 0; k < 3; k++ )
4703 const int k2 = auxg->
head[e];
4707 auxg->
cost[e] = adjsds[k2 - 1];
4709 auxg->
cost[e] = adjsds[k + k2];
4711 assert(
EQ(auxg->
cost[e],
sdGetSdPcMw(scip, g, ecost[k] + ecost[k2], adjvert[k], adjvert[k2], limit4, &sd1pc)));
4723 for(
int k = 0; k < 3; k++ )
4727 const int k2 = auxg->
head[e];
4729 cutoffs[edgecount++] = auxg->
cost[e];
int graph_get_nEdges(const GRAPH *)
void graph_knot_chg(GRAPH *, int, int)
static volatile int nterms
int graph_pc_realDegree(const GRAPH *, int, SCIP_Bool)
#define SDSTAR_BASE_KILLED
void graph_edge_del(SCIP *, GRAPH *, int, SCIP_Bool)
SCIP_Bool graph_sdWalksExt(SCIP *, const GRAPH *, const SCIP_Real *, SCIP_Real, int, int, int, int, SCIP_Real *, int *, int *, int *, int *, int *, int *, STP_Bool *)
SCIP_Bool graph_sdWalks_csr(SCIP *, const GRAPH *, const int *, SCIP_Real, int, int, int, SCIP_Real *, int *, int *, DHEAP *, STP_Bool *)
SCIP_Bool graph_valid(SCIP *, const GRAPH *)
static SCIP_Bool sddeltable(SCIP *scip, GRAPH *g, PATH *path, int *vbase, int *forbidden, int tpos, int hpos, int tail, int head, int edge, int nnodes)
static SCIP_Bool isPseudoDeletable(SCIP *scip, const GRAPH *g, const GRAPH *auxg, const SCIP_Real *ecost, const int *edges, int degree)
static void sdwalkResetExt(int nnodes, int nvisits, const int *visitlist, SCIP_Real *RESTRICT dist, int *RESTRICT nprevterms, int *RESTRICT state, STP_Bool *RESTRICT visited)
void graph_pc_termMarkProper(const GRAPH *, int *)
SCIP_RETCODE reduce_sd(SCIP *scip, GRAPH *g, REDBASE *redbase, int *nelims)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void graph_path_exec(SCIP *, const GRAPH *, int, int, const SCIP_Real *, PATH *)
static void sdwalkReset(int nnodes, int nvisits, const int *visitlist, SCIP_Real *RESTRICT dist, int *RESTRICT state, STP_Bool *RESTRICT visited)
void graph_free_dcsr(SCIP *, GRAPH *)
SCIP_RETCODE reduce_sdWalk(SCIP *scip, int edgelimit, const int *edgestate, GRAPH *g, int *termmark, SCIP_Real *dist, int *heap, int *state, int *visitlist, STP_Bool *visited, int *nelims)
void reduce_sdneighborGetCloseTerms(const GRAPH *, const SDN *, int, SCIP_Real, int *RESTRICT, SCIP_Real *RESTRICT, int *RESTRICT)
SCIP_Real reduce_sdgraphGetSd(int, int, SDGRAPH *)
void graph_free(SCIP *, GRAPH **, SCIP_Bool)
SCIP_RETCODE graph_path_init(SCIP *, GRAPH *)
void graph_dcsr_deleteEdgeBi(SCIP *, DCSR *, int)
#define STP_BD_MAXDNEDGES
#define SDSTAR_BASE_UNSET
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
Problem data for stp problem.
enum SCIP_Retcode SCIP_RETCODE
includes various files containing graph methods used for Steiner tree problems
void graph_heap_clean(SCIP_Bool, DHEAP *)
const int * cliqueToNodeMap
void graph_path_PcMwSd(SCIP *, const GRAPH *, PATH *, SCIP_Real *, SCIP_Real, int *, int *, int *, int *, int *, int *, int, int, int)
SCIP_Bool graph_heap_isClean(const DHEAP *)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE reduce_bd34WithSd(SCIP *scip, GRAPH *g, SDGRAPH *sdgraph, PATH *vnoi, int *vbase, int *nelims)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE reduce_sdWalkExt2(SCIP *scip, int edgelimit, const int *edgestate, GRAPH *g, int *termmark, SCIP_Real *dist, int *heap, int *state, int *visitlist, STP_Bool *visited, int *nelims)
SCIP_Real reduce_sdGetSdIntermedTerms(const GRAPH *g, int i, int i2, SCIP_Real sd_upper, SCIP_Real sd_sufficient, SD *sddata)
SCIP_Real * node_distance
SCIP_Bool graph_sdWalks(SCIP *, const GRAPH *, const SCIP_Real *, const int *, SCIP_Real, int, int, int, SCIP_Real *, int *, int *, int *, int *, STP_Bool *)
SCIP_Real miscstp_maxReal(const SCIP_Real *realarr, unsigned nreals)
SCIP_RETCODE graph_init_dcsr(SCIP *, GRAPH *)
SCIP_RETCODE reduce_sdImpLongEdge(SCIP *scip, const int *edgestate, GRAPH *g, SD *sdistance, int *nelims)
SCIP_RETCODE reduce_sdWalk_csr(SCIP *scip, int edgelimit, const int *edgestate, GRAPH *g, int *termmark, SCIP_Real *dist, int *visitlist, STP_Bool *visited, DHEAP *dheap, int *nelims)
SCIP_Bool graph_pc_termIsNonLeafTerm(const GRAPH *, int)
SCIP_Bool graph_sdWalksTriangle(SCIP *, const GRAPH *, const int *, const int *, SCIP_Real, int, int, int, SCIP_Real *, SCIP_Real *, int *, int *, DHEAP *, STP_Bool *)
SCIP_RETCODE reduce_sdBiasedNeighbor(SCIP *scip, SD *sdistance, GRAPH *g, int *nelims)
SCIP_RETCODE reduce_sdWalkTriangle(SCIP *scip, int edgelimit, SCIP_Bool usestrongreds, GRAPH *g, int *termmark, SCIP_Real *dist, int *visitlist, STP_Bool *visited, DHEAP *dheap, int *nelims)
static int getcloseterms2term(SCIP *scip, const GRAPH *g, const GRAPH *netgraph, SCIP_Real *termdist, SCIP_Real ecost, int *neighbterms, int *nodesid, int *nodesorg, int i)
static SCIP_RETCODE sdCliqueInitData(SCIP *scip, const GRAPH *g, int centernode, const GRAPH *cliquegraph, const int *cliqueNodeMap, DIJK *dijkdata, SDCLIQUE *sdclique)
static void sdwalkResetExt2(int nnodes, int nvisits, const int *visitlist, SCIP_Real *dist, int *nprevterms, int *nprevNPterms, int *nprevedges, int *state, STP_Bool *visited)
void graph_dijkLimited_reset(const GRAPH *, DIJK *)
static SCIP_Real sdGetSdNeighbor(const GRAPH *g, int i, int i2, SCIP_Real sd_upper, SCIP_Real sd_sufficient, SD *sddata)
SCIP_RETCODE graph_get4nextTTerms(SCIP *, GRAPH *, const SCIP_Real *, PATH *, int *, int *, int *)
static SCIP_Real getSd(SCIP *scip, GRAPH *g, SDGRAPH *sdgraph, PATH *vnoi, SCIP_Real sd_initial, int *vbase, int i, int i2, int limit)
static SCIP_RETCODE sdStarBiasedProcessNode(SCIP *scip, int node, SCIP_Bool usestrongreds, const SDPROFIT *sdprofit, GRAPH *g, DIJK *dijkdata, int *RESTRICT star_base, SCIP_Bool *RESTRICT edge_deletable, int *nelims)
miscellaneous methods used for solving Steiner problems
static SCIP_RETCODE sdStarInit(SCIP *scip, const GRAPH *g, int edgelimit, DIJK **dijkdata, int *RESTRICT *star_base, SCIP_Bool *RESTRICT *edge_deletable)
SCIP_RETCODE reduce_sdPc(SCIP *scip, GRAPH *g, PATH *vnoi, int *heap, int *state, int *vbase, int *nodesid, int *nodesorg, int *nelims)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static void sdGetSdsCliqueTermWalks(const GRAPH *g, SD *RESTRICT sddata, GRAPH *RESTRICT cliquegraph, SDCLIQUE *RESTRICT sdclique)
#define SCIPfreeBufferArrayNull(scip, ptr)
static int getcloseterms(SCIP *scip, const PATH *vnoi, SCIP_Real *termdist, SCIP_Real ecost, const int *vbase, int *neighbterms, int i, int nnodes)
void graph_edge_add(SCIP *, GRAPH *, int, int, double, double)
static void sdStarReset(int nnodes, int nvisits, const int *visitlist, int *RESTRICT star_base, SCIP_Real *RESTRICT dist, STP_Bool *RESTRICT visited, DHEAP *RESTRICT dheap)
static SCIP_RETCODE ledgeFromNetgraph(SCIP *scip, const GRAPH *netgraph, const PATH *mst, const int *edgeorg, const PATH *vnoi, const int *vbase, GRAPH *g, int *nelims)
SCIP_RETCODE reduce_unconnected(SCIP *, GRAPH *)
void graph_knot_add(GRAPH *, int)
SCIP_Real reduce_sdGetSd(const GRAPH *g, int i, int i2, SCIP_Real sd_upper, SCIP_Real sd_sufficient, SD *sddata)
static int getlecloseterms(SCIP *scip, PATH *vnoi, SCIP_Real *termdist, SCIP_Real ecost, int *vbase, int *neighbterms, int i, int nnodes)
void graph_edge_delBlocked(SCIP *, GRAPH *, const SCIP_Bool *, SCIP_Bool)
SCIP_RETCODE graph_knot_delPseudo(SCIP *, GRAPH *, const SCIP_Real *, const SCIP_Real *, const SCIP_Real *, int, REDCOST *, SCIP_Bool *)
const SCIP_Bool * reduce_sdneighborGetBlocked(const SDN *)
void reduce_sdgraphFreeFromDistGraph(SCIP *, SDGRAPH **)
void reduce_sdprofitFree(SCIP *, SDPROFIT **)
SCIP_Bool graph_pseudoAncestors_edgesInConflict(SCIP *, const GRAPH *, const int *, int)
SCIP_RETCODE graph_sdComputeCliqueStar(SCIP *, const GRAPH *, const SDPROFIT *, SDCLIQUE *)
SCIP_RETCODE reduce_sdEdgeCliqueStar(SCIP *scip, int edgelimit, GRAPH *g, int *nelims)
#define STP_SDWALK_MAXNPREVS
SCIP_Real reduce_sdgraphGetMaxCost(const SDGRAPH *)
struct single_special_distance_pc SD1PC
static SCIP_Real reduce_sdprofitGetProfit(const SDPROFIT *sdprofit, int node, int nonsource1, int nonsource2)
SCIP_RETCODE graph_dijkLimited_init(SCIP *, const GRAPH *, DIJK **)
static SCIP_Real sdGetSd(const GRAPH *g, int i, int i2, SCIP_Real sd_upper, SCIP_Real sd_sufficient, SCIP_Bool onlyIntermedTerms, SD *sddata)
SCIP_RETCODE graph_sdStarBiased(SCIP *, const GRAPH *, const SDPROFIT *, int, int *, DIJK *, SCIP_Bool *)
#define SCIPallocBufferArray(scip, ptr, num)
void graph_dijkLimited_free(SCIP *, DIJK **)
SCIP_Bool graph_isMarked(const GRAPH *)
static void pcBiasCostsDCSR(SCIP *scip, const GRAPH *g, SCIP_Bool biasreversed, SCIP_Real *costbiased, SCIP_Real *mincost_in)
SCIP_RETCODE reduce_sdStarBiasedWithProfit(SCIP *scip, int edgelimit, const SDPROFIT *sdprofit, SCIP_Bool usestrongreds, GRAPH *g, int *nelims)
#define BMScopyMemoryArray(ptr, source, num)
void graph_edge_printInfo(const GRAPH *, int)
void graph_tpathsGet4CloseTerms(const GRAPH *, const TPATHS *, int, SCIP_Real, int *RESTRICT, int *RESTRICT, SCIP_Real *RESTRICT, int *RESTRICT)
SCIP_Bool graph_sdWalksExt2(SCIP *, const GRAPH *, const SCIP_Real *, const int *, SCIP_Real, int, int, int, int, SCIP_Real *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, STP_Bool *)
void graph_path_exit(SCIP *, GRAPH *)
SCIP_Bool graph_pc_isPc(const GRAPH *)
void graph_get4nextTermPaths(GRAPH *, const SCIP_Real *, const SCIP_Real *, PATH *, int *, int *)
static SCIP_Bool isPseudoDeletableDeg3(SCIP *scip, const GRAPH *g, const SCIP_Real *sdsK3, const int *edgesK3, SCIP_Real costK3, SCIP_Bool allowEquality)
SCIP_Bool hasNeigborUpdate
static void sdStarFinalize(SCIP *scip, GRAPH *g, DIJK **dijkdata, int *RESTRICT *star_base, SCIP_Bool *RESTRICT *edge_deletable)
static void deleteEdge(SCIP *scip, int edge, GRAPH *g, PR *pr)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE reduce_sdBiased(SCIP *scip, SD *sdistance, GRAPH *g, int *nelims)
SCIP_RETCODE reduce_sdgraphInitFromDistGraph(SCIP *, const GRAPH *, GRAPH *, int *, SDGRAPH **)
SCIP_RETCODE reduce_sdspSap(SCIP *scip, GRAPH *g, PATH *pathtail, PATH *pathhead, int *heap, int *statetail, int *statehead, int *memlbltail, int *memlblhead, int *nelims, int limit)
SCIP_Bool graph_pc_knotIsFixedTerm(const GRAPH *, int)
static SCIP_RETCODE sdCliqueUpdateGraphWithStarWalks(SCIP *scip, const GRAPH *g, const SDPROFIT *sdprofit, GRAPH *cliquegraph, SDCLIQUE *sdclique)
SCIP_Bool reduce_sdgraphHasMstHalfMark(const SDGRAPH *)
SCIP_Bool graph_pc_isPcMw(const GRAPH *)
void graph_dijkLimited_clean(const GRAPH *, DIJK *)
SCIP_RETCODE reduce_getSdByPaths(SCIP *scip, GRAPH *g, PATH *pathtail, PATH *pathhead, SCIP_Real *sdist, SCIP_Real distlimit, int *heap, int *statetail, int *statehead, int *memlbltail, int *memlblhead, int i, int i2, int limit, SCIP_Bool pc, SCIP_Bool mw)
static void sdCliqueFreeData(SCIP *scip, SDCLIQUE *sdclique)
SCIP_RETCODE reduce_sdUpdateWithSdNeighbors(SCIP *, GRAPH *, SD *, int *)
void graph_sdStar(SCIP *, const GRAPH *, SCIP_Bool, int, int, int *, SCIP_Real *, int *, int *, DHEAP *, STP_Bool *, SCIP_Bool *)
SCIP_RETCODE reduce_sdStar(SCIP *scip, int edgelimit, SCIP_Bool usestrongreds, GRAPH *g, SCIP_Real *dist, int *star_base, int *visitlist, STP_Bool *visited, DHEAP *dheap, int *nelims)
void graph_sdPaths(const GRAPH *, PATH *, const SCIP_Real *, SCIP_Real, int *, int *, int *, int *, int, int, int)
SCIP_RETCODE reduce_sdprofitInit(SCIP *, const GRAPH *, SDPROFIT **)
int graph_get_nNodes(const GRAPH *)
static SCIP_Real sdGetSdPcMw(SCIP *scip, const GRAPH *g, SCIP_Real distlimit, int i, int i2, int edgelimit, SD1PC *sd1pc)
SCIP_RETCODE reduce_bd34(SCIP *scip, GRAPH *g, PATH *pathtail, PATH *pathhead, int *heap, int *statetail, int *statehead, int *memlbltail, int *memlblhead, int *nelims, int limit, SCIP_Real *offset)
SCIP_RETCODE reduce_sdStarPc(SCIP *scip, int edgelimit, const int *edgestate, GRAPH *g, SCIP_Real *dist, int *star_base, int *visitlist, STP_Bool *visited, DHEAP *dheap, int *nelims)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE graph_buildCompleteGraph(SCIP *, GRAPH **, int)
SCIP_RETCODE reduce_sdsp(SCIP *scip, GRAPH *g, PATH *pathtail, int *heap, int *statetail, int *statehead, int *memlbltail, int *memlblhead, int *nelims, int limit, SCIP_Bool usestrongreds)
SCIP_RETCODE graph_init(SCIP *, GRAPH **, int, int, int)
const STP_Bool * reduce_sdgraphGetMstHalfMark(const SDGRAPH *)
includes various reduction methods for Steiner tree problems
SCIP_RETCODE reduce_sdStarPc2(SCIP *scip, int edgelimit, SCIP_Bool usestrongreds, GRAPH *g, SCIP_Real *dist, int *star_base, int *visitlist, STP_Bool *visited, DHEAP *dheap, int *nelims)
SCIP_RETCODE reduce_sdStarBiased(SCIP *scip, int edgelimit, SCIP_Bool usestrongreds, GRAPH *g, int *nelims)
SCIP_RETCODE reduce_sdGetSdsCliquegraph(SCIP *scip, const GRAPH *g, int centernode, const int *cliqueNodeMap, DIJK *dijkdata, SD *sddata, GRAPH *cliquegraph)
SCIP_RETCODE reduce_sdWalkExt(SCIP *scip, int edgelimit, SCIP_Bool usestrongreds, GRAPH *g, SCIP_Real *dist, int *heap, int *state, int *visitlist, STP_Bool *visited, int *nelims)