title: Solving an assignment with many preassignments
body: <p>The problem I want to solve consists of about <strong>800 tasks</strong> that have to be assigned to about <strong>120 workers</strong>. The workers have to be qualified to do the task and only have a certain number of hours per week available. About 80% of the assignments are already <strong>preassigned</strong>. This means they should be kept, but if the other 20% cannot be solved, the preassignments can be violated. <br>
  I already have a model using the Choco solver that uses penalties if a preassignment is violated and the objective is to minimize the penalty. I however think that this is not very efficient, because the solver will not start the search strategy with assigning the preassigned variables. I already asked the question specifically for Choco here (<a href="https://stackoverflow.com/questions/38009450/how-to-define-propagation-starting-point-in-choco-3-3">How to define propagation starting point in Choco 3.3</a>).</p>
  
  <p>But is there another solver where this can be done easier? May it be best to write my own solver?
  I would appreciate any suggestions.</p>
  
  <p>EDIT:
  I have tried writing my own Choco strategy. For a small problem it works fine, but for the big one it does not find a solution. I am not sure if everything I do in getDecision is allowed (eg check for isInstantiated) and I can't find any documentation or tutorial on how to write a strategy extending AbstractStrategy. I'd  appreciate any pointers on what could be the problem.
  (The higher the absolute priority in the prios matrix is, the earlier the variable should be assigned. If the priority is negative, a 0 should be assigned, if it is positive a 1 should be assigned. The highest priority is 9999) </p>
  
  <pre><code>    public class PriorityStrategy extends AbstractStrategy&lt;IntVar&gt; {
  
          int[] prios;
  
          // Search strategy parameters
          VariableSelector&lt;IntVar&gt; variableSelector;
          IntValueSelector valueSelectorLB;
          IntValueSelector valueSelectorUB;
          DecisionOperator&lt;IntVar&gt; decisionOperator;
  
          // object recycling management
          PoolManager&lt;IntDecision&gt; decisionPool;
  
          int currentIndex = -1;
          HashMap&lt;IntVar, Integer&gt; bestsMap = new HashMap&lt;IntVar, Integer&gt;();
  
          public PriorityStrategy(IntVar[] vars, int[] prios) {
              super(vars);
              this.prios = prios;
              valueSelectorLB = new IntDomainMin();
              valueSelectorUB = new IntDomainMax();
              variableSelector = new Random&lt;IntVar&gt;(123); //new Occurrence&lt;IntVar&gt;();
              this.decisionPool = new PoolManager&lt;&gt;();
          }
  
          @Override
          public Decision&lt;IntVar&gt; getDecision() {
               IntVar next = null;
               List&lt;IntVar&gt; bests = new ArrayList&lt;IntVar&gt;();
  
               int bestPrio = 0;
               for (int i = 0; i &lt; vars.length; i++) {
                  int currentPrio = Math.abs(prios[i]);
                  if (currentPrio &gt;= bestPrio &amp;&amp; !vars[i].isInstantiated() || 
                          (next == null &amp;&amp; !vars[i].isInstantiated())) {
                      if(currentPrio == 9999) {
                          currentIndex = i;
                          bests.clear();
                          bestsMap.clear();
                          return computeDecision(vars[i]);
                      }
                      if(currentPrio &gt; bestPrio) {
                          bestPrio = currentPrio;
                          bests.clear();
                          bestsMap.clear();
                      }
                      bests.add(vars[i]);
                      bestsMap.put(vars[i], i);
                  }
              }
              if(bests.size()&gt;0) {
                  next = variableSelector.getVariable(bests.toArray(new IntVar[bests.size()]));
                  currentIndex = bestsMap.get(next);
              }
              return computeDecision(next);
          }
  
          @Override
          public Decision&lt;IntVar&gt; computeDecision(IntVar variable) {
              if (variable == null || variable.isInstantiated()) {
                  return null;
              }
              int currentVal;
              if(prios[currentIndex] &gt; 0){
                  currentVal = valueSelectorUB.selectValue(variable);
              } else {
                  currentVal = valueSelectorLB.selectValue(variable);         
              }
              System.out.println("Idx " + currentIndex);
              IntDecision current = decisionPool.getE();
              if (current == null) {
                  current = new IntDecision(decisionPool);
              }
              current.set(variable, currentVal, DecisionOperator.int_eq);
              return current;
          }
  
      }
  </code></pre>