Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion examples/tsptw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,15 @@ class TSPTW : public IntMinimizeScript {
rel(*this, pos[j-1] < pos[k-1]);
element(*this, from, x[0], c[0]);
rel(*this, t[0] == max(element(ready,x[0]), c[0]));
// Travel time between consecutive customers
TupleSet legs(3);
for (int j=1; j<n; j++)
for (int k=1; k<n; k++)
if (j != k)
legs.add({j, k, d[j*n+k]});
legs.finalize();
for (int i=1; i<n-1; i++) {
element(*this, d, x[i], n, x[i-1], n, c[i]);
extensional(*this, IntVarArgs({x[i-1], x[i], c[i]}), legs);
rel(*this, t[i] == max(element(ready,x[i]), t[i-1]+c[i]));
}
for (int i=0; i<n-1; i++)
Expand Down
8 changes: 7 additions & 1 deletion gecode/search.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,13 @@ namespace Gecode { namespace Search {
* the second space is matched by a completion of the first that is not
* worse. It must be transitive. CABS uses it to prune nodes in the same
* layer. If a dominance key is given, only nodes with equal keys are
* compared.
* compared. Without a key, every node offered to the beam is compared
* with every node already in it.
*
* A* and CABS clone and propagate every child of every node they
* expand, also close to the root where domains are large. The cost of a
* node is thus a clone plus propagation at shallow depth, so models
* should use propagators that stay cheap there.
*
* Callbacks must only read the space passed to them. With several threads
* they can run concurrently.
Expand Down
Loading