结论

Gurobi

原文使用了Gurobi

请参见代码ProteinComparison_Gurobi.py
运行结果如下

Maximum number of edge matches: 5
Edge (1, 2) in G1 is mapped with edge (2, 3) in G2
Edge (3, 4) in G1 is mapped with edge (4, 6) in G2
Edge (3, 5) in G1 is mapped with edge (4, 7) in G2
Edge (5, 6) in G1 is mapped with edge (7, 8) in G2
Edge (8, 9) in G1 is mapped with edge (9, 10) in G2

COPT

COPT 无法对该模型做出正确的判断

在该模型中,对于同一个.lp.mps文件,使用Gurobi求解,能得到Optimal solution

而对于COPT,返回的结果如下

COPT结果

Quadratic objective is not convex

所使用的代码如本文件夹附带的test.py

从结果来看,该模型被copt自动识别为MIQP模型,返回结果模型非凸

对此问题我也发邮件咨询过COPT的技术支持,但并未得到回复

COPT求助

于是弃用此求解器

  • 2023.10.23 收到了来自COPT官方的回复,回复如下

COPT官方回复

他们表示没有做出非凸的求解器,仍在开发

OR-tools

请参见代码ProteinComparison_ORTOOLS.py

返回结果如下

Maximum number of edge matches: 9
Edge (3, 4) in G1 is mapped with edge (4, 6) in G2
Edge (3, 5) in G1 is mapped with edge (4, 7) in G2
Edge (5, 6) in G1 is mapped with edge (7, 8) in G2
Edge (8, 9) in G1 is mapped with edge (10, 11) in G2