This file contains hidden or 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
Beham, A., Affenzeller, M., & Wagner, S. (2017). Instance-based algorithm selection on quadratic assignment problem landscapes. In GECCO 2017 - Proceedings of the Genetic and Evolutionary Computation Conference Companion (pp. 1471-1478). (GECCO 2017 - Proceedings of the Genetic and Evolutionary Computation Conference Companion). ACM Sigevo. https://doi.org/10.1145/3067695.3082513 | |
@inproceedings{10.1145/3067695.3082513, | |
author = {Beham, Andreas and Affenzeller, Michael and Wagner, Stefan}, | |
title = {Instance-Based Algorithm Selection on Quadratic Assignment Problem Landscapes}, | |
year = {2017}, | |
isbn = {9781450349390}, | |
publisher = {Association for Computing Machinery}, | |
address = {New York, NY, USA}, | |
url = {https://doi.org/10.1145/3067695.3082513}, |
This file contains hidden or 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
% Use this editor as a MiniZinc scratch book | |
array[1..3] of var 0..9: code; | |
% count(code, X, c) says X must be part of code c times | |
% count_leq(code, X, c) says X must be part of code at least c times | |
% Either 6 is correct and there isn't 8 nor 2 or ... | |
constraint (code[1] == 6 /\ count(code, 8, 0) /\ count(code, 2, 0)) | |
\/ (count(code, 6, 0) /\ code[2] == 8 /\ count(code, 2, 0)) | |
\/ (count(code, 6, 0) /\ count(code, 8, 0) /\ code[3] == 2); |
This file contains hidden or 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: TOTAL = 49; | |
array[1..3,1..3] of var 1..TOTAL-3: x; | |
constraint x[2,2] = 21; | |
constraint alldifferent([x[i,j] | i in 1..3, j in 1..3]); | |
constraint forall(i in 1..3)(sum(j in 1..3)(x[i,j]) = TOTAL); | |
constraint forall(j in 1..3)(sum(i in 1..3)(x[i,j]) = TOTAL); | |
constraint sum(i in 1..3)(x[i,i]) = TOTAL; | |
constraint sum(i in 1..3)(x[4-i,i]) = TOTAL; |
This file contains hidden or 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
% A farmer has 300 bananas which she wants to sell at a market 100km away. | |
% Her camel can carry 100 bananas at once, and eats one banana per km. | |
% What is the most bananas she can bring to the market? | |
int: capacity = 100; | |
int: distance = 100; | |
int: init_stock = 300; | |
int: maxtrips = ceil(init_stock / capacity); | |
int: maxlegs = 4; % maximum amount of legs the journey is partitioned into, a leg consists of hauling a certain load over a certain distance |
This file contains hidden or 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
Consider a software that is customized for each client. It contains common components, modules, and | |
client-specific customizations thereof. For instance, | |
Common | |
+ Common.ClientA | |
+ Common.ClientB | |
ModuleA | |
+ ModuleA.ClientB | |
ModuleB | |
+ ModuleB.ClientA |
This file contains hidden or 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
public int BinarySearch<T>(IList<Tuple<T, double>> values, T value, IComparer<T> comparer = null) { | |
if (values.Count == 0) return -1; | |
if (comparer == null) comparer = Comparer<T>.Default; | |
var lower = 0; | |
var upper = values.Count - 1; | |
while (lower <= upper) { | |
var mid = (lower + upper) / 2; | |
var result = comparer.Compare(value, values[mid].Item1); | |
if (result == 0) return mid; | |
else if (result < 0) { // value < values[mid] |
This file contains hidden or 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
It would be nice in C# to have a foreach-else. | |
I would like the else branch to execute when the collection was empty. | |
In that sense, either I loop over a collection OR I execute this code. | |
This would change | |
var empty = true; | |
foreach (var e in enumeration) { | |
empty = false; | |
// ... |