Uploaded by Necromancer777

CARAMS

advertisement
THE METHOD OF THE NORTHWEST ANGLE AND THE METHOD OF THE LEAST
ELEMENT FOR SOLVING THE TRANSPORT PROBLEM
Maria Lapina 1* [0000-0001-8117-9142], Denis Shvedunenko1 [0009-0008-2791-6939], Ramazan
Ozdarbiyev 1 [0009-0005-1482-7775], Mikhail Babenko1 []
1 North Caucasus Federal University, Stavropol, Russia
mlapina@ncfu.ru
Annotation. This article discusses and compares such methods for constructing a reference
plan for a transport problem as the method of the northwest angle and the method of
the minimum element. These methods are implemented in the C++ programming
language, pseudocodes are presented. When constructing a reference plan for tasks of different
sizes, it was revealed that the method of the minimum element is more effective, since the
reference solution compiled according to this method, closer to the optimal solution than a plan
drawn up using the northwest angle method.
Keywords: transport problem, northwest angle method, minimal element method, C++,
comparison of methods.
1. Introduction
Currently, in science, special attention is paid to transport. Transport tasks are a necessary
component for a logistics company, as they allow you to provide cargo transportation to the
consumer at the right time and place with minimal total costs, which include labor, material and
financial resources [1].
In the forecast of scientific and technological development of the Russian Federation for
the period up to 2030, close attention is paid to the direction of "Transport" [2]. This document
lists the most relevant areas of research, windows of opportunity for research, threats, and
outcomes expected from science.
In the work of Sultanov B.M. [6] the problem of determining the optimal plan for the
transportation of flour is considered. The author of the study came to the conclusion that drawing
up an optimal plan using the minimum element method allows minimizing costs, as well as
effectively using all available resources. Sultanov determined that the use of the transport task
makes it possible to effectively solve the problems of cargo transportation.
In the work of Rudik I.D. and Velichko V.V. [7], the types and methods of solving the
transport problem are investigated. The authors came to the conclusion that the solution of the
transport problem by the method of the minimum element allows you to determine the minimum
costs, find the shortest route, and reduce the delivery time.
In the study of Takiya E. F. [8], the methods of the northwest angle and the method of the
minimum element for solving the transport problem of linear programming are considered. The
article shows the difference between the two methods. The author concludes that the least cost
method provides a more optimized or reduced total cost of transportation compared to the least
cost method for the same problem.
2. Description of methods
The transport problem of linear programming (TZLP) is the problem of transporting goods from
m points of production to n points of consumption, with given production volumes, the i-th
supplier, and the consumption of 𝛼𝑖 the 𝛽𝑗 j-th 𝑐𝑖𝑗 consumer, and the cost of transporting a
unit of product from point i to j . The solution to the problem is a transportation plan in which
the needs are fully met, and the cost of transportation is minimal. [3]
MLTP is solved in two stages: [4]
1. Determination of the initial plan of cargo transportation (Reference plan).
2. Improvement of the baseline to the optimal.
There are various methods for constructing a reference plan:
ο‚·
ο‚·
ο‚·
ο‚·
Northwest corner
Minimum element
Vogel approximations
Dual preference
In this article, we will consider and compare the method of the northwest angle and the
minimum element.
2.1 Northwest angle method
Consider the problem of 3 points of production, and 4 points of consumption 𝛼𝛽.
Availability of goods: = 300, = 400, = 500.𝛼1 𝛼2 𝛼3
Cargo requirement: =250, =350, =400, =200.𝛽1 𝛽2 𝛽3 𝛽4
The cost of transportation (tariff) is presented in the matrix Cij.
3
𝐢 = (2
8
1 7 4
6 5 9)
3 3 2
Get:
Table 1
A1
A2
A3
Needs
B1
3
2
8
250
B2
1
6
3
350
B3
7
5
3
400
B4
4
9
2
200
Availability
300
400
500
1200
A typical transport problem, also called the Hitchcock-Koopmans transport problem, is
mainly related to the movement of goods from sources to destinations [9].
The essence of the method is to sequentially iterate through the rows and columns of the
transport table, starting with the left column and the top row, and write out the maximum possible
shipments to the corresponding cells of the table so that the capabilities of the supplier or the needs
of the consumer stated in the task are not exceeded. [5]
Thus:
Table 2
A1
A2
A3
Needs
B1
250*3
2
8
250
B2
50*1
300*6
3
350
B3
7
100*5
300*3
400
B4
4
9
200*2
200
Availability
300
400
500
1200
The cost value of this reference plan:
P = 250 * 3 + 50 * 1 + 300 * 6 + 100 * 5 + 300 * 3 + 200 * 2 = 4400 c.u.
2.2 Minimum element method
In contrast to the north-west angle method, in the method of the minimum element, the choice of
departure points and destinations is made based on transportation tariffs, i.e. in each step you need
to select a cell with a minimum transportation tariff. If there are several such cells, then choose
one of them.
Solving the problem from Table 1 by this method, we get:
Table 3
A1
A2
A3
Needs
B1
3
250*2
8
250
B2
300*1
6
50*3
350
B3
7
150*5
250*3
400
B4
4
9
200*2
200
Availability
300
400
500
1200
The cost value of this reference plan:
P = 300 * 1 + 2 50 * 2 + 150 * 5 + 50 * 3 + 250 * 3 + 200 * 2 = 2850 c.u.
As can be seen, the costs of this reference plan for this task are lower than the costs of the
reference plan drawn up using the northwest angle method.
2.3 Comparison
Comparison of these methods according to some criteria occurs using codes written in C++
(https://gist.github.com/oramzan/5c788a73c06288a22f48aa9dffe221f9,
https://gist.github.com/oramzan/00449f11ef4ba9db7b5bede550c89a9f).
The pseudocode for the northwest corner is:
Initialize the matrix result[number_of_suppliers][number_of_consumers] with zeros
Initialize matrix result[num_products][ num_suppliers][num_customers] with zeros
For each product, k from 0 to num_products - 1:
Set i = 0 , j = 0
So far, i < num_suppliers and j < num_customers:
quantity = min(supply[i][k], demand[j][k])
result[k][i][j] = quantity
supply[i][k] -= quantity
demand[j][k] -= quantity
If demand[j][k] == 0, then:
Increase j by 1
If i < num_suppliers and supply[i][k] == 0, then:
Increase i by 1
The complexity of this algorithm is O(num_suppliers * num_customers *
num_products)
The pseudocode for the minimum element is:
Initialize matrix result[num_products][ num_suppliers][num_customers] with zeros
For each product, k from 0 to num_products - 1:
For now , true:
min_supply = INT_MAX
min_demand = INT_MAX
min_supplier = -1
min_customer = -1
For each provider i from 0 to num_suppliers - 1:
For each consumer j from 0 to num_customers - 1:
cost = supply[i][k] * tariff
If supply[i][k] > 0 and demand[j][k] > 0 and cost < min_supply and cost < min_demand, then:
min_supply = cost
min_demand = cost
min_supplier = i
min_customer = j
End if
End of cycle
End of cycle
If min_supplier == -1 or min_customer == -1, then:
Exit the loop
End if
quantity = min(supply[min_supplier][k], demand[min_customer][k])
result[k][min_supplier][min_customer] += quantity
supply[min_supplier][k] -= quantity
demand[min_customer][k] -= quantity
End of cycle
The complexity of this algorithm is O(num_products * num_suppliers * num_customers
* max(num_suppliers, num_customers)).
3. Outcomes
For problems of different dimensions, reference plans were drawn up using the methods of the
northwest angle and the minimum element. As a result, the best operating time of the algorithm,
the worst, average, as well as how much the costs of the plan differ in percentage from the costs
of the optimal plan (last column) were obtained.
Northwest Angle Method
4x4
5x5
6x6
7x7
8x8
9x9
The best time,
with
0,0000075
0,0000189
0,0000094
0,000021
0,000012
0,0000122
Worst time, with
Average time, s
Difference, %
0,0000075
0,000058
0,0000161
0,0000407
0,0000282
0,0000131
0,0000075
0,00002799
0,00001059
0,00002767
0,00001529
0,00001265
61,55316279
89,13406553
112,7
53,56441923
74,12466529
98,63340582
10x10
0,0000143
0,0000157
0,00001488
123,1
Worst time, with
Average time, s
Difference, %
0,0000121
0,0000165
0,0000237
0,0000332
0,0000491
0,0000508
0,0000601
0,00001112
0,00001605
0,00002069
0,00002835
0,00004059
0,00004525
0,00005482
24,31047136
45,49264631
10,9
25,36408089
25,35813896
16,30202833
17,01392823
Smallest element method
4x4
5x5
6x6
7x7
8x8
9x9
10x10
The best time,
with
0,0000104
0,0000156
0,0000196
0,0000247
0,0000355
0,0000433
0,0000471
Average time, s
0,0000600
0,0000500
0,0000400
0,0000300
0,0000200
0,0000100
0,0000000
4Ρ…4
5Ρ…5
6Ρ…6
7Ρ…7
8Ρ…8
9Ρ…9
Northwest Angle Method
Smallest element method
Polynomial(Northwest Angle Method)
Linear(Smallest element method)
10Ρ…10
Difference, %
140
120
100
80
60
40
20
0
4Ρ…4
5Ρ…5
6Ρ…6
7Ρ…7
8Ρ…8
9Ρ…9
10Ρ…10
Northwest Angle Method
Smallest element method
Polynomial(Northwest Angle Method)
Polynomial(Smallest element method)
4. Conclusion
From this we can conclude:
1. The average time to find a plan for the minimum element method is linear, and depends on
the size of the problem.
2. The costs of the reference plan differ from the costs of the optimal plan for the northwest
angle method more than for the costs of the reference plan constructed by the least element
method.
3. For 10x 10 problems, the code execution time differs by a factor of 3.6 in favor of the
northwest angle method, but the baseline calculated by the smallest element method is 7.2
times closer to the optimal one.
Based on this, it can be concluded that the use of the method of the smallest element to build
a reference plan is more appropriate, since it is less different from the optimal, therefore, it will
take less time to improve it to the optimal, however, with large volumes of tasks, it will take more
time to build a reference plan using the method of the smallest element.
5. List of references
1. Sergeev, V.I. Supply chain management: a textbook for bachelors. - M.: Yurait Publishing
House, 2014. 479 p.
2. Forecast of scientific and technological development of the Russian Federation for the
period up to 2030 (approved by the Government of the Russian Federation) // [Electronic
resource]. – 2014 URL: https://www.garant.ru/products/ipo/prime/doc/70484380/ (date
accessed: 01.11.2020)
3. Pupkov K.A., Konkov V.G. Intelligent systems. Moscow: Bauman Moscow State
Technical University Publ., 2003. 348 p. (in Russian).
4. Tikhomirova A. N., Sidorenko E. V. Mathematical models and methods in logistics: a
textbook. - Moscow: NRNU MEPhI, 2010. – 320 p
5. A. V. Kuznetsov, N. I. Kholod, L. S. Kostevich. A guide to solving problems in
mathematical programming. Minsk "Higher School", 1978.
6. Sultanov, B.M. Application of the transport problem in determining the optimal
transportation plan // Symbol of science. 2016. β„–1-1 (13).
7. Rudik, I.D.; Velichko, V.V. Concept, types and methods of solving a transport problem //
International Student Scientific Bulletin 2017. β„– 4-4.
8. Takiy E. F. Transport problems with the use of the method of the north-western angle and
the method of the lowest costs // Humanities, socio-economic and social sciences. 2022.
(p. 352)
9. Hamdy A. Taha. Operations Research: An Introduction, Prentice Hall, 7 editions 5, USA,
2006.
Download