This file is indexed.

/usr/share/mozart/doc/fdt/node44.html is in mozart-doc 1.4.0-8ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>10.1 Example: Aligning for a Photo, Revisited</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node43.html">- Up -</A></TD><TD><A href="node45.html#section.bab.warehouses">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.bab.align"><H2><A name="section.bab.align">10.1 Example: Aligning for a Photo, Revisited</A></H2><P>In <A href="node37.html#section.reified.photo">Section&nbsp;8.2</A> we have searched for a solution of the alignment problem which satisfies the maximal number of preferences. To this aim we have introduced a variable which counts the number of satisfied preferences. By distributing this variable with its maximal value first, we have guaranteed that the first solution found is indeed the optimal one. </P><P>In this section we replace this ad-hoc approach by branch and bound. We first restate the script for the problem by omitting the distribution code for the variable summing up the satisfied preferences. The resulting script is shown in <A href="node44.html#progphotorevised">Figure&nbsp;10.1</A>. </P><DIV id="progphotorevised"><HR><P><A name="progphotorevised"></A></P><DL class="anonymous"><DD class="code"><CODE><SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">RevisedPhoto</SPAN>&nbsp;Root}<BR>&nbsp;&nbsp;&nbsp;Persons&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;[betty&nbsp;chris&nbsp;donald&nbsp;fred&nbsp;gary&nbsp;mary&nbsp;paul]<BR>&nbsp;&nbsp;&nbsp;Preferences&nbsp;&nbsp;&nbsp;=&nbsp;[betty<SPAN class="keyword">#</SPAN>gary&nbsp;betty<SPAN class="keyword">#</SPAN>mary&nbsp;&nbsp;chris<SPAN class="keyword">#</SPAN>betty&nbsp;chris<SPAN class="keyword">#</SPAN>gary<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fred<SPAN class="keyword">#</SPAN>mary&nbsp;&nbsp;fred<SPAN class="keyword">#</SPAN>donald&nbsp;paul<SPAN class="keyword">#</SPAN>fred&nbsp;&nbsp;&nbsp;paul<SPAN class="keyword">#</SPAN>donald]<BR>&nbsp;&nbsp;&nbsp;NbPersons&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;{Length&nbsp;Persons}<BR>&nbsp;&nbsp;&nbsp;Alignment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;{FD<SPAN class="keyword">.</SPAN>record&nbsp;alignment&nbsp;Persons&nbsp;1<SPAN class="keyword">#</SPAN>NbPersons}<BR>&nbsp;&nbsp;&nbsp;Satisfaction&nbsp;&nbsp;=&nbsp;{FD<SPAN class="keyword">.</SPAN>decl}&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Satisfied</SPAN>&nbsp;P<SPAN class="keyword">#</SPAN>Q&nbsp;S}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FD<SPAN class="keyword">.</SPAN>reified<SPAN class="keyword">.</SPAN>distance&nbsp;Alignment<SPAN class="keyword">.</SPAN>P&nbsp;Alignment<SPAN class="keyword">.</SPAN>Q&nbsp;<SPAN class="string">'=:'</SPAN>&nbsp;1&nbsp;S}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Root&nbsp;=&nbsp;r(satisfaction:&nbsp;Satisfaction<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alignment:&nbsp;&nbsp;&nbsp;&nbsp;Alignment)<BR>&nbsp;&nbsp;&nbsp;{FD<SPAN class="keyword">.</SPAN>&nbsp;distinct&nbsp;Alignment}<BR>&nbsp;&nbsp;&nbsp;{FD<SPAN class="keyword">.</SPAN>sum&nbsp;{Map&nbsp;Preferences&nbsp;Satisfied}&nbsp;<SPAN class="string">'=:'</SPAN>&nbsp;Satisfaction}<BR>&nbsp;&nbsp;&nbsp;Alignment<SPAN class="keyword">.</SPAN>fred&nbsp;<SPAN class="keyword">&lt;:</SPAN>&nbsp;Alignment<SPAN class="keyword">.</SPAN>betty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;<SPAN class="comment">breaking&nbsp;symmetries<BR></SPAN>&nbsp;&nbsp;&nbsp;{FD<SPAN class="keyword">.</SPAN>distribute&nbsp;split&nbsp;Alignment}<BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><P class="caption"><STRONG>Figure&nbsp;10.1:</STRONG> The revised script for the Photo Puzzle.</P><HR></DIV><P> </P><P>Next we define an ordering procedure which states that the overall sum of satisfied preferences in an alternative solution must be strictly greater than the corresponding sum in a previous solution: </P><DL class="anonymous"><DD class="code"><CODE><SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">PhotoOrder</SPAN>&nbsp;Old&nbsp;New}<BR>&nbsp;&nbsp;&nbsp;Old<SPAN class="keyword">.</SPAN>satisfaction&nbsp;<SPAN class="keyword">&lt;:</SPAN>&nbsp;New<SPAN class="keyword">.</SPAN>satisfaction<BR><SPAN class="keyword">end</SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE></DD></DL><P> The optimal solution can be found with the statement </P><DL class="anonymous"><DD class="code"><CODE>{ExploreBest&nbsp;RevisedPhoto&nbsp;PhotoOrder}</CODE></DD></DL><P> We obtain the same solution as in <A href="node37.html#page.reified.photosol">*</A>. But now only 141 choice nodes are needed to find the optimal solution whereas 219 choice nodes were needed in <A href="node37.html#section.reified.photo">Section&nbsp;8.2</A>. Furthermore, branch and bound allows us to prove in an efficient way that the last solution found is really the optimal one. The full search tree (including the proof of optimality) contains 169 choice nodes; still less than for the search for the best solution with the ad-hoc method. If we inspect the solutions, we observe that the first solution satisfies only a single preference. By imposition of the ordering procedure by the search engine, the next found solution must satisfy more preferences. Indeed, the second solution satisfies two preferences. Following this approach we finally arrive at the optimal solution with six satisfied preferences.</P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node43.html">- Up -</A></TD><TD><A href="node45.html#section.bab.warehouses">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A> and&nbsp;<A href="http://www.ps.uni-sb.de/~smolka/">Gert&nbsp;Smolka</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>