Home > database >  Company management more disorderly, consult this algorithm? Or how to match?
Company management more disorderly, consult this algorithm? Or how to match?

Time:09-30

Requirements are as follows:
A demand for 30
B needs 50
Demand for 20 c
D demand 80


Existing material
Set 1 number 10 is suitable for A
Set 2 number 20 applies to AB
Set 3 number 3 is suitable for the ABC
Set 4 number 6 is suitable for AC
Set 5 number 2 is suitable for the BC
Set 6 number 2 is suitable for B
Collection of 7 number 1 is suitable for C

How do I report a bad number, minimizing the number of my purchase?

CodePudding user response:

Dizzy, you of a material point in several places to store?

CodePudding user response:

In many places also have this kind of situation, it has formed such patterns, have what good method?

CodePudding user response:

What is the meaning of set 1, 2, 3
What is the relationship between and a, b, c
And what is applicable is A \ B \ C

CodePudding user response:

If pure is number, regardless of the cost price, standing with location, additional cost is simply an inequality problems such as the word of the problem, a simple algebra problem

CodePudding user response:

A, B, C, what is the relationship between BOM

CodePudding user response:

The knapsack problem can be solved in C!

CodePudding user response:

refer to the original poster mrsunny posts:
requirements are as follows:
A demand for 30
B needs 50
Demand for 20 c
D demand 80


Existing material
Set 1 number 10 is suitable for A
Set number 20 applies to AB/2/not points here AB?
Set 3 number 3 is suitable for the ABC
Set 4 number 6 is suitable for AC
Set 5 number 2 is suitable for the BC
Set 6 number 2 is suitable for B
Collection of 7 number 1 is suitable for C

How do I report a bad number, minimizing the number of my purchase?



In general should first distinguish various number in the library.

CodePudding user response:

Some dizzy, should can

Requirements are as follows:
A demand A30
B demand B50
C demand C20
D demand D80


Existing material
Set 1 number 10 is suitable for A
Set 2 number 20 applies to AB
Set 3 number 3 is suitable for the ABC
Set 4 number 6 is suitable for AC
Set 5 number 2 is suitable for the BC
Set 6 number 2 is suitable for B
Collection of 7 number 1 is suitable for C

How do I report a bad number, minimizing the number of my purchase?



///////////////////////////////////////////
Set the number of class A class B class C

Set 1 number 10 a
Set 2 number 20 a, B
Set 3 number 3 A B C
Set 4 number 6 A C
Set 5 number 2 B C
Set 6 number 2 B
Collection of 7 number 1 C

The SELECT Max (class A) into: class A number from class table where A="A"
SELECT Max (class B) into: number of class B from table where B="B"
The SELECT Max (class C) into: class C number from table where class C="C"

Procurement needs A=A - class A qty


IF the purchase for A & lt; 0 THEN
The SELECT Max (class A) into: class A number from table where class="A" AND A class B="B"
IF class A number & gt; (- the number of purchasing A) THEN
Purchasing B + B=purchase Numbers class A number
The ELSE
Procurement number B=number of class A
END the IF
END the IF
Purchase demand B + B B=purchase Numbers - the number of class B

IF purchasing number B & lt; 0 THEN
The SELECT Max (class B) into: number of class B from table where="B" class B AND class C="C"
IF number of class B & gt; (- purchase number B) THEN
Count C=procurement procurement number C + B
The ELSE
Purchasing several C=number of class B
END the IF
END the IF
Count C=procurement procurement demand C + C - number of class C


IF the purchase number C & lt; 0 THEN
The SELECT Max (class C) into: class C number from table where class C=A="C" AND class "A"
IF number of class C & gt; (- purchasing several C) THEN
Procurement for purchasing A=A + class C qty
The ELSE
Number of purchasing A=number of class C
END the IF
END the IF
Count A=procurement procurement needs A + A - class A number


CodePudding user response:

Some dizzy

CodePudding user response:

Available greedy algorithm a try,
And you the a, b, c, d have priority,

CodePudding user response:

Most years of post, was dug out.
  • Related