ratio approximation algorithm
- From: "Mark Maglana" <mmaglana@xxxxxxxxx>
- Date: 14 Aug 2005 21:59:20 -0700
Hello,
I'm trying to find the most effective algorithm for solving a certain
problem in our shop. The case is this: there are times when we are
supposed to find a combinationof 4 tools that approximates a certain
ratio. The computation is as follows:
(A/B)x(C/D) = X
The possible values for tools A, B, C, and D ranges from 10 to 120.
Sometimes, however, this range changes.
What happens here is that we are given a value for X, a ratio which may
or may not be a whole number. We're supposed to find the combination
for A, B, C, and D that produces X or a value that closely approximates
it. Most of the time, we are given a tolerance which varies. Sometimes
that tolerance is 0.0005, sometimes it's 0.000001.
Now, I have a bit of programming background and tried producing a
program that will speed up this searching process. However, I could
only muster a brute force method of searching which is hardly an
elegant solution. Furthermore, there are certain ratios where brute
force will take forever to solve. My workaround was to provide an
option to the user that specifies the search's starting point (example,
start at 50, instead of 10) as well as the direction (search up or
down). Still there are times when the search takes a while and it
becomes more of a trial and error practice.
So right now, I'm looking for an algorithm other than brute force that
will speed up the searching process. Anyone know of one?
.
- Follow-Ups:
- Re: ratio approximation algorithm
- From: websnarf
- Re: ratio approximation algorithm
- From: Tim Rentsch
- Re: ratio approximation algorithm
- From: CTips
- Re: ratio approximation algorithm
- From: CBFalconer
- Re: ratio approximation algorithm
- From: googmeister
- Re: ratio approximation algorithm
- From: Richard Heathfield
- Re: ratio approximation algorithm
- Prev by Date: Re: Industry Calls for More Foreign Programmers
- Next by Date: Re: Chat Room Bots
- Previous by thread: Fulltime contracting? Which field?
- Next by thread: Re: ratio approximation algorithm
- Index(es):
Relevant Pages
|