https://developers.google.com/optimization/cp/cp_solver
我正在尝试使用C ++进行编码,以使用上面与python演示的链接中所述的新cp SAT求解器,但是我无法弄清楚如何以C ++代码语法获取此CP SAT求解器,不确定是哪种其他类型的除了“ ortools / constraint_solver / constraint_solver.h”之外,新的Cp解算器实际上还需要包含。 “ ortools / sat / cp_constraints.h” “ ortools / sat / cp_model.pb.h”
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})