There is no quick fix (like setting dist and dur to specific values)
to implement this. You need to enforce those constraints during the
solver routine, for instance by checking that B has been visited
already when adding C to a solution. The easiest algorithm to modify
will be tspBruteForce (this will not work for more than ~12
locations). At the beginning of that routine, you would check that the
dependencies of the current node have all been visited:
for (var i = 0; i < dependencies.length; i++) {
if (!visited[dependencies[i]]) {
return; // Cut off the search if not all the dependencies of this
node have already been visited.
}
}
Geir