DEVELOPMENT OF SOFTWARE SOLUTION FOR BUILDING ROUTE OF A ORDERS GROUP DELIVERY IN PRESENCE OF TIME CONSTRAINTS

The problem of determining route of visiting several points is considered. The task differs from known ones that time for arrival at each point is specified. The tasks of these class are solved in courier delivery services of various goods types. Basis of proposed algorithm for determining delivery route is algorithm for forming the route tree used matrix, which specify distances between delivery points, which is supplemented by checking conditions for possibility of visiting points, according to defined delivery time vector. Various criteria for selecting vertices for inclusion in route are considered. During developing software that implements proposed algorithm, used parallel computation methods that allow to obtain a solution for problem of sufficiently large dimension at acceptable time.


Introduction.
Especially popular now are services "delivered to door".Now to buy something, it's enough to call phone, make your choice to manager, and receive your order after some time through from hands of delivery service employee.The same can be done if you go to website of an online store or delivery service.The list of items that can be ordered today includes mail and parcels, food and water, clothing and equipment.In any case, it is modern, it is convenient, it does not require time and effort.
In turn, in the context of an increasing flow of such orders, there is question about quality of delivery service.The quality should be understood as the absence of damage and delivery timeliness.It is really difficult to keep packaging due to randomness of influencing factors.But ensuring delivery at right time is important task for this service segment.
Timeless delivery is impossible without careful planning, which, in turn, should be ensured by highquality information provision.Currently, route planning systems are powerful systems that receive data from geographic information services such as Google Maps and GIS2, which provide information about location of infrastructure and roads, and routing directions (or multiple) from one point to other.An example of such systems is "4logist" [1], "ABMcloud" [2], "Anthill Logistics" [3], and others.
Meanwhile, algorithmic provision of such systems can be improved.In general case, delivery manager must make delivery route plan which will be minimal.Such task in scientific world was called "The Traveling Salesman Problem".Solutions and algorithms for solving this problem are known too.Meanwhile, in a number of delivery spheres planning should take into account an extra mandatory conditiondelivery of orders at specified time.Such task often arises when delivering a group of "food" orders (pizza or sushi).And in such arrangement of implemented solutions in known software products there etc.
The purpose of article.Direction of improvement of known forming routes methods is account of specified delivery deadlines.This article presents method of solving problem in formulated initial conditions and results of software implementation development of this method.
Problem formulation and formalization.In general case, there is a source from which goods or services are delivered by customers.Depending on product which will be delivered, it may be a wholesale warehouse, a production shop, a bakery or a kitchen shop, a postal terminal.Future in this article such point will be called "Logistics Center" (LC).
The meaningful resolution of this problem looks like this.There are orders in LC, each of which must be delivered to their destination.For each order there is a deadlinetime not later than order must be delivered.Time required to transfer from LC to destination points and times required to transfer between points is calculated and stored in memory at stage of system prepare.It is necessary to find orders delivery sequence where number of orders with violated time term will be minimal.
For formalized statement of task, following notation and variables must be entered.
Let n -the number of orders.Then designate the delivery time for a point i as follows , will consist of the elements ij t - which is the time to move from point i to point j .An example of distance matrix for three points and LC is presented in Table 1.
This restriction ensures that all points are bypassed, and in this case, none of items can be visited more than once.Such conditions correspond to known travel salesman problem (The Traveling Salesman Problem) [4], in which it is necessary to bypass all points from a definite list exactly once and return to start point (in our caseto LC).
The criterion of optimality of this task should ensure that timely delivery of order is taken into account Finally, let denote by ) ( x , i y w a binary value equal to 0 if directive time of order is not violated and 1 in otherwise.The formula for calculating Using introduced notation, it is possible to formulate an optimality criterion for the problem.This criterion is as follows (expression ( 5)): min w Thus, problem for solve consists in minimizing target function represented by expression (5) under conditions (1) and (2).
Solution of this problem is to find Hamiltonian cycles on a graph, that is closed paths that bypass all vertices in a graph exactly once.Methods for solving such problem without accounting time criterion are known (for example [5]).Most popular of them is method of branches and boundaries and method of successive improvement of solution.Meanwhile, they are not fully suited to solution of this task.
Algorithm for determining delivery route with account time constraints.Proposed approach is to consider all possible simple paths that begin at arbitrarily selected starting point, until a Hamiltonian cycle is found or all possible paths will not be explored.Such scheme of operations became basis of algorithm for determining delivery route in presence of certain delivery deadlines, idea of which is presented in [6].Consider steps of algorithm.
Each of branch tree vertices will be represented in ) ( , where k is vertex level, path length in branch tree from root to given vertex (i.e.sequence of distance from LC to items starting with 1 α and ending Step 2 (stop condition).At this step stop check is performed like (6): .
If this condition is met, then solution is found.Optimal path is path v .

excludes vertex v
and add its descendants).Go to step 4.
Step 4 (clipping).For each pair of vertices When the condition is fulfilled, perform following operation (see (8) and condition ' k k  is satisfied, i.e. choose vertex whose last element index is smallest.
Optimistic strategy.In this variant is satisfied, i.e. choose vertex whose high estimate of delivery time is better.
Realistic strategy.In this variant Step Delivery time for this way will be denoted by z .Formula for calculation is represented by expression (9): Next calculate values of i w  in according (10): Next determine value of h in according (11): , go to step 3, otherwise -to step 2.
Step 3. Determine delivery time for each point of vertex ν as follows (see ( 12)) and then go to step 4: Step 4. For each i z , make comparison with directive time and write 0, if directive is not violated, and 1, otherwise (see (13)): Then go to step 5.
Step 5.The estimate of B(v) will be (expression ( 14)): determines upper estimate of optimality criterion for route ν .
Algorithm for determining value ) H( v contains following sequence of actions. Step . Go to step 3. Step 3. Determine delivery time for each point of ν according to expression (15), then go to step 4: Step 4. For each i z make comparison with directive time (look expression (10)), then go to step 5: Step 5. Estimate ) (v H will take as follow (expression (16)): This problem belongs to class of NP-difficult problems [4].Thus, there is probability that with increase in number of delivery points, time for solving problem will not be tolerable.Therefore, to reduce running time of program implementing presented algorithm proposed to apply parallel computing.
Using parallel computations.Parallel computations are calculations that can be implemented on multiprocessor systems with possibility of simultaneous execution of many actions generated by decision process one or many tasks of one project [7].
Partitioning input data into groups can be done in different ways [8].The first variant of data partitioning is to divide input data array into p parts, and executing on each of processors processing on data from corresponding segment.This approach take name "segment algorithm".The other strategy involves executing on each of processors processing on data from input data array, which placed on p position apart.This approach takes name "step algorithm".
Presented algorithm was make parallel.For reduce time of solving problem of determining delivery route, proposed to distribute initial set V to several subsets , depending on number of cluster processors or kernel of computer p .Thus, p sets of nodes will be elements.Thus, subsets of following composition will be formed: It should be noted that last set may be less than other cases in which number of elements does not divide whole on p .Now for each subset you need to find best way to deliver orders.After finding best paths it is necessary to compare decision results of each task.Index of best solution can has defined from expression (17): Thus, opt _ s ν will be best way to deliver orders.
Developed algorithms became the basis for developing software implementation.
Developing software implementation of algorithm.Program development is carried out according to modern approaches to software design [9].
At initial stages, some UML diagrams were developed, use of which allowed to significantly accelerate development process [10].The most interesting of them is a classes diagram of, which is presented in Fig. 1.
In development of this diagram were thought-out classes that allow to search solution using different branching strategy and different variants of calculations organization.This approach to structuring the program meets the best techniques for realizing principles of object-oriented design.The advantage of this variant of building program structure is in getting possibility of increasing number of methods of branching implementing and number of approach to organization of calculations without changing the basic algorithm for determining the route delivery orders.For this purpose it serve abstract classes AbstractBranchingStrategy and Calculating.Also on fiq. 1 you can see class HybridBranching which in future will allowed realize hybrid strategy of branching.
To study algorithm properties, software implementation of algorithm was developed that represents console application in Java programming language created in integrated InteliJ Idea environment.
Research of time characteristics of program implementation.For testing files with several delivery examples with different number of items were created (based on examples from [6]).Research of program implementation carried out in two directions: research dependence time of program executing from strategy of branching in defining route process; research dependence time of program executing from approach to organization of computations.
The results were obtained for the three different branching strategies proposed above: breadth, optimistic or realistic.
Also various technologies of computing organization consider has been investigated: sequential calculation; parallel calculations with use 2 threads; parallel calculations with use 4 threads.
For program testing used computer, which has next configuration: processor -Intel Core i5-4440, 3.1GHz; number of kernels -4; RAM -8Gb.This configuration can be considered as "average modern computer", which can be used for automating in planning of delivery orders.
Times to receive delivery routes by use developing program for different output options (different delivery points) are presented on fig.2-4.If make conclusions only from data presented in tables then it can be argued that software implementation allows you to get a solution for 15 delivery points in less than 1 sec for any approach to computations.But implementation time grows factorially with growth of problem dimension and this thesis has been confirmed.Also in according to results best results shows using realistic strategy.When use realistic strategy of branching maximal time was near 20 sec.It can consider as good result.
On Fig. 4-6 results are presented in depends of method of calculations organization.
This representation should provide an idea of expediency of using parallel computing.Two variants of parallel computations are consideredusing 2 or 4 threads.These are typical variants for modern computers.More computers are a dual core.In addition, in operating system Windows which installed on more computers there can create two virtual kernels.Such representation once again confirms that solution for route is no more than 15 delivery points will be received in less than 1 sec without dependence of usage approach to computations.But such review of results did not give clear answer on expediency of parallel computing.
If look at results for 20 delivery points, then for breadth strategy results are approximately equal.But for other two strategies, the worst result was for case of using 4 threads, i.e. parallel computations slowed output almost twofold.Using 2 threads allowed to get result not much faster than sequential calculations.
When planning delivery for 50 cases, use of parallelism is more advisable.But in this case use of two threads gives results much faster.However, for a realistic strategy, it turned out to be more efficient to use 4 threads to parallelize computations.
Obtained results give a possible make some conclusions on work.Conclusions.Presented results testify to practical significance of presented work, which consists in possibility of using this algorithm for forming of route in delivery planning systems in case of presence of defined delivery deadlines.Main strategy for branching should be considered a realistic branching strategy, which is based on worst forecast of timely delivery of orders.Concerning use of parallel computations, there is no unambiguous conclusion.For small number of delivery points, a solution at acceptable time can be obtained with traditional sequential processing.For large number of delivery points, the use of parallel computations requires a study on more examples.

Table 1
tree may considered.In this case, in all options, sections of way that lead to vertices that are already included in way are not included.The search strategy "Breadth".In this variant vertex whose below estimate of delivery time is better.