HP3000-L Archives

September 1995, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mel Bartels <[log in to unmask]>
Reply To:
Mel Bartels <[log in to unmask]>
Date:
Thu, 31 Aug 1995 22:42:31 PDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
A couple of weeks ago I posed a programming question:
 
given a list of objects, a,b,c,d,e,...
 
what is the best way (speed, non-recursive cobol code) to go about finding
every possible combination of objects where objects can be combined together
in groups from 1 object to 3 objects, ie,
 
possibilities would include, a, b+g, c+f+h, c, d+e, g,
 
and so forth.  The idea was to optimize objects so that they would fit
certain given sizes with most minimal deviation.
 
I wanted to thank the two people who responded with suggestions.
 
By implementing a table, or queue, where each level consisted of 1 to 3
objects, and where each level would move through its possibilities (when
lowest level finished with all possibilities, then, completely done),
waiting for all subsequent levels to finish their possibilities, and by
carefully eliminating duplicates, and groupings of objects that failed to
meet certain tests, I was able to make this work for object lists of up to
60 or so objects.
 
Mel Bartels
programmer/technical analyst
Willamette Ind.
Eugene Oregon

ATOM RSS1 RSS2