Click here to Skip to main content
15,919,358 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionAssigning tasks problem Pin
Wjousts21-Sep-07 7:25
Wjousts21-Sep-07 7:25 
AnswerRe: Assigning tasks problem Pin
Shog921-Sep-07 8:17
sitebuilderShog921-Sep-07 8:17 
GeneralRe: Assigning tasks problem Pin
Wjousts21-Sep-07 8:22
Wjousts21-Sep-07 8:22 
QuestionNesting and Optimization Logic Process Pin
ruready51120-Sep-07 15:15
ruready51120-Sep-07 15:15 
AnswerRe: Nesting and Optimization Logic Process Pin
Hoss Fly20-Sep-07 20:30
Hoss Fly20-Sep-07 20:30 
GeneralRe: Nesting and Optimization Logic Process Pin
ruready51121-Sep-07 3:54
ruready51121-Sep-07 3:54 
GeneralRe: Nesting and Optimization Logic Process Pin
Hoss Fly21-Sep-07 14:04
Hoss Fly21-Sep-07 14:04 
AnswerRe: Nesting and Optimization Logic Process [modified] Pin
cp987621-Sep-07 19:43
cp987621-Sep-07 19:43 
I think you might be able to get a long way by using a multiple knapsack algorithm. The knapsack problem is to select a combination of N items with weights {Wi} to fill a knapsack with capacity K. The multiple knapsack problem tries to fill M knapsacks with capacities {Kj} from the N weights {Wi}. In your case the knapsacks are the available beamlengths. So if for one beam size the available beamlength is 20' and you need lengths {10', 6', 8', 12', 15', 2', 5', 7', 8'} then you need 73' of beam, so try to fill 4 knapsacks of 20'. If the algorithm fails, try to fill 5 etc...

One standard multiple knapsack code is http://www.netlib.org/toms/632[^].

Once you know how many beams you need you can then cope with bundling.




-- modified at 2:22 Saturday 22nd September, 2007

The multiple knapsack algorithm also allows you to include arbitrary beam lengths in your own inventory. So for the example given, if you had a 14' length of beam on hand, you could try to solve for 4 knapsacks {14, 20, 20, 20} and if this didn't work then add an additional 20' knapsack. This way you will continually use up your inventory



Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: Nesting and Optimization Logic Process Pin
Hoss Fly21-Sep-07 20:46
Hoss Fly21-Sep-07 20:46 
GeneralRe: Nesting and Optimization Logic Process Pin
ruready51122-Sep-07 18:33
ruready51122-Sep-07 18:33 
GeneralRe: Nesting and Optimization Logic Process Pin
Hoss Fly23-Sep-07 4:30
Hoss Fly23-Sep-07 4:30 
GeneralRe: Nesting and Optimization Logic Process Pin
cp987622-Sep-07 21:38
cp987622-Sep-07 21:38 
QuestionCalculating work-hour-only time differences Pin
sushicw18-Sep-07 7:43
sushicw18-Sep-07 7:43 
AnswerRe: Calculating work-hour-only time differences Pin
Dan Neely18-Sep-07 7:52
Dan Neely18-Sep-07 7:52 
QuestionCalculate lateral acceleration Pin
AlexB4718-Sep-07 2:25
AlexB4718-Sep-07 2:25 
AnswerRe: Calculate lateral acceleration Pin
Russell'18-Sep-07 4:27
Russell'18-Sep-07 4:27 
AnswerRe: Calculate lateral acceleration Pin
El Corazon18-Sep-07 5:17
El Corazon18-Sep-07 5:17 
GeneralRe: Calculate lateral acceleration Pin
AlexB4726-Sep-07 5:15
AlexB4726-Sep-07 5:15 
GeneralRe: Calculate lateral acceleration Pin
El Corazon26-Sep-07 6:39
El Corazon26-Sep-07 6:39 
QuestionNeural Network Pin
tanj005617-Sep-07 0:04
tanj005617-Sep-07 0:04 
AnswerRe: Neural Network Pin
ic3b3rg317-Sep-07 4:48
ic3b3rg317-Sep-07 4:48 
GeneralRe: Neural Network Pin
tanj005618-Sep-07 4:51
tanj005618-Sep-07 4:51 
QuestionHamiltonian algorithms Pin
Patrick Etc.16-Sep-07 12:05
Patrick Etc.16-Sep-07 12:05 
AnswerRe: Hamiltonian algorithms Pin
Tim Craig17-Sep-07 17:59
Tim Craig17-Sep-07 17:59 
GeneralRe: Hamiltonian algorithms Pin
Patrick Etc.18-Sep-07 6:45
Patrick Etc.18-Sep-07 6:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.