This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: N; | |
int: M; | |
set of int: JOBS = 1..N; | |
set of int: MACHINES = 1..M; | |
array[JOBS, MACHINES] of int: durations; | |
array[JOBS, MACHINES] of int: steps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: N; | |
int: M; | |
set of int: CARS = 1..N; | |
set of int: MACHINES = 1..M; | |
array[CARS, MACHINES] of int: durations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: N; | |
set of int: NODES = 1..N; | |
int: E; | |
set of int: EDGES = 1..E; | |
int: M; | |
set of int: MANDATORY = 1..M; | |
array[EDGES] of int: from; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: N; | |
set of int: LOCATION = 1..N; | |
array[LOCATION, LOCATION] of int: flow; | |
array[LOCATION, LOCATION] of int: distances; | |
array[LOCATION] of var LOCATION: location_assignments; | |
constraint alldifferent(location_assignments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Method: we build a directed graph, with edges | |
%% {from, to} representing a pair of consequent non-overlapping tasks. | |
%% That is, `end_time(from) < start_time(to)` | |
%% Then we constrain a list of tasks for each crew as a path in this graph. | |
%% Finally, we constrain the lists to be disjoint. | |
include "globals.mzn"; | |
int: T; | |
int: C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
include "gecode.mzn"; | |
% | |
% Data | |
% | |
int: N; % number of nodes | |
set of int: NODE = 1..N; | |
array[NODE, NODE] of int: distances; % distance matrix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
% Number of components | |
int: N; | |
set of int: COMPONENTS = 1..N; | |
% Number of connections | |
int: C; | |
set of int: CONNECTIONS = 1..C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
% Number of items | |
int: N; | |
% Bin capacity | |
int: C; | |
set of int: ITEMS = 1..N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: NUM_SEGMENTS; | |
int: NUM_SUBSETS; | |
set of int: SUBSETS = 1..NUM_SUBSETS; | |
set of int: SEGMENTS = 1..NUM_SEGMENTS; | |
array[SUBSETS] of set of int: combinations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "globals.mzn"; | |
int: R = 4; | |
int: T = 4; | |
int: C = 4; | |
int: S = 30; | |
set of int: ROOM = 1..R; | |
set of int: CLASS = 1..C; | |
set of int: TEACHER = 1..T; |
NewerOlder