Permutation algorithm??

This is a discussion on Permutation algorithm?? within the C++ Programming forums, part of the General Programming Boards category; I'm working in a metal workshop where we have the following challenge: We produce driveshafts according to spec from a ...

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    1

    Permutation algorithm??

    I'm working in a metal workshop where we have the following challenge:

    We produce driveshafts according to spec from a certain customer. They have many different specs for the driveshafts, requiring a lot of different lengths. According to the length requested, we cut 20 feet long 10inch thick steel bars into the appropriate lengths, but sometimes we end up with too much of the steel bars that go to waste. Which is costly in the long run.

    I'm looking for an algorithm to solve this problem so that I can optimize cutting length for a certain number of driveshafts.

    Say that I have x number of different length driveshafts to make. I want to calculate all permutations (ordered sets) of lengths, but in the process of calculating the permutations I also want to keep the total length of the y first driveshafts in the permutation so that it will be below, but as close to 20 feet as possible.

    The program is supposed to receive as input the number of and length of driveshafts to produce, and generate as output optimized cutting lengths for the steel bars I need to spend in order to produce all driveshafts with as little waste of metal as possible.

    Any suggestions with regards to how to code this thing? Or the permutation algorithm that is required?

    TIA,
    L.R

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  3. permutation algorithm
    By bigSteve in forum C Programming
    Replies: 8
    Last Post: 10-16-2003, 06:02 PM
  4. Permutation algorithm
    By WarBaboon in forum C++ Programming
    Replies: 6
    Last Post: 03-18-2003, 09:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21