//import java.io.*; //import java.util.*; //import java.util.Arrays; //import java.util.Collections; import org.chocosolver.solver.*; import org.chocosolver.solver.variables.*; import org.chocosolver.solver.constraints.*; import org.chocosolver.solver.search.strategy.*; public class Choco extends MWC { Solver solver; // a solver object, to attach variables and constraints IntVar[] vertex; // vertex[i] = 1 <-> ith vertex selected IntVar totalWeight; // sum of weights of selected vertices int minWeight; // minimum vertex weight int sumWeight; // sum of weights int [][] adjacent; // permuted adjacency matrix A public Choco (int n,int[][]A,int[] degree,int[] weight,int style) { super(n,A,degree,weight,style); minWeight = Integer.MAX_VALUE; sumWeight = 0; solver = new Solver(); vertex = VF.enumeratedArray("vertex",n,0,1,solver); adjacent = new int[n][n]; // permute the graph orderVertices(); for (int i=0;i