Skip to content

Commit

Permalink
Upgraded to SCIP 7.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-lam committed Nov 24, 2020
1 parent 2d93650 commit 3cfd326
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ if (NOT CPLEX_LIBRARY)
endif ()
include_directories(${CPLEX_INCLUDE_DIR})

# Set stuff for SCIP 6.0.2.
# Include SCIP.
set(WITH_SCIPDEF on)
set(TPI none)
set(tpisources tpi/tpi_none.c)
set(THREAD_LIBRARIES "")
set(TPI_NONE on)
configure_file(scipoptsuite-6.0.2/scip/src/scip/config.h.in ${CMAKE_BINARY_DIR}/scip/config.h @ONLY)
configure_file(scipoptsuite-7.0.1/scip/src/scip/config.h.in ${CMAKE_BINARY_DIR}/scip/config.h @ONLY)
include_directories(${CMAKE_BINARY_DIR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl")
endif ()

# Include SCIP.
add_subdirectory(scipoptsuite-6.0.2/scip/ EXCLUDE_FROM_ALL)
include_directories(SYSTEM scipoptsuite-6.0.2/scip/src/)
add_subdirectory(scipoptsuite-7.0.1/scip/ EXCLUDE_FROM_ALL)
include_directories(SYSTEM scipoptsuite-7.0.1/scip/src/)

# Link to math library.
find_library(LIBM m)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ BCP is released under the GPL version 3. See LICENSE.txt for further details.
Dependencies
------------

BCP is implemented in C++17 and is compiled using CMake, so you will need a recent compiler and a recent version of CMake. It is tested with Clang 9 on Mac and GCC 8 on Linux. It has not been tested on Windows.
BCP is implemented in C++17 and is compiled using CMake, so you will need a recent compiler and a recent version of CMake. It is tested with Clang 10 on Mac and GCC 8 on Linux. It has not been tested on Windows.

BCP calls SCIP for branch-and-bound and calls CPLEX for solving the linear relaxation.

Source code to SCIP is available free (as in beer) strictly for academic use. BCP is tested with SCIP 6.0.2. Download the [SCIP Optimization Suite 6.0.2](https://scip.zib.de) and extract it into the root of this repository. You should find the subdirectory `scipoptsuite-6.0.2/scip/src`.
Source code to SCIP is available free (as in beer) strictly for academic use. BCP is tested with SCIP 7.0.1. Download the [SCIP Optimization Suite 7.0.1](https://scip.zib.de) and extract it into the root of this repository. You should find the subdirectory `scipoptsuite-7.0.1/scip/src`.

CPLEX is commercial software but has binaries available free under an [academic license](https://developer.ibm.com/docloud/blog/2019/07/04/cplex-optimization-studio-for-students-and-academics/). BCP is tested with CPLEX 12.10. You should find the subdirectory `cplex`.

Expand Down
13 changes: 6 additions & 7 deletions bcp/ConstraintHandler_EdgeConflicts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Edge get_opposite_edge_allow_wait(
SCIP_RETCODE edge_conflicts_create_cut(
SCIP* scip, // SCIP
const Map& map, // Map
SCIP_CONSHDLR* conshdlr, // Constraint handler
SCIP_CONS* cons, // Constraint
EdgeConflictsConsData* consdata, // Constraint data
const Time t, // Time
#ifdef USE_WAITEDGE_CONFLICTS
Expand Down Expand Up @@ -248,7 +248,7 @@ SCIP_RETCODE edge_conflicts_create_cut(
SCIP_ROW* row = nullptr;
SCIP_CALL(SCIPcreateEmptyRowCons(scip,
&row,
conshdlr,
cons,
#ifdef DEBUG
name.c_str(),
#else
Expand Down Expand Up @@ -411,7 +411,6 @@ SCIP_RETCODE edge_conflicts_check(
static
SCIP_RETCODE edge_conflicts_separate(
SCIP* scip, // SCIP
SCIP_CONSHDLR* conshdlr, // Constraint handler
SCIP_CONS* cons, // Constraint
SCIP_SOL* sol, // Solution
SCIP_RESULT* result // Pointer to store the result
Expand Down Expand Up @@ -562,7 +561,7 @@ SCIP_RETCODE edge_conflicts_separate(
// Create cut.
SCIP_CALL(edge_conflicts_create_cut(scip,
map,
conshdlr,
cons,
consdata,
t,
edges,
Expand Down Expand Up @@ -750,7 +749,7 @@ SCIP_DECL_CONSENFOLP(consEnfolpEdgeConflicts)
debug_assert(cons);

// Start separator.
SCIP_CALL(edge_conflicts_separate(scip, conshdlr, cons, nullptr, result));
SCIP_CALL(edge_conflicts_separate(scip, cons, nullptr, result));
}

// Done.
Expand Down Expand Up @@ -808,7 +807,7 @@ SCIP_DECL_CONSSEPALP(consSepalpEdgeConflicts)
debug_assert(cons);

// Start separator.
SCIP_CALL(edge_conflicts_separate(scip, conshdlr, cons, nullptr, result));
SCIP_CALL(edge_conflicts_separate(scip, cons, nullptr, result));
}

// Done.
Expand Down Expand Up @@ -838,7 +837,7 @@ SCIP_DECL_CONSSEPASOL(consSepasolEdgeConflicts)

// Start separator.
debug_assert(sol);
SCIP_CALL(edge_conflicts_separate(scip, conshdlr, cons, sol, result));
SCIP_CALL(edge_conflicts_separate(scip, cons, sol, result));
}

// Done.
Expand Down
13 changes: 6 additions & 7 deletions bcp/ConstraintHandler_VertexConflicts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SCIP_RETCODE SCIPcreateConsVertexConflicts(

SCIP_RETCODE vertex_conflicts_create_cut(
SCIP* scip, // SCIP
SCIP_CONSHDLR* conshdlr, // Constraint handler
SCIP_CONS* cons, // Constraint
VertexConflictsConsData* consdata, // Constraint data
const NodeTime nt, // Node-time of the conflict
const Vector<SCIP_VAR*>& vars, // Array of variables
Expand All @@ -133,7 +133,7 @@ SCIP_RETCODE vertex_conflicts_create_cut(
SCIP_ROW* row = nullptr;
SCIP_CALL(SCIPcreateEmptyRowCons(scip,
&row,
conshdlr,
cons,
#ifdef DEBUG
name.c_str(),
#else
Expand Down Expand Up @@ -294,7 +294,6 @@ SCIP_RETCODE vertex_conflicts_check(
static
SCIP_RETCODE vertex_conflicts_separate(
SCIP* scip, // SCIP
SCIP_CONSHDLR* conshdlr, // Constraint handler
SCIP_CONS* cons, // Constraint
SCIP_SOL* sol, // Solution
SCIP_RESULT* result // Pointer to store the result
Expand Down Expand Up @@ -379,7 +378,7 @@ SCIP_RETCODE vertex_conflicts_separate(

// Create cut.
SCIP_CALL(vertex_conflicts_create_cut(scip,
conshdlr,
cons,
consdata,
nt,
vars,
Expand Down Expand Up @@ -565,7 +564,7 @@ SCIP_DECL_CONSENFOLP(consEnfolpVertexConflicts)
debug_assert(cons);

// Start separator.
SCIP_CALL(vertex_conflicts_separate(scip, conshdlr, cons, nullptr, result));
SCIP_CALL(vertex_conflicts_separate(scip, cons, nullptr, result));
}

// Done.
Expand Down Expand Up @@ -623,7 +622,7 @@ SCIP_DECL_CONSSEPALP(consSepalpVertexConflicts)
debug_assert(cons);

// Start separator.
SCIP_CALL(vertex_conflicts_separate(scip, conshdlr, cons, nullptr, result));
SCIP_CALL(vertex_conflicts_separate(scip, cons, nullptr, result));
}

// Done.
Expand Down Expand Up @@ -653,7 +652,7 @@ SCIP_DECL_CONSSEPASOL(consSepasolVertexConflicts)

// Start separator.
debug_assert(sol);
SCIP_CALL(vertex_conflicts_separate(scip, conshdlr, cons, sol, result));
SCIP_CALL(vertex_conflicts_separate(scip, cons, sol, result));
}

// Done.
Expand Down

0 comments on commit 3cfd326

Please sign in to comment.