我遇到了这个问题:Java接口立即返回一个所谓的最优解决方案( problem is solved [optimal solution found] ),但是没有考虑一些约束 - 生成的解决方案是零解决方案(实际上不是解决方案) . 我've tried running the same problem in scip binary in the terminal, and works fine. This is the problem that I'米测试:

param fichier:="/home/sebastien/workspace/DodenPlanning_teamDC/data.txt";
param nb_custom:= 11 ;
set Ind :=
{ read fichier as "<1s>" comment "#" use nb_custom} ;
param px[Ind] :=
read fichier as "<1s> 2n" comment "#" use nb_custom ; 
param py[Ind] :=
read fichier as "<1s> 3n" comment "#" use nb_custom;
defnumb dist(i,j)  := sqrt((px[i]-px[j])^2 + (py[i]-py[j])^2) ;
var x[Ind*Ind] binary ;
var r[Ind] integer <= card(Ind) - 1  ; # depot has rank 0, others have ranks 1 .. nb_points
minimize cost: sum <i,j> in Ind*Ind : dist(i,j) * x[i,j] ;
subto unique_predecessor : forall <j> in Ind do sum <i> in Ind : x[i,j]==1;
subto unique_successor : forall <j> in Ind do sum <k> in Ind : x[j,k]==1;
subto first_rank : r["0"] == 0 ; # because 0 is the starting point.
subto other_rank : # if there is edge i-> j then rank(j) = rank(i) + 1 
    forall <i,j> in Ind*Ind  with j != "0" do
        vif x[i,j] == 1 then r[j] == r[i] + 1 end ;

这是VPR问题的模型化 . 接口返回的解决方案是一个解决方案,其中每个顶点仅链接到自己(因为这最小化了成本:等于0),但这不是考虑其他约束的解决方案 .

我们已经验证它不是翻译问题:问题文件是通过简单手动生成的,并且由终端中的二进制文件和Java接口解决 .

该文件由两者读取:它生成相同数量的变量,约束等 . 在Java接口中约束的数量是否受限?我们解决了较小的问题

Java接口中的约束数量是否受限?我们已经解决了在scip二进制文件和Java接口中返回相同解决方案的较小问题 .