https://developers.google.com/optimization/cp/cp_solver
我正在尝试在 C++ 中编写代码以使用上面与 python 演示的链接中所述的新 cp SAT 求解器,但是我无法弄清楚如何在 C++ 代码语法中获取这个 CP SAT 求解器,不确定其他类型的包含实际上是什么除了 "ortools/constraint_solver/constraint_solver.h" "ortools/sat/cp_constraints.h" "ortools/sat/cp_model.pb.h" 之外,新的 Cp 求解器需要
Below is the workable Cmake which could call other solver GLOP,CBC etc
cmake_minimum_required(VERSION 3.10)
project(GoogleOR)
set(CMAKE_CXX_STANDARD 17)
set(Ordir "/usr/local")
include_directories(${Ordir}/lib)
include_directories(${Ordir}/include)
add_definitions(-DUSE_GLOP -DUSE_BOP -DUSE_CBC -DUSE_CLIP)
set(LD_FLAGS "-v -lz -lrt -lpthread")
add_executable(GoogleOR main.cpp)
link_directories(/usr/local/lib)
link_libraries(/usr/local/lib)
set(Ldir "/usr/local/lib")
target_link_libraries(${PROJECT_NAME}
${Ldir}/libortools.so
${LD_FLAGS})