glenn.langford@entrust.com (Glenn Langford) writes:
> And it works fine. I wanted to see what the intermediate solutions looked
> like as the program achieved better solutions, so I added a {Browse <old
> solution>} to the Order proc. I now see the intermediate solutions, but the
> each solution is repeated multiple times in the Oz Browser - as many as six
> different copies (I have not explicitly created multiple threads and there
> is no reason I know of why the same solution is being displayed multiple
> times).
This is perfectly normal. During best search, the best solution sofar
must be passed up the tree and the corresponding constraint injected
into the alternative right branch when we explore it. If you add
{Show x} to the Better predicate, you'll see that you get 41 of them
for the {MakeGolomb 9} example. If you count the branching points
where a constraint for the "best solution sofar" needs to be injected,
you will discover that there are 41 of them.
Consider the example of {MakeGolomb 4} which is somewhat smaller.
Here is the search tree in ASCII form:
Choice 1
+ Choice 2
+ Choice 3
+ Solution 1
+ Choice 4
+ Solution 2
+ Failure 1
+ Choice 5
+ Solution 3
+ Failure 2
+ Failure 3
Here it is again below annotated with the points where the Better
constraint for the last best solution found needs to be injected into
the right branch of a choice point before proceeding to explore said
branch:
Choice 1
+ Choice 2
+ Choice 3
+ Solution 1
+ (INJECT Better for Solution 1) Choice 4
+ Solution 2
+ (INJECT Better for Solution 2) Failure 1
+ (INJECT Better for Solution 2) Choice 5
+ Solution 3
+ (INJECT Better for Solution 3) Failure 2
+ (INJECT Better for Solution 3) Failure 3
You see: there are 5 injections necessary. Notice that at (Failure
1), the constraint space has both the Better constraint for (Solution
1) and for (Solution 2). However, at e.g. (Choice 5), we only have
the Better constraint for (Solution 2). Notice also that the Better
constraint for (Solution 2) needs to be injected at (Failure 1), but
also at (Choice 5). This is the apparent redundancy that you
observed, but it is not redundant. I hope this clears it up for you.
Cheers,
-- Denys Duchier - Équipe Calligramme - LORIA, Nancy, France - Please send submissions to users@mozart-oz.org and administriva mail to users-request@mozart-oz.org. The Mozart Oz web site is at http://www.mozart-oz.org/. Please send bug reports to bugs@mozart-oz.org.