% measure-command {minizinc -s .\newgraph.mzn .\ConvertedInstances03\path100.dzn} include "alldifferent.mzn"; int: maxDegree; % graph degree int: lb; % upward rounding of maxdegree/2 int: ub; % min of % -graph bandwidth (type cyclic bandwith but the % distance is different, only the absolute value) % -downward rounding of order/2 int: order; % number of vertices int: nedges; % number of edges int: d_max=order-1; % max possible distance set of int: node = 1..order; % vertices labels set of int: distance = 1..d_max; % distance range var 1..d_max: bandwidth; % bandwidth is a distance % var lb..d_max: cyclicbandwidth; % with a better simple bound % var lb..ub: cyclicbandwidth; % simple lb, but complex ub array[node] of var node: g; % graph labels array[1..nedges,1..2] of int: edges; % array of nedeges edges array[1..nedges] of var distance: dist; % distances associated to each edge % constraints for distances between connected vertices constraint forall (i in 1..nedges) ( let {var int: v1=edges[i,1], var int: v2=edges[i,2]} in let {var int: d=abs(g[v2]-g[v1])} in dist[i] = d ); constraint all_different(g); constraint bandwidth = max(dist); % search strategy solve :: seq_search ([ int_search([bandwidth],first_fail,indomain_min,complete), int_search(g,first_fail,indomain_min,complete)%, %int_search(dist,first_fail,indomain_min,complete) ]) minimize bandwidth;