473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reduce waste , calculation

89
To reduce the waste materials. For example: There have materials list to buy materials from the market with different size in where they need to cut them according to their size in house.

Such as:
Material name is: 75 x 25 x 5 EA
Materials standard size is available in the market is: 7 Meter, 9 meter, 12 meter, 16 meter.

You need the following size of material 75 x 25 x 5 EA.

8000 mm, 2000 mm, 950 mm, 5000 mm, 5000 mm, 1500 mm ……..

Now, You need to calculate how many standard size they need to buy from the market?

Because if they buy 7 meter it can be possible to cut 5000 mm and 2000 mm to not waste materials after cut from 7 meter. But, if they choose 9 meter to cut for 5000 mm and 2000 mm in where 2 meter will waste. You want to calculate that bit by program.

So, from the above example, we will need: ( OUTPUT)

Material Name: 75 x 25 x 5 EA
STD Size Total quantity Portions Cut
7 meter 2 5000 mm, 2000 mm
5000 mm, 1500 mm
9 meter 1 8000 mm, 950 mm

Please help me out with any idea to resolve the problem, Many thanks in advance...
May 17 '10 #1
3 2808
jkmyoung
2,057 Expert 2GB
Are you only allowed to make one cut per board? eg you can't cut 9m into 5000mm, 2000mm, and 2000mm? OR 5000mm, 2000mm, and 950 mm with 1050mm waste?

Is nothing lost when you cut?

===
When doing this algorithm, are the standard sizes set, or do they change from problem to problem?

Do you need to find the optimal solution, or is close-to-optimal ok?

=====
Possible Optimal-Solution Algorithm:
Expand|Select|Wrap|Line Numbers
  1. Add lengths of all boards needed (in this case, adds up to 22.45 m)
  2. Round up to the nearest meter. (assumes boards are all cut to exact meter. if not algorithm needs to change slightly.)
  3. loop {
  4.   Try to find board lengths that exactly match that length.
  5.   Attempt to fit the cuts in those length.
  6.   Return if found.
  7.  
  8.   otherwise loop(rearrange board types  (retaining same length){
  9.     Attempt fit, return if found.  
  10.   }
  11.   Increase length by 1. 
  12. }
  13.  
May 17 '10 #2
shaiful
89
@jkmyoung
It would be multiple cut or one cut which is depend on what material size you required.

======


STD set is always fixed.

========

Increase length by 1. Sorry cant understand that
May 17 '10 #3
jkmyoung
2,057 Expert 2GB
Increase total length (sum of all used boards) by 1 meter. It's for the next iteration in the loop.
May 18 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
181
by: Tom Anderson | last post by:
Comrades, During our current discussion of the fate of functional constructs in python, someone brought up Guido's bull on the matter: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 ...
3
by: SSG | last post by:
Hi All! I know how to calculate the running time of a particular routine, but i want to know how to reduce the running time in a program........... can anyone knows help me........ also...
4
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
5
by: rogerzar | last post by:
Hi all In my application I am displaying bipmap image I am using the log10() function, but it takes very long time to display the image, the pixel array size is 1272x1003 pixels. I am...
9
by: falcon | last post by:
Is there a way I can do time series calculation, such as a moving average in list comprehension syntax? I'm new to python but it looks like list comprehension's 'head' can only work at a value at...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
5
by: Doker | last post by:
Simple vb code: <STAThread_ Public Shared Sub Main() Dim g As Integer = 3 Console.WriteLine(g) End Sub avaluates to:
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.