idol
v0.8.0-alpha
偶像是用於數學優化和復雜決策的C ++庫。
它旨在幫助您輕鬆構建新算法,以解決越來越具有挑戰性的問題。它是一種多功能且功能強大的工具,可用於解決廣泛的優化問題,包括混合智能線性編程(MILP),四次限制的問題(MIQCQP和MIQP),二聚體問題(BO),強大的優化問題(ROB)。
訪問我們的在線文檔。
如果您選擇一個研究項目中的偶像並遇到一些問題,請通過Lefebvre(at)Uni-Trier.de與我們聯繫。
查看使用偶像實現分支機構和價格算法的容易性。
const auto [model, decomposition] = create_model(); // Creates the model with an annotation for automatic decomposition
const auto sub_problem_specifications =
DantzigWolfe::SubProblem ()
.add_optimizer(Gurobi()); // Each sub-problem will be solved by Gurobi
const auto column_generation =
DantzigWolfeDecomposition (decomposition)
.with_master_optimizer(Gurobi::ContinuousRelaxation()) // The master problem will be solved by Gurobi
.with_default_sub_problem_spec(sub_problem_specifications);
const auto branch_and_bound =
BranchAndBound ()
.with_node_selection_rule(BestBound()) // Nodes will be selected by the "best-bound" rule
.with_branching_rule(MostInfeasible()) // Variables will be selected by the "most-fractional" rule
.with_log_level(Info, Blue);
const auto branch_and_price = branch_and_bound + column_generation; // Embed the column generation in the Branch-and-Bound algorithm
model.use(branch_and_price);
model.optimize();在這裡,偶像使用外部求解器硬幣或/MIB來解決整數較低級別的二元優化問題。
/*
This example is taken from "The Mixed Integer Linear Bilevel Programming Problem" (Moore and Bard, 1990).
min -1 x + -10 y
s.t.
y in argmin { y :
-25 x + 20 y <= 30,
1 x + 2 y <= 10,
2 x + -1 y <= 15,
2 x + 10 y >= 15,
y >= 0 and integer.
}
x >= 0 and integer.
*/
Env env;
// Define High Point Relaxation
Model high_point_relaxation (env);
auto x = high_point_relaxation.add_var( 0 , Inf, Integer, " x " );
auto y = high_point_relaxation.add_var( 0 , Inf, Integer, " y " );
high_point_relaxation.set_obj_expr(-x - 10 * y);
auto follower_c1 = high_point_relaxation.add_ctr(- 25 * x + 20 * y <= 30 );
auto follower_c2 = high_point_relaxation.add_ctr(x + 2 * y <= 10 );
auto follower_c3 = high_point_relaxation.add_ctr( 2 * x - y <= 15 );
auto follower_c4 = high_point_relaxation.add_ctr( 2 * x + 10 * y >= 15 );
// Prepare bilevel description
Bilevel::LowerLevelDescription description (env);
description.set_follower_obj_expr(y);
description.set_follower_var(y);
description.set_follower_ctr(follower_c1);
description.set_follower_ctr(follower_c2);
description.set_follower_ctr(follower_c3);
description.set_follower_ctr(follower_c4);
// Use coin-or/MibS as external solver
high_point_relaxation.use(Bilevel::MibS(description));
// Optimize and print solution
high_point_relaxation.optimize();
std::cout << high_point_relaxation.get_status() << std::endl;
std::cout << high_point_relaxation.get_reason() << std::endl;
std::cout << save_primal(high_point_relaxation) << std::endl;偶像也可以與root連接以監視算法的進度。例如,這是對MIBS監視二線實例的屏幕截圖。
偶像可以用作幾個開源或商業求解器的統一接口
這是根據Dolan,E。 ,Moré,J。基準優化軟件計算的性能配置文件。數學。程式. 91,201–213(2002) https://doi.org/10.1007/s101070100263。
版本WANDANing符合語義版本wanding 2.0.0。