Scippy

SCIP

Solving Constraint Integer Programs

stptest_reducesd.c File Reference

Detailed Description

tests for Steiner tree reductions

Author
Daniel Rehfeldt

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.

Functions

static SCIP_RETCODE testSdGetterReturnsCorrectSds (SCIP *scip)
 
static SCIP_RETCODE testSdGraphDistsAreValid (SCIP *scip)
 
static SCIP_RETCODE testSdGraphDistsAreValid2 (SCIP *scip)
 
static SCIP_RETCODE testSdGraphQueriesAreValid (SCIP *scip)
 
static SCIP_RETCODE testSdGraphStrongBiasedDistsAreValid (SCIP *scip)
 
static SCIP_RETCODE testBdkTreeDistDeletesNodeDeg4 (SCIP *scip)
 
static SCIP_RETCODE testBdkSdMstDeletesNodeDeg4 (SCIP *scip)
 
static SCIP_RETCODE testBdkSdMstStarDeletesNodeDeg4 (SCIP *scip)
 
static SCIP_RETCODE testBdkSdMstDeletesNodeDeg3 (SCIP *scip)
 
static SCIP_RETCODE testSdStarBiasedDeletesEdge (SCIP *scip)
 
static SCIP_RETCODE testSdStarBiasedDeletesEdge2 (SCIP *scip)
 
static SCIP_RETCODE testSdStarBiasedDeletesEdge3 (SCIP *scip)
 
static SCIP_RETCODE testSdCliqueStarDeletesEdge (SCIP *scip)
 
static SCIP_RETCODE testSdBiasedDeletesEdge (SCIP *scip)
 
static SCIP_RETCODE testSdCliqueStarDeg3AdjacencyIsCorrect (SCIP *scip)
 
static SCIP_RETCODE testSdCliqueStarDeg3IsCorrect (SCIP *scip)
 
static SCIP_RETCODE testSdCliqueStarDeg3IsCorrect2 (SCIP *scip)
 
static SCIP_RETCODE testSdCliqueStarDeg4IsCorrect (SCIP *scip)
 
static SCIP_RETCODE testSdBiasedBottleneckDeletesEdge (SCIP *scip)
 
static SCIP_RETCODE testNsvImpliedContractsEdge (SCIP *scip)
 
static SCIP_RETCODE testNsvImpliedContractsEdge2 (SCIP *scip)
 
static SCIP_RETCODE testNsvImpliedContractsCutDistEdge (SCIP *scip)
 
static SCIP_RETCODE testNsvImpliedContractsCutDistMiddleEdge (SCIP *scip)
 
static SCIP_RETCODE testNsvImpliedContractsImpliedToTermEdge (SCIP *scip)
 
static SCIP_RETCODE testSdBiasedBottleneckTermPathDeletesEdge (SCIP *scip)
 
SCIP_RETCODE stptest_reduceBdk (SCIP *scip)
 
SCIP_RETCODE stptest_reduceSdBiased (SCIP *scip)
 
SCIP_RETCODE stptest_reduceSdCliqueStar (SCIP *scip)
 
SCIP_RETCODE stptest_reduceSdGetter (SCIP *scip)
 
SCIP_RETCODE stptest_reduceSdBiasedBottleneck (SCIP *scip)
 
SCIP_RETCODE stptest_reduceNsvImplied (SCIP *scip)
 
SCIP_RETCODE stptest_reduceSdStarBias (SCIP *scip)
 

Function Documentation

◆ testSdGetterReturnsCorrectSds()

◆ testSdGraphDistsAreValid()

◆ testSdGraphDistsAreValid2()

◆ testSdGraphQueriesAreValid()

◆ testSdGraphStrongBiasedDistsAreValid()

◆ testBdkTreeDistDeletesNodeDeg4()

static SCIP_RETCODE testBdkTreeDistDeletesNodeDeg4 ( SCIP scip)
static

tests that BDk test pseudo-eliminates node of degree 4

Parameters
scipSCIP 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 SCIP_RETCODE testBdkSdMstDeletesNodeDeg4 ( SCIP scip)
static

tests that BDk test pseudo-eliminates node of degree 4

Parameters
scipSCIP 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 SCIP_RETCODE testBdkSdMstStarDeletesNodeDeg4 ( SCIP scip)
static

tests that BDk test pseudo-eliminates node of degree 4

Parameters
scipSCIP 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 SCIP_RETCODE testBdkSdMstDeletesNodeDeg3 ( SCIP scip)
static

tests that BDk test pseudo-eliminates node of degree 3

Parameters
scipSCIP 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 SCIP_RETCODE testSdStarBiasedDeletesEdge ( SCIP scip)
static

tests that SD star biased test finds edge for deletion

Parameters
scipSCIP 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 SCIP_RETCODE testSdStarBiasedDeletesEdge2 ( SCIP scip)
static

tests that SD star biased test finds edge for deletion

Parameters
scipSCIP 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 SCIP_RETCODE testSdStarBiasedDeletesEdge3 ( SCIP scip)
static

tests that SD star biased test finds edge for deletion

Parameters
scipSCIP 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 SCIP_RETCODE testSdCliqueStarDeletesEdge ( SCIP scip)
static

tests that SD star clique test finds edge for deletion

Parameters
scipSCIP 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()

◆ testSdCliqueStarDeg3AdjacencyIsCorrect()

static SCIP_RETCODE testSdCliqueStarDeg3AdjacencyIsCorrect ( SCIP scip)
static

◆ testSdCliqueStarDeg3IsCorrect()

◆ testSdCliqueStarDeg3IsCorrect2()

◆ testSdCliqueStarDeg4IsCorrect()

◆ testSdBiasedBottleneckDeletesEdge()

◆ testNsvImpliedContractsEdge()

static SCIP_RETCODE testNsvImpliedContractsEdge ( SCIP scip)
static

◆ testNsvImpliedContractsEdge2()

static SCIP_RETCODE testNsvImpliedContractsEdge2 ( SCIP scip)
static

◆ testNsvImpliedContractsCutDistEdge()

static SCIP_RETCODE testNsvImpliedContractsCutDistEdge ( SCIP scip)
static

◆ testNsvImpliedContractsCutDistMiddleEdge()

static SCIP_RETCODE testNsvImpliedContractsCutDistMiddleEdge ( SCIP scip)
static

◆ testNsvImpliedContractsImpliedToTermEdge()

static SCIP_RETCODE testNsvImpliedContractsImpliedToTermEdge ( SCIP scip)
static

tests that (implied) NSV contracts edge between vertex with implied profit and terminal

Parameters
scipSCIP 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 SCIP_RETCODE testSdBiasedBottleneckTermPathDeletesEdge ( SCIP scip)
static

◆ stptest_reduceBdk()

SCIP_RETCODE stptest_reduceBdk ( SCIP scip)

tests Bdk methods

Parameters
scipSCIP 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
scipSCIP 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
scipSCIP 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)

◆ stptest_reduceSdBiasedBottleneck()

SCIP_RETCODE stptest_reduceSdBiasedBottleneck ( SCIP scip)

tests implied profit based routine

Parameters
scipSCIP 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()

◆ stptest_reduceSdStarBias()

SCIP_RETCODE stptest_reduceSdStarBias ( SCIP scip)

tests SD biased methods

Parameters
scipSCIP data structure

Definition at line 1683 of file stptest_reducesd.c.

References SCIP_CALL, SCIP_OKAY, testSdStarBiasedDeletesEdge(), testSdStarBiasedDeletesEdge2(), and testSdStarBiasedDeletesEdge3().

Referenced by stptest_testAll().