Thank you for your answer! Here's the relevant piece of my code
Distance cost_callback = new Distance(manager, costMatrix);
int costCallbackIndex = routing.RegisterTransitCallback(cost_callback.Call);
routing.SetArcCostEvaluatorOfAllVehicles(costCallbackIndex);
// set up counter
routing.AddConstantDimension(
1,
outputData.Count + 1, //maximum capacity of vehicle
false, //start cumul to zero
"Counter"); //dimension name
RoutingDimension countDimension = routing.GetMutableDimension("Counter");
// set up orders
for (int order = 0; order != outputData.Count; order++)
{
long ordidx = manager.NodeToIndex(order);
long[] orders = { ordidx };
routing.AddDisjunction(orders, 999999999999999999);
if (outputData[order].FixedPosition != default)
{
countDimension.CumulVar(ordidx).SetValue(outputData[order].FixedPosition);
}
else
{
countDimension.CumulVar(ordidx).SetRange(0, outputData.Count + 1);
}
}
outputData contains list of nodes, together with the desired "fixed" positions, costMatrix contains the distance of nodes - the longest distance between two nodes is 55.
If certain node has a fixed position in than this is assigned to it as constraint, otherwise value can be assigned from the whole range of positions.
Perhaps, could it be problem that when no fixed position is assigned to a node, then from the whole range of positions any can be assigned and the solver assignes such position which is also assigned to other node as fixed one? This way, two nodes would be assigned to the same position and it's impossible as one vehicle cannot be at two nodes in the same time.
Hope, you see what I mean! Thank you in advance for any piece of advices!
Zoltan