Special Algorithms Traffic Assignment
Special Algorithms Traffic Assignment
Barangays
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
Simple Method: Connect adjacent nodes with the least distance, no cycle
allowed
Let G denote the links in the minimal spanning tree
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
2nd Iteration: G = {(1,3), (3,4)}
Minimum distance = (1 + 2) = 3 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
3rd Iteration: G = {(1,3), (3,4), (4,6)}
Minimum distance = (1 + 2 + 3) = 6 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
4th Iteration: G = {(1,3), (3,4), (4,6), (5,6)}
Minimum distance = (1 + 2 + 3 + 3) = 9 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
5th Iteration: G = {(1,3), (3,4), (4,6), (5,6), (2,3)}
Minimum distance = (1 + 2 + 3 + 3 + 4) = 13 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
6th Iteration: G = {(1,3), (3,4), (4,6), (5,6), (2,3), (5,7)}
Minimum distance = (1 + 2 + 3 + 3 + 4 + 4) = 17 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
7th Iteration: G = {(1,3), (3,4), (4,6), (5,6), (2,3), (5,7), (7,8)}
Minimum distance = (1 + 2 + 3 + 3 + 4 + 4 + 5) = 22 km
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
Minimal Spanning Tree Problem
Summary of results:
1. The final minimal spanning tree is as shown below. Its length is equal to (1 + 4 + 2 +
3 + 3 + 4 + 5 ) 22 kms
2. The difference between the minimal spanning tree problem and the shortest route
problem is that the latter is based from a source node and all the other nodes are
linked to it in the shortest possible way.
3. While the minimal spanning tree problem connects one node to another node the
minimal way without regard to any source node.
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
ASSIGNMENT
1 Jordan 1 Jordan
3.4 12.4
2.0
3 2 17
5.1 10.2
4 8.9 10.0
3.1
31 32 18 4.0
3.0
3.8 19
2.5 30
28 8.3
29 3.4 4.4 8.2
27 2.4 3.3
4.9 5.0
24
Note: Values are in km
Link Estimated Link Estimated
Distance (km) Distance (km) MINIMAL SPANNING TREE
1-2 3.4 16-17 3.3 (Jordan as Center Node)
1-5 2.8 17-19 10.0 5.9
2.1 13
1-17 12.4 18-19 4.0 12 4.9
11 2.7 10
1-18 10.2 18-21 8.3 3.7 3.3 14
9 1.6
1-32 8.9 19-20 8.2 8 6.2
4.4 3.1
6 1.2 6.0
2-3 2.0 20-21 1.0 7
2.5 6.0 15 16
2-4 5.1 21-22 3.0 5 4.6 3.8
5-6 2.5 22-23 2.9 2.8 3.3
1 Jordan
3.4 12.4
2.0
5-7 4.6 22-28 4.4 3 2 17
6-8 4.4 23-24 5.0 5.1 10.2
7-8 1.2 23-26 2.0
4 8.9 10.0
7-9 3.1 26-28 3.3
7-15 6.0 24-25 4.9 3.1
31 32 18 4.0
3.0
8-11 3.7 25-26 2.4 3.8 19
9-10 1.6 25-27 3.5 2.5 30
28 8.3
9-11 3.3 26-27 2.4 29 3.4 4.4 8.2
10-12 2.7 26-28 3.3 27 2.4 3.3
Barangays
2
5 4 4
10 5 7
Municipal
1 3 5
Center 1 3 9
2 9
7 8 8
4 6
3
1st Iteration:
Nodes 1 2 3 4 5 6 7 8
L(1) 0 5 1 7
(km)
*
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
2nd Iteration:
Nodes 1 2 3 4 5 6 7 8
L(2) 0 5 1 7
(km)
* *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
3rd Iteration:
Nodes 1 2 3 4 5 6 7 8
L(3) 0 5 1 3 11 10
(km)
* * *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
4th Iteration:
Nodes 1 2 3 4 5 6 7 8
L(2) 0 5 1 3 11 6
(km)
* * * *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
5th Iteration:
Nodes 1 2 3 4 5 6 7 8
L(2) 0 5 1 3 11 6
(km)
* * * * *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
6th Iteration:
Nodes 1 2 3 4 5 6 7 8
L(6) 0 5 1 3 9 6 15 14
(km)
* * * * * *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
7th Iteration:
Nodes 1 2 3 4 5 6 7 8
L(6) 0 5 1 3 9 6 13 14
(km)
* * * * * * *
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
8th Iteration:
Nodes 1 2 3 4 5 6 7 8
L(6) 0 5 1 3 9 6 13 14
(km)
* * * * * * * *
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
Shortest Path Method
Summary of observation:
1. Road segments 1-3, 3-2, 3-4, 4-6, 6-5, 5-7, and 6-8 are roads to be
converted to all-weather roads.
2. Therefore, shortest paths from the municipality (Node 1) to each
barangays are the ff:
Brgy 1 to Brgy 2: 5 km
Brgy 1 to Brgy 3: 1 km
Brgy 1 to Brgy 4: 3 km
Brgy 1 to Brgy 5: 9 km
Brgy 1 to Brgy 6: 6 km
Brgy 1 to Brgy 7: 13 km
Brgy 1 to Brgy 8: 14 km
2
5 4 4
10 5 7
1 3 5
1 3 9
2 9
7 8 8
4 6
3
ASSIGNMENT
1 Jordan 1 Jordan
3.4 12.4
2.0
3 2 17
5.1 10.2
4 8.9 10.0
3.1
31 32 18 4.0
3.0
3.8 19
2.5 30
28 8.3
29 3.4 4.4 8.2
27 2.4 3.3
4.9 5.0
24
Note: Values are in km
Link Estimated Link Estimated
Distance (km) Distance (km) SHORTEST PATH METHOD
1-2 3.4 16-17 3.3 (Jordan as Center Node)
1-5 2.8 17-19 10.0 5.9
2.1 13
1-17 12.4 18-19 4.0 12 4.9
11 2.7 10
1-18 10.2 18-21 8.3 3.7 3.3 14
9 1.6
1-32 8.9 19-20 8.2 8 6.2
4.4 3.1
6 1.2 6.0
2-3 2.0 20-21 1.0 7
2.5 6.0 15 16
2-4 5.1 21-22 3.0 5 4.6 3.8
5-6 2.5 22-23 2.9 2.8 3.3
1 Jordan
3.4 12.4
2.0
5-7 4.6 22-28 4.4 3 2 17
6-8 4.4 23-24 5.0 5.1 10.2
7-8 1.2 23-26 2.0
4 8.9 10.0
7-9 3.1 26-28 3.3
7-15 6.0 24-25 4.9 3.1
31 32 18 4.0
3.0
8-11 3.7 25-26 2.4 3.8 19
9-10 1.6 25-27 3.5 2.5 30
28 8.3
9-11 3.3 26-27 2.4 29 3.4 4.4 8.2
10-12 2.7 26-28 3.3 27 2.4 3.3
Lazi Community
Hospital
2 Missing
road links