Detailed Description
tests for Steiner tree reductions
This file implements unit tests for Steiner special distance (Steiner bottleneck distance) reduction methods.
A list of all interface methods can be found in stptest.h.
Definition in file stptest_reducesd.c.
#include <stdio.h>
#include <assert.h>
#include "stptest.h"
#include "graph.h"
#include "reduce.h"
#include "portab.h"
Go to the source code of this file.
Function Documentation
◆ testSdGetterReturnsCorrectSds()
|
static |
tests SD getter
- Parameters
-
scip SCIP data structure
Definition at line 40 of file stptest_reducesd.c.
References GRAPH::cost, EAT_LAST, dijkstra_data::edgelimit, EQ, graph_buildCompleteGraph(), graph_dijkLimited_clean(), graph_dijkLimited_free(), graph_dijkLimited_init(), graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_path_init(), GRAPH::head, GRAPH::mark, nnodes, GRAPH::oeat, GRAPH::outbeg, reduce_sdFree(), reduce_sdGetSdsCliquegraph(), reduce_sdInit(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), stptest_graphTearDown(), and TRUE.
Referenced by stptest_reduceSdGetter().
◆ testSdGraphDistsAreValid()
|
static |
tests SD getter
- Parameters
-
scip SCIP data structure
Definition at line 140 of file stptest_reducesd.c.
References EQ, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_sdFree(), reduce_sdgraphGetOrderedMstCosts(), reduce_sdgraphInitOrderedMstCosts(), reduce_sdInitBiased(), SCIP_CALL, SCIP_OKAY, SCIP_Real, special_distance_storage::sdgraph, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdGetter().
◆ testSdGraphDistsAreValid2()
|
static |
tests SD getter
- Parameters
-
scip SCIP data structure
Definition at line 187 of file stptest_reducesd.c.
References EQ, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_sdFree(), reduce_sdgraphGetOrderedMstCosts(), reduce_sdgraphInitOrderedMstCosts(), reduce_sdInitBiased(), SCIP_CALL, SCIP_OKAY, SCIP_Real, special_distance_storage::sdgraph, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdGetter().
◆ testSdGraphQueriesAreValid()
|
static |
tests SD queries
- Parameters
-
scip SCIP data structure
Definition at line 234 of file stptest_reducesd.c.
References EQ, graph_edge_addBi(), graph_init(), graph_knot_add(), nnodes, reduce_sdFree(), reduce_sdgraphGetSd(), reduce_sdgraphInitOrderedMstCosts(), reduce_sdInit(), SCIP_CALL, SCIP_OKAY, special_distance_storage::sdgraph, GRAPH::source, STP_TERM, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdGetter().
◆ testSdGraphStrongBiasedDistsAreValid()
|
static |
tests SD getter
- Parameters
-
scip SCIP data structure
Definition at line 282 of file stptest_reducesd.c.
References EQ, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_tpathsFree(), graph_tpathsInitBiased(), nnodes, reduce_sdgraphFree(), reduce_sdgraphGetOrderedMstCosts(), reduce_sdgraphInitBiasedFromTpaths(), reduce_sdgraphInitOrderedMstCosts(), reduce_sdprofitFree(), reduce_sdprofitInit(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdGetter().
◆ testBdkTreeDistDeletesNodeDeg4()
|
static |
tests that BDk test pseudo-eliminates node of degree 4
- Parameters
-
scip SCIP data structure
Definition at line 334 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_bdk(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceBdk().
◆ testBdkSdMstDeletesNodeDeg4()
|
static |
tests that BDk test pseudo-eliminates node of degree 4
- Parameters
-
scip SCIP data structure
Definition at line 376 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_bdk(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceBdk().
◆ testBdkSdMstStarDeletesNodeDeg4()
|
static |
tests that BDk test pseudo-eliminates node of degree 4
- Parameters
-
scip SCIP data structure
Definition at line 424 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_bdk(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceBdk().
◆ testBdkSdMstDeletesNodeDeg3()
|
static |
tests that BDk test pseudo-eliminates node of degree 3
- Parameters
-
scip SCIP data structure
Definition at line 566 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, reduce_bdk(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceBdk().
◆ testSdStarBiasedDeletesEdge()
|
static |
tests that SD star biased test finds edge for deletion
- Parameters
-
scip SCIP data structure
Definition at line 610 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdStarBiased(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), stptest_graphTearDown(), and TRUE.
Referenced by stptest_reduceSdStarBias().
◆ testSdStarBiasedDeletesEdge2()
|
static |
tests that SD star biased test finds edge for deletion
- Parameters
-
scip SCIP data structure
Definition at line 649 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdStarBiased(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), stptest_graphTearDown(), and TRUE.
Referenced by stptest_reduceSdStarBias().
◆ testSdStarBiasedDeletesEdge3()
|
static |
tests that SD star biased test finds edge for deletion
- Parameters
-
scip SCIP data structure
Definition at line 691 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdStarBiased(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), stptest_graphTearDown(), and TRUE.
Referenced by stptest_reduceSdStarBias().
◆ testSdCliqueStarDeletesEdge()
|
static |
tests that SD star clique test finds edge for deletion
- Parameters
-
scip SCIP data structure
Definition at line 733 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdEdgeCliqueStar(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdBiased().
◆ testSdBiasedDeletesEdge()
|
static |
tests that SD biased test finds edge for deletion
- Parameters
-
scip SCIP data structure
Definition at line 775 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdAddNeighborSd(), reduce_sdBiased(), reduce_sdBiasedNeighbor(), reduce_sdFree(), reduce_sdInitBiased(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdBiased().
◆ testSdCliqueStarDeg3AdjacencyIsCorrect()
|
static |
tests clique star correctly identifies adjacency distances for degree 3 node
- Parameters
-
scip SCIP data structure
Definition at line 914 of file stptest_reducesd.c.
References special_distance_clique::dijkdata, dijkstra_data::edgelimit, EQ, FARAWAY, graph_dijkLimited_clean(), graph_dijkLimited_free(), graph_dijkLimited_init(), graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_sdComputeCliqueStar(), nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdCliqueStar().
◆ testSdCliqueStarDeg3IsCorrect()
|
static |
tests clique star correctly identifies distances for degree 3 node
- Parameters
-
scip SCIP data structure
Definition at line 968 of file stptest_reducesd.c.
References special_distance_clique::dijkdata, dijkstra_data::edgelimit, EQ, FARAWAY, graph_dijkLimited_clean(), graph_dijkLimited_free(), graph_dijkLimited_init(), graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_sdComputeCliqueStar(), nnodes, NULL, reduce_sdFree(), reduce_sdInitBiased(), SCIP_CALL, SCIP_OKAY, SCIP_Real, special_distance_storage::sdprofit, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdCliqueStar().
◆ testSdCliqueStarDeg3IsCorrect2()
|
static |
tests clique star correctly identifies distances for degree 3 node
- Parameters
-
scip SCIP data structure
Definition at line 1039 of file stptest_reducesd.c.
References special_distance_clique::dijkdata, dijkstra_data::edgelimit, EQ, FARAWAY, graph_dijkLimited_clean(), graph_dijkLimited_free(), graph_dijkLimited_init(), graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_sdComputeCliqueStar(), nnodes, NULL, reduce_sdFree(), reduce_sdInitBiased(), SCIP_CALL, SCIP_OKAY, SCIP_Real, special_distance_storage::sdprofit, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdCliqueStar().
◆ testSdCliqueStarDeg4IsCorrect()
|
static |
tests clique star correctly identifies distances for degree 4 node
- Parameters
-
scip SCIP data structure
Definition at line 1112 of file stptest_reducesd.c.
References special_distance_clique::dijkdata, dijkstra_data::edgelimit, EQ, FARAWAY, graph_dijkLimited_clean(), graph_dijkLimited_free(), graph_dijkLimited_init(), graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_sdComputeCliqueStar(), nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdCliqueStar().
◆ testSdBiasedBottleneckDeletesEdge()
|
static |
tests that fully biased SD deletes edge
- Parameters
-
scip SCIP data structure
Definition at line 1170 of file stptest_reducesd.c.
References EAT_FREE, FARAWAY, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_pc_initPrizes(), nnodes, NULL, GRAPH::oeat, GRAPH::prize, reduce_sdBiased(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), stptest_graphSetUpRpcOrg(), and stptest_graphTearDown().
Referenced by stptest_reduceSdBiasedBottleneck().
◆ testNsvImpliedContractsEdge()
|
static |
tests that (implied) NSV contracts edge
- Parameters
-
scip SCIP data structure
Definition at line 1293 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, NULL, reduce_nsvImplied(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceNsvImplied().
◆ testNsvImpliedContractsEdge2()
|
static |
tests that (implied) NSV contracts edge
- Parameters
-
scip SCIP data structure
Definition at line 1342 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, NULL, reduce_nsvImplied(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceNsvImplied().
◆ testNsvImpliedContractsCutDistEdge()
|
static |
tests that (implied) NSV contracts edge by using node distances to cut
- Parameters
-
scip SCIP data structure
Definition at line 1388 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, NULL, reduce_nsvImplied(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceNsvImplied().
◆ testNsvImpliedContractsCutDistMiddleEdge()
|
static |
tests that (implied) NSV contracts edge by using node distances to cut
- Parameters
-
scip SCIP data structure
Definition at line 1433 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, NULL, reduce_nsvImplied(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceNsvImplied().
◆ testNsvImpliedContractsImpliedToTermEdge()
|
static |
tests that (implied) NSV contracts edge between vertex with implied profit and terminal
- Parameters
-
scip SCIP data structure
Definition at line 1480 of file stptest_reducesd.c.
References GRAPH::grad, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, NULL, reduce_nsvImplied(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, SCIP_Real, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceNsvImplied().
◆ testSdBiasedBottleneckTermPathDeletesEdge()
|
static |
tests that fully biased SD with biased on terminal path deletes edge
- Parameters
-
scip SCIP data structure
Definition at line 1521 of file stptest_reducesd.c.
References EAT_FREE, graph_edge_addBi(), graph_init(), graph_knot_add(), graph_knot_chg(), nnodes, GRAPH::oeat, reduce_sdBiased(), reduce_sdFree(), reduce_sdInitBiasedBottleneck(), SCIP_CALL, SCIP_OKAY, GRAPH::source, STP_TERM, STP_TERM_NONE, STPTEST_ASSERT, stptest_graphSetUp(), and stptest_graphTearDown().
Referenced by stptest_reduceSdBiasedBottleneck().
◆ stptest_reduceBdk()
SCIP_RETCODE stptest_reduceBdk | ( | SCIP * | scip | ) |
tests Bdk methods
- Parameters
-
scip SCIP data structure
Definition at line 1573 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testBdkSdMstDeletesNodeDeg3(), testBdkSdMstDeletesNodeDeg4(), testBdkSdMstStarDeletesNodeDeg4(), and testBdkTreeDistDeletesNodeDeg4().
Referenced by stptest_testAll().
◆ stptest_reduceSdBiased()
SCIP_RETCODE stptest_reduceSdBiased | ( | SCIP * | scip | ) |
tests biased SD methods
- Parameters
-
scip SCIP data structure
Definition at line 1594 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testSdBiasedDeletesEdge(), and testSdCliqueStarDeletesEdge().
Referenced by stptest_testAll().
◆ stptest_reduceSdCliqueStar()
SCIP_RETCODE stptest_reduceSdCliqueStar | ( | SCIP * | scip | ) |
tests SD clique star methods
- Parameters
-
scip SCIP data structure
Definition at line 1613 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testSdCliqueStarDeg3AdjacencyIsCorrect(), testSdCliqueStarDeg3IsCorrect(), testSdCliqueStarDeg3IsCorrect2(), and testSdCliqueStarDeg4IsCorrect().
Referenced by stptest_testAll().
◆ stptest_reduceSdGetter()
SCIP_RETCODE stptest_reduceSdGetter | ( | SCIP * | scip | ) |
tests SD getter methods
- Parameters
-
scip SCIP data structure
Definition at line 1629 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testSdGetterReturnsCorrectSds(), testSdGraphDistsAreValid(), testSdGraphDistsAreValid2(), testSdGraphQueriesAreValid(), and testSdGraphStrongBiasedDistsAreValid().
Referenced by stptest_testAll().
◆ stptest_reduceSdBiasedBottleneck()
SCIP_RETCODE stptest_reduceSdBiasedBottleneck | ( | SCIP * | scip | ) |
tests implied profit based routine
- Parameters
-
scip SCIP data structure
Definition at line 1650 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testSdBiasedBottleneckDeletesEdge(), and testSdBiasedBottleneckTermPathDeletesEdge().
Referenced by stptest_testAll().
◆ stptest_reduceNsvImplied()
SCIP_RETCODE stptest_reduceNsvImplied | ( | SCIP * | scip | ) |
tests NSV
- Parameters
-
scip SCIP data structure
Definition at line 1663 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testNsvImpliedContractsCutDistEdge(), testNsvImpliedContractsCutDistMiddleEdge(), testNsvImpliedContractsEdge(), testNsvImpliedContractsEdge2(), and testNsvImpliedContractsImpliedToTermEdge().
Referenced by stptest_testAll().
◆ stptest_reduceSdStarBias()
SCIP_RETCODE stptest_reduceSdStarBias | ( | SCIP * | scip | ) |
tests SD biased methods
- Parameters
-
scip SCIP data structure
Definition at line 1683 of file stptest_reducesd.c.
References SCIP_CALL, SCIP_OKAY, testSdStarBiasedDeletesEdge(), testSdStarBiasedDeletesEdge2(), and testSdStarBiasedDeletesEdge3().
Referenced by stptest_testAll().