The plot of the Wheatfield road network generated from Matlab code is shown in Figure 1, with 15 stores marked in blue stars and two depots marked in red circles. Warehouse 1 is the red circle on the left, and Warehouse 2 is the red circle on the right in Figure 1.
2.0 Question b
2.1 Discuss the purpose of every variable, parameter and constraint used.
As decision variables, an indicator variable is defined for each link that takes the value 1 if the link lies on the shortest path and 0 otherwise. Table 1 below presents the indexed-symbolic formulation.
Table 1 – Indexed-symbolic formulation
Indices
Nodes
Sets
Set of nodes in the network
Set of links (edges) in the network
Parameters
Length of link
Delay at node
Decision Variables
Node is passed through
Link is passed through from node to node
Objective Function
Minimise
Constraints
The Objective Function (1) minimises the travel cost between warehouse and Minimart store in Wheatfield; by incorporating the length of each link and delay at each node. With factor if the node is at origin or destination, for all other nodes, because all middle nodes are passed through and counted twice unlike the origin and destination nodes that are only counted once. Constraint (2) defines three situations. Firstly, the sum of outflow minuses the sum of inflow from all stores should equal to 1. Secondly, the sum of outflow minuses the sum of inflow from all depots/warehouses should equal to -1. Lastly, by maintaining the equilibrium between inflow and outflow, all nodes apart from the store and depot/warehouse nodes should equal to 0. Constraint (2) ensures that the flow within each link should equal to 0 or 1. The problem is considered as minimising the travel cost when one unit of flow sending through the network without any capacity constraints. Hence, the sum of decision variable for links () that has a tail as the is one more than the sum of links that have a head as its . Additionally, there is a flow balance between the flow in and flow out at each middle node on the shortest path. Constraint (3) is set to find the possible delays in all links, which defines the sum of links flowing into each node should equal to the node capacity (equals to 1), except when the node is at origin (stores). By considering the origin node where no inflow occurs, Constraint (4) defines that at this origin node it should equal to 1. The last Constraint (5) ensures that the number of nodes and links passing should equal or larger than 0.
2.2 Identify the class of problems that this formulation belongs to, and comment on any advantages or disadvantages over a Dijkstra’s algorithm based approach.
The class of problem that this formulation belongs to is linear programming. A linear programming problem is defined as the problem of minimising or maximising a linear function subject to linear constraints (Ferguson, 2017), where the constraints can be equalities or inequalities. As shown in Table 1, the objective function is a linear function, hence, this problem is using linear programming. In addition, the paths are represented using binary decisions (either 1 or 0), and only the cost of paths is minimised. Thus, the class of problem is a mixed integer linear programming problem with single-objective optimisation. The software Cplex uses a generic solver to solve a mathematical model, the method is called Simplex algorithm (Gearhart et al., 2013). As shown in Table 2 below, there are several advantages and disadvantages of using generic mathematical formulation over a domain-specific algorithm such as Dijkstra’s approach.
Table 2 – Advantages and disadvantages over a Dijkstra’s algorithm
Advantages
• Negative edges allowed, unlike Dijkstra’s algorithm which leads to acyclic graphs and often cannot obtain the correct shortest path (Venkat, 2014)
• More efficient in solving smaller scaled linear programming problems, since Dijkstra’s algorithm targets an issue by carrying out an uninformed search thus, leading to a significant amount of time being wasted (Puthuparampil, n.d.)
• Solve many diverse combination problems, such as financial management, agriculture and military applications (UKEssays, 2013)
• Technological advancement (computers) improved the ability to use this technique to solve problems with multiple constraints
• More problems can be solved with various methods thus making linear programming the most flexible system (Kashyap, 2017)
Disadvantages
• Dijkstra’s algorithm can only be applied to find shortest distance between any two nodes in a graph (Jani and Kairanbay, 2013)
• Edges can be relatively expensive to compute so Dijkstra’s algorithm avoidance to investigate all of them makes it faster (Comparison with Dijkstra's algorithm, 2000)
• Linear programming does not work with variables that are non-linear
2.3 Would you apply either of the two approaches to obtain the shortest path for a car trip between London and Edinburgh? Why?
The most ideal way to traverse a network from an origin to a given destination is using the shortest path (SP) problem. The SP problem’s purpose is to find the cheapest path from node 1 to node N. However, there many approaches used to target this problem with 2 mentioned prior in the report: Simplex algorithm and Dijkstra’s algorithm.
According to Ahuja et al. (1990) theoretically the most efficient approach is Dijkstra’s algorithm. A tentative cost is maintained for each vertex and as the algorithm proceeds tentative costs decrease until the algorithm reaches its termination thus, can easily be updated to compute actual minimum cost paths rather than just the costs of such paths (Dijkstra, 1959). Additionally, Dijkstra’s algorithm can produce a solution because this problem has no negative weightings and is a single-source problem. However, since Dijkstra’s algorithm does blind searches (Venkat, 2014), it must explore in all directions. For a car trip between London and Edinburgh, it may look at unnecessary routes such as across the whole UK or even European areas. Hence, Dijkstra’s algorithm may not be an ideal approach if the shortest path wants to be obtained under a time restraint.
On the other hand, due to the enormous amount of time and expenses on running the programme required to obtain a solution for such a large-scale network, the Simplex algorithm can be less effective than Dijkstra’s algorithm. Furthermore, a combination of complex properties may need to be considered, including weather conditions and unpredictable road accidents. These results in a non-linear problem that Simplex method and Dijkstra’s algorithm will be hard and unable to solve respectively.
3.0 Question c
By using OPL Studio, the most cost-effective choice of warehouse for any MiniMart store in Wheatfield is determined. By implementing the indexed-symbolic formulation written in Question b and the information described above, the allocations for the 15 stores to the depots are determined. Table 3 below clearly presents the travel cost between each store to their optimal depot/warehouse, as well as each of their nodes passing route. The complete routes between each store and each depot/warehouse can be found in the Appendix – Table 5.
Table 3 – Routes for Shortest Paths
Store No.
Depot No.
Cost
Route (Nodes passed through)
1
2
313.378
583 – 540 – 622 – 555 – 556 – 557 – 559 – 562 – 567 – 499 – 569 – 573 – 528
2
1
568.224
239 – 785 – 793 – 801 – 913 – 417 – 416 – 415 – 414
3
2
122.294
493 – 497 – 498 – 533 – 532 – 531 – 529 – 528
4
2
547.909
443 – 444 – 445 – 446 – 447 – 448 – 449 – 450 – 451 – 452 – 525 – 524 – 545 – 580 – 575 – 528
5
1
232.301
471 – 816 – 811 – 812 – 866 – 737 – 735 – 414
6
1
622.678
349 – 895 – 889 – 862 – 466 – 467 – 845 – 459 – 832 – 872 – 869 – 866 – 737 – 735 – 414
7
2
344.854
133 – 679 – 681 – 623 – 624 – 557 – 559 – 562 – 567 – 499 – 569 – 573 – 528
8
2
361.889
908 – 906 – 516 – 903 – 543 – 527 – 526 – 528
9
1
485.678
245 – 791 – 797 – 799 – 805 – 807 – 711 – 713 – 392 – 717 – 719 – 723 – 725 – 729 – 731 – 414
10
2
486.903
423 – 424 – 777 – 778 – 597 – 599 – 616 – 618 – 548 – 550 – 551 – 563 – 564 – 565 – 569 – 573 – 528
11
2
26.915
573 – 528
12
2
224.226
109 – 655 – 451 – 452 – 525 – 524 – 545 – 580 – 575 – 528
13
2
140.326
99 – 645 – 578 – 577 – 530 – 529 – 528
14
1
511.448
243 – 789 – 791 – 797 – 799 – 805 – 807 – 711 – 713 – 392 – 717 – 719 – 723 – 725 – 729 – 731 – 414
15
2
98.346
571 – 572 – 573 – 528
After calculating the total cost for each warehouse, by referring to Table 4 below, the difference in total costs between two warehouses are only £246.71. However, Warehouse 2 connects to 10 Stores and Warehouse 1 only connects to 5 Stores, with an average cost per Store of £ 266.70 and £484.07 respectively. Thus, Warehouse 2 is the most cost-effective choice of warehouse for any MiniMart store in Wheatfield. Consequently, it may be more ideal to relocate Warehouse 1 to a closer location to Warehouse 2. The relocation could be costly in short-term, but it would be more beneficial when considering the long-term cost efficiency.