Part A: Network Analysis
Part A: Network Analysis
www.spatialanalysisonline.com
Network analysis
Networks basic components:
Collections of interconnected linear forms:
Lines (or Edges, E) Intersections (or Vertices, V) Regions (or Cells, C) - created by the partitioning of space by the lines
Planar - e.g. streets, all on same level, vertices at every intersection of edges Non-planar - e.g. airline routes, highways with bridges/flyovers, electronic circuits
3rd edition www.spatialanalysisonline.com 2
Network analysis
Sample problems:
Shortest (least time/cost) between vertices (SPA) Shortest path (tree) connecting all vertices (MST) Shortest route visiting all locations once and returning to start point (Travelling Salesman Problem, or TSP) Minimum cost of constructing a network between a set of vertices Identification of zones within specified travel time/cost Designing a network with minimum cost of USE Designing a network with minimum travel time to specified vertices Including constraints, e.g. edge capacity, maximum distances/times permitted, vehicle capacity
3rd edition www.spatialanalysisonline.com 3
Network analysis
Networks basic components:
Directed (with predefined directions or flows) Non-directed (symmetric access/flows) Common level or hierarchical Abstracted as graphs and/or tables Connected or collection of sub-graphs Principal forms:
Paths, trees, circuits, cells
3rd edition www.spatialanalysisonline.com 4
Network analysis
Networks basic components:
Degree (of a vertex) Path Connected graph Cycles/circuits Tree
3rd edition
www.spatialanalysisonline.com
Network analysis
Networks basic components:
Tree - no circuits
www.spatialanalysisonline.com
Circuit
Cells: V-E+C=2
6
Network analysis
Networks compare topologies:
3rd edition
www.spatialanalysisonline.com
Network Analysis
Networks: Binary connectivity matrix
To vertex
From vertex
Vertex connectivity or adjacency matrix: Symmetric, binary, 0=non-connected or selfconnected, sparse; positive valued
3rd edition www.spatialanalysisonline.com 8
Network analysis
Networks basic components:
Direction
tree networks may have a consistent direction
e.g. river flows, broadcast data communications
circuit networks may have mixture of directions closed circuits may exist in directed networks
Magnitude (edge length, time, cost) Volume (flow from vertex to vertex) Weights/demand at vertices
3rd edition www.spatialanalysisonline.com 9
Network analysis
Networks: Source data
Network construction
Set of points in the plane Existing network to be augmented
Network analysis
Existing set of vertices, edges and associated attribute data A pre-defined or imposed topology Data representation issues
3rd edition www.spatialanalysisonline.com 10
Network analysis
Networks sample attributes:
turn attributes at intersections: permitted/notpermitted, turn penalties, U-turn permissions definition of weights/impedances, by direction definition of one-way edges and their direction specification of any permanent or temporary barriers demand and capacity constraint levels (edge and/or vertex based)
3rd edition www.spatialanalysisonline.com 11
Network analysis
Computational complexity
Optimisation problems and decision-making
Provably optimal Provably within defined bounds of optimality Good in practice
Network analysis
Key problems - 1:
Hamiltonian circuit (HC) NP-complete Eulerian circuit (EC) Shortest path (SP) P (linear--) Spanning tree (ST) Minimal spanning tree (MST) P (linear--) Steiner MST NP-complete Steiner tree NP-complete Travelling salesman problem (TSP) NPcomplete
3rd edition www.spatialanalysisonline.com 13
Network analysis
Key problems 2:
NP-hard or NP-complete: Vehicle routing problems (VRP) Transportation problems Trans-shipment problems Arc routing problems (ARP) Facility location on a network:
p-median/p-centre/coverage
3rd edition www.spatialanalysisonline.com 14
Network analysis
Typical problem parameters:
Objective function (e.g. length, cost, time) Constraints on the path (e.g. direct or via specified nodes) Input geometry (e.g. obstacles/barriers) Dimension of the problem (2D, planar?) Type of moving object (simple, constraints, friction) Single shot vs. repetitive mode queries (e.g. 1st, 2nd..) Static vs. dynamic environments Exact vs. approximate algorithms Known vs. unknown map
3rd edition www.spatialanalysisonline.com 15
Network analysis
Example logistics software facilities:
vehicle routing taking one-way streets into account trip routing taking restricted junctions into account varying speeds by road type and time of day trip routing of vehicles to avoid toll roads and toll bridges delivery routing taking account of customer access constraints by time of day night time/weekend truck routing controls weight and height restrictions (e.g. for truck routing) vehicle routing costs per mile/km and/or per hour weight/climb related vehicle routing costs
3rd edition www.spatialanalysisonline.com 16
Network analysis
Minimum spanning tree
connect every point to its nearest neighbour typically this will result in a collection of unconnected sub-networks connect each sub-network to its nearest neighbour sub-network iterate step 2 until every sub-network is interconnected
3rd edition
www.spatialanalysisonline.com
17
Network analysis
Minimum spanning tree (Euclidean)
A. Point set (nodes or vertices) B. MST
3rd edition
www.spatialanalysisonline.com
18
Network analysis
Gabriel network
A. Gabriel network construction B. Gabriel network
included
excluded
3rd edition www.spatialanalysisonline.com 19
Network analysis
Steiner tree (unweighted, Euclidean)
A. MST B. MST with 1 Steiner point
3rd edition
www.spatialanalysisonline.com
20
Network analysis
Shortest paths
Input: existing network, source vertex (s) and target vertex (t) or vertices Output: shortest path length, d(t), and vertex list; set of shortest paths (1st, 2nd, shortest); source to all vertices (shortest path tree) Solve by systematic search algorithm (single paths in near linear time) Large problems solve by A* heuristics
3rd edition www.spatialanalysisonline.com 21
s=1, t=3: Step 1: identify the shortest (least distance/cost/time) link from vertex 1 - this is to vertex 2 (cost = 4). Add vertex 2 and link from 1 to 2 to the tagged set Step 2: identify the shortest (least cost/time) link from vertex 1 or from vertex 2 plus link 1 distance - this is to vertex 4 from 2 (cost=6). Add vertex 4 and link 2 to 4 to the tagged set Step 3: identify the shortest (least cost/time) link from the tagged set - this is from vertex 1 to 2 to 4 to 3 (cost=7) Stop - all vertices reached; repeat from vertex 2, 3 and 4
3rd edition www.spatialanalysisonline.com 22
Network analysis
SPA: Dijkstra algorithm
1: initialise all vertices such that d(t)= and d(s)=0 2: For each edge leading from s, add the edge length from s to the current value of the path length at s. If this new distance is less than the current value for d(t) replace this with the lower value 3: choose the lowest value in the set d(t) and move the current (active) vertex to this location 4: iterate steps 2 and 3 until the target vertex is reached or all vertices have been scanned Optionally augment with preceding SP vertex list
3rd edition www.spatialanalysisonline.com 23
Network analysis
SPA sample problem specified tour
A. Delivery locations and road barriers B. Solution (sequential tour from 1-4)
Obstacles
3rd edition
www.spatialanalysisonline.com
24
Network analysis
Travelling salesman problems (TSPs)
Basic problem: given N locations in the plane, what is the shortest complete circuit Very difficult to solve for N large (NP-complete) Modest sized problems can be solved exactly, e.g. by systematic tree-based search, LP + cutting planes Larger problems can be solved using heuristic methods, e.g. Genetic Algorithms, Cross-entropy methods, Simulated annealing Applications: salesmen visiting customers; rubbish trucks servicing business premises; delivery trucks servicing retail outlets; security staff patrolling premises; VLSI design; analysis of DNA sequences
3rd edition www.spatialanalysisonline.com 25
Network analysis
Sample TSP problem and exact solution
A. Source vertices (130) from TSPLib B. Exact TSP solution (Concorde)
3rd edition
www.spatialanalysisonline.com
26
Network analysis
Sample TSP problem and heuristic solution (L-K)
A. Source vertices (130) from TSPLib B. Heuristic TSP solution
3rd edition
www.spatialanalysisonline.com
27
Network analysis
Travelling salesman problems - extensions
Multiple tours (e.g. divided point set) Should the tours start at the same point (e.g. warehouse, bus depot?) What if demand varies across the target points? Capacity constraints e.g. service vehicles may have limited capacity and vary in type what mix would be optimal? do tours/deliveries have to be made in certain time windows?
3rd edition www.spatialanalysisonline.com 28
Network analysis
Drive time zones
Network-derived zones of equal time from sample location Created as polygon layer(s) Can use map algebra techniques to compute estimated demand May include differential speeds for route type and off-road Can be slow to generate
3rd edition www.spatialanalysisonline.com 29