[Haskell-cafe] Re: combinatorial search with running bound
Chung-chieh Shan
ccshan at post.harvard.edu
Mon Sep 28 23:32:15 EDT 2009
Michael Mossey <mpm at alumni.caltech.edu> wrote in article <3942.75.50.175.130.1253997756.squirrel at mail.alumni.caltech.edu> in gmane.comp.lang.haskell.cafe:
> The problem is to determine how closely the groups can be brought together
> without any boxes intersection.
>
> The basic algorithm is to consider each pair of boxes and ask if they
> have any "vertical overlap"---if so, figure out how closely they can be
> brought together without intersecting, otherwise ignore them. Then take
> the maximum of those numbers.
Wouldn't you mean minimum instead of maximum then?
I suspect that your code would be clearer without using a state monad.
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Computer Science is no more about computers
than astronomy is about telescopes.
-Edsger Dijkstra
More information about the Haskell-Cafe
mailing list