Better algorithm for a multi-variable gambling puzzle than brute force? -


i don't know name describe problem, i'm going set example of , ask algorithm better brute force solve.

there 6 buckets, each 1 different size, each 1 holding different starting volume. each bucket has link prize value - call money - dispensed when bucket full.

there 8 valves. each valve feeds different subset of buckets when opened, , each bucket can different amount added when valve opened. each valve has fixed cost turn.

partial example: bucket 1: 14 of 20 gallons. pays $2.00 bucket 2: 12 of 25 gallons. pays $1.50 bucket 3: 18 of 35 gallons. pays $4.00 etc...

valve 1: costs $0.50. puts 2 gallons in 2 , 1 gallon in 3. valve 2: costs $0.40. puts 3 gals in 1 , 5 gals in 2 etc...

so pay money turn valve, , if fill bucket win money.

objective: calculate best order of valves turn net profit when buckets fill up, if profitable combinations exist.

when bucket full, resets pre-set starting volume (which may different current volume - buckets retain state valve turn valve turn). theoretically there no limit number of resets 1 potentially turn valves forever.

the obvious solution here brute force. reset variables start position, turn 1 valve, test output, reset, iterate next valve, etc. after 8 turned, start turning 2 valves (11, 12, 13, 14, ... 25, 26, 27, 28). every time find combination fills @ least 1 bucket, calculate net gain/loss , compare against previous results determine best.

slow , crude. direct, slow , crude.

so:

  1. what name of type of problem? and
  2. is there known algorithm helps solve more efficiently?

to clear - math specifics aren't bit need improving - can calculate result of sequence of valve operations regardless of minor variations in math.

it's brute force iteration want avoid. not want 8 single operations (v1, v2, v3...), 64 double operations (v1v1, v1v2, v1v3, etc...), 512 triple operations (v1v1v1, v1v1v2, v1v1v3) if can avoid it.


Comments

Popular posts from this blog

Error while updating a record in APEX screen -

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

ios - Xcode 5 "No such file or directory" -