UTILIZATION OF THE PRIM ALGORITHM TO DETERMINE THE NEAREST PATH CAR TRANSPORTATION PROBLEMS OF GOODS CARRIER BOX

Prim's algorithm has been proven to be able to be used in determining the closest path, minimum spanning tree in the problem of transporting box cars carrying goods. Based on the results of theoretical analysis tests that have been carried out from several experimental data, it can be obtained results showing that, the results of Prim's algorithm complexity are as follows O(n2). By defining n here is the number of vertices contained in the graph. So it can be concluded that, empirically, the data from the average travel time of this prim algorithm shows a graph that has a quadratic nature. As for the large number of edges contained in a graph, it has no effect on the complexity of finding the nearest path, the problem of transporting box cars carrying goods is a minimum spanning tree using the Prims algorithm.


I. Introduction
Prim's algorithm is one of the algorithms for finding the minimum spanning tree.This problem has many applications including to determine transportation routes between cities in an area.For example, suppose that the vertices in graph G represent cities, assume the weight of each edge e= (a,b) is the transportation cost from city a to city b, then the minimum spanning tree of graph g corresponds to the transportation distance with the lowest cost connecting transportation routes throughout the city.

II. Transportation Problems
The transportation problem discusses the delivery of commodity goods from several sources (cities) to a number of destinations (cities).Each source and destination has a certain amount of supply and demand for commodity goods.The purpose of solving this problem is to allocate inventory from each source to meet the needs of each goal in such a way as to optimize the specified criteria.The objective function is to find the shortest overall transportation distance so as to minimize transportation costs from each source to each destination.In addition, it can maximize the total profit from the allocation of the transportation distance.

III. Minimum Spanning Tree
Given the graph G=(V,E) an undirected connected graph where V is the set of vertices and E is the set of edges.Each edge has a non-negative weight.The problem is how to find T, a subset of the set of edges in G so that all the vertices are connected and only use the edges that exist in T, and the sum of the edge weights on T is as small as possible.Since G is connected, there is at least one solution.If G has an edge weight of 0, then there are several solutions that have the same total weight using different edges.In one case the weight of an edge can be associated as a cost to each edge.Take G'=(V,T') the subgraph formed by the vertices on G and the edges on T, and assume there are n vertices in N. A connected graph with n vertices has at least n-1 edges, so this is the minimum number of edges on T. A graph with n vertices and more than n-1 edges has at least one cycle.If G' is connected and T has more than n-1 edges, at least one edge can be removed without breaking G', i.e. selected edges that are part of the cycle.This will result in the total weight on T being reduced or equal (if the edge is omitted with a weight of 0) by decreasing the number of edges on T. Therefore, the set T with n or more edges cannot be optimal.In the end, T must have n-1 edges and since G' is connected it must be a tree.The graph G' is called the minimum spanning tree for graph G.

IV. Prim Algorithm
Prim found an algorithm to determine the minimum spanning tree on a weighted graph (with positive integer weights), and connected in addition to Kruskal's algorithm.The algorithm is as follows: ¬ Step 0. Given a connected and weighted graph with n vertices, G =(V,E).All vertices are labeled "unchosen"; arrange T:= V, a graph with n vertices and no edges; select any vertex and label it "chosen".¬ Step 1.If there is a vertex labeled "unchosen", do step 2.; Stop.¬ Step 2. Suppose (u,v) is the lightest edge between any vertex labeled "chosen" u and any vertex labeled "unchosen" v, label v with "chosen"; and arrange T : = T {(u,v)} As an illustration, suppose you have a graph as shown in Figure1 below: Figure 1.A minimum spanning tree graph with thick edges.
To illustrate Prim's algorithm, see Figure 1.For example, by selecting vertex 1 as the initial vertex.Based on the algorithm above, these steps can be written in table 1 below: Table .1 Steps of a graph minimum spanning tree has thick edges.(7,6)  {1,2,3,4,5,6,7} When the algorithm stops because there are no vertices labeled unchosen, then T contains the selected edges (1,2), (2,3), (1,4), (4,5), (4,7), and (7,6).The choice of vertex will affect the algorithm, but in general vertex 1 is chosen as the starting point.Some theorems of Prim's algorithm which are based on the properties of the tree are: 1.At each execution of step 2., the edges in T form a tree among the set of vertices labeled "chosen".2. At the end of Prim's algorithm implementation, the T that will be obtained is the spanning tree of graph G.

Langkah e=(u,v) {"chosen"}
3. Suppose T is a sub-tree of graph G and let e be the lightest edge connecting the vertices in T and the vertices outside T.There is a spanning tree T' in G which contains T and e so that if T'' is any spanning tree of g containing T, then W(T') W(T'').
4. If G(V,E) is a connected and weighted graph, and e = (v,w) is the lightest edge that is tangent to vertex v, then there is a minimum spanning tree T containing e. 5. Prim's algorithm determines a minimum spanning tree in a connected and weighted graph G with n vertices.6.The complexity of Prim's algorithm is O(n2).

V. Experiment
To see the complexity of Prim's algorithm in determining the minimum spanning tree, an experiment was carried out using a computer 2.30 GHz Processor, 3 MB Intel @ Smart Cache Cache, Bus Speed 5 GT / s, TDP 35 W, the data generated by the program automatically was obtained as follows: From the data above, the following graph can be obtained: Figure 3. Graph of n vs T(n) in experiment II

VI. Curve Fittings
1. From the experimental data I above, a curve equation that represents the data can be derived.That is by using the curve fitting method.In this case using the polynomial regression method.
The data is arranged into the following table: By using the polynomial regression method, it can be obtained a curve equation that represents these data, namely: T(n) = 0.0039n2 +0.37n+10.27 2. From the experimental data II above, a curve equation that represents the data can be derived.That is by using the curve fitting method.In this case using the polynomial regression method.
The data is arranged into the following table: In principle, the implementation of the algorithm does not affect the complexity of an algorithm.Implementation on two computers with different clocks only affects the speed of graph growth/graph gradient.This can be seen from the gradient of change in Prim's algorithm has no worst case and best case conditions because each case has the same complexity, which is O(n2).In Prim's algorithm the number of edges has no effect because this algorithm checks / iterates over all vertices, whether there are edges or not.This happens because on all unchoosen nodes it will still be checked whether the edges are minimal, no matter if the edges are infinite (no connection).So what matters is the number of nodes.IX.Conclusion a. Prim's algorithm is proven to be able to be used to determine the minimum spanning tree in determining the closest path, minimum spannning tree in the problem of transporting box cars carrying goods.b.Based on the results of theoretical analysis, it is found that the complexity of Prim's algorithm is O(n2) where n is the number of vertices in the graph.c.Empirically, the data from the average travel time of this algorithm shows a quadratic graph.d.The number of edges in a graph does not affect the complexity of finding the minimum spanning tree with Prims algorithm.

Table 2
. Experimental data I Computer Processor 2.30 GHz, Cache 3 MB Intel@ Smart Cache, Bus Speed 5 GT/s, TDP 35 W, Number of Cores 2,Number of Strings 4.n (

Banyak vertex dalam graf) T(n) Rata-rata waktu tempuh (detik)
In the experiment using a computer type Processor 1.90 GHz, Cache 6 MB Intel @ Smart Cache, Bus Speed 5 GT / s, TDP 35 W, Max Turbo Frequency 2.70 GHz, Number of strands 4, Number of Cores 4 so that the following data is obtained:

Table 3 .
Data for finding the equation of the curve in the I .experiment

Table 4 .
Data for finding curve equations in experiment II The program has been designed to check the connectivity of a graph.An unconnected graph does not have a spanning tree.Checks are carried out at each stage of tracing the spanning tree.The graph is represented as a form of adjacency matrix.://doi.org/10.1051/itmconf/20224301005 in the graph.By performing the curve fitting method on the experimental data I (Pentium computer) the equation T(n) = 0.0039n2 +0.37n +10.27 is obtained.And for experimental data II (Processor 1.90 GHz, Cache 6 MB Intel@ Smart Cache, Bus Speed 5 GT/s, TDP 35 W, Max Turbo Frequency 2.70 GHz, Number of strands 4, Number of Cores 4) obtained the equation T(n) = 0.0047n2 +0.47n +12.44.
The program is written on a computer with the following specifications: a. Dell Inspiron AIO 5400/i7-1165G7/23.8-inchFHD computer b.8GB DDR4 RAM, 2666MHz c.LG 19 INCH LED Monitor Screen d.Windows 10 Operating System Software e. Borland Delphi Programming Language version 7 https