Thread: Permutation algorithm??

  1. #1
    Registered User
    Join Date
    Apr 2006

    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?


  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Request for comments
    By Prelude in forum A Brief History of
    Replies: 15
    Last Post: 01-02-2004, 10: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, 10:56 PM