<commit_before>var util = require('util');
var Flowshop = require('./flowshop');
var Helper = require('./helper.js');

// NEH algorithm by Nawaz, Enscore, Ham
function NEH() {
}
util.inherits(NEH, Flowshop);
exports.makespan = NEH.prototype.makespan;

// NEH heuristic
NEH.prototype.order = function(data, initialSeed) {
    var pi = Helper.sort(data);
    var neh = [Helper.get(pi, 1), Helper.get(pi, 2)];
    if(Helper.makespan(neh) > Helper.makespan(Helper.toggle(neh, 1, 2))) {
        neh = Helper.toggle(neh, 1, 2);
    }
    for(var i = 3; i < pi.length + 1; i++) {
        var sequence = Helper.insertBefore(neh, 1, Helper.get(pi, i));
        var value = Helper.makespan(sequence);
        var minSequence = sequence;
        var minValue = value;
        for(var j = 1; j < neh.length + 1; j++) {
            sequence = Helper.toggle(sequence, j, j + 1);
            value = Helper.makespan(sequence);
            if(value < minValue) {
                minSequence = sequence;
                minValue = value;
            }
        }
        neh = minSequence;
    }
    return neh;<commit_msg>Operator modified<commit_after>var util = require('util');
var Flowshop = require('./flowshop');
var Helper = require('./helper.js');

// NEH algorithm by Nawaz, Enscore, Ham
function NEH() {
}
util.inherits(NEH, Flowshop);
exports.makespan = NEH.prototype.makespan;

// NEH heuristic
NEH.prototype.order = function(data, initialSeed) {
    var pi = Helper.sort(data);
    var neh = [Helper.get(pi, 1), Helper.get(pi, 2)];
    if(Helper.makespan(neh) > Helper.makespan(Helper.toggle(neh, 1, 2))) {
        neh = Helper.toggle(neh, 1, 2);
    }
    for(var i = 3; i <= pi.length; i++) {
        var sequence = Helper.insertBefore(neh, 1, Helper.get(pi, i));
        var value = Helper.makespan(sequence);
        var minSequence = sequence;
        var minValue = value;
        for(var j = 1; j < neh.length + 1; j++) {
            sequence = Helper.toggle(sequence, j, j + 1);
            value = Helper.makespan(sequence);
            if(value < minValue) {
                minSequence = sequence;
                minValue = value;
            }
        }
        neh = minSequence;
    }
    return neh;
{'fraction_non_alphanumeric': 0.14744459520578923, 'fraction_numerical': 0.010402532790592492, 'mean_word_length': 2.3515151515151516, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '266816', 'n_tokens_mistral': 769, 'n_tokens_neox': 718, 'n_words': 177}