Since no one else has responded...
Depending on your objectives and the nature of the data, you might try
a heuristic exploration, finding good neighborhoods at low resolution,
and then exploring nearby placement at higher resolutions. Low-res can
also be a nice place to apply any placement policy heuristics which the
client adds later. :)
Eg, start with a shrunk problem of a <C/10 x D/10> on <A/10 x B/10>
(~x10000 shrink) grayscale placement. You can both prune ("this placement
is so bad I'm not going to bother with it further"), and pursue ("this
area is so great, I'm going to zoom in now"). You might include a x/3
stage in between x/10 and x/1. Maybe. And perhaps a sorted "how good
it looks" list of regions, at various resolutions, which are waiting to
be explored.
But this doesn't work with some flavors of data. And non-deterministic
performance, even if bounded, is undesirable in some UI situations.
And beware the tarpit potential of "it's not working reliably now, but
maybe if I tweak and complexify a bit, it will". Run, run away.
But one can do a simple version quickly, and if it works...
Mitchell
Message-ID: <[EMAIL PROTECTED]>
From: Komtanoo Pinpimai <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [Boston.pm] least overlap co-ordinate
Sender: [EMAIL PROTECTED]
Date: Tue, 04 Feb 2003 14:17:20 +0700
Hello,
I have to solve a real world problem; it is:
There are 2 black-white rectangular images (each one kept in 2d array,
0/1 as black/white).
First rectangular has A and B as its sides.
Second rectangular has C and D as its sides. C is less than A and D is
less than B.
I want to place the second rectangular into the first one with the least
overlaped pixels. (the second regtangular can be placed exceedingly the
bound of the larger reg., but it is worse than overlaped pixel)
With a brute-force algorithm, it tries to generate the smaller images in
all top-left co-ordinates in C x D and determine overlaped pixels and
exceeded pixels; and return the best top-left co-ordinate.
Approximately, the algorithm takes A x B x C x D comparisons.
Do anyone know other better solutions?
--
$_=`perldoc -U -q "What is a"`;m/"(.*?)"/;print$1
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm