lecture 12 - Network Analysis.ppt - Salisbury …faculty.salisbury.edu/~ajlembo/419/networks.pdf–...

16
4/8/2013 1 Linear Operations Dynamic Segmentation © Arthur J. Lembo, Jr. Cornell University Dynamic Segmentation Geocoding Routing Network Analysis Dynamic Segmentation Dynamic segmentation associates multiple sets of attributes to any portion of a linear feature •Dynamic segmentation models linear © Arthur J. Lembo, Jr. Salisbury University features using routes and events A route represents a linear feature, such as a street, highway or stream Events are attributes associated with a route Dynamic Segmentation Commands Example of Dynamic Segmentation © Arthur J. Lembo, Jr. Salisbury University

Transcript of lecture 12 - Network Analysis.ppt - Salisbury …faculty.salisbury.edu/~ajlembo/419/networks.pdf–...

4/8/2013

1

Linear OperationsDynamic Segmentation

© Arthur J. Lembo, Jr.Cornell University

Dynamic SegmentationGeocoding

RoutingNetwork Analysis

Dynamic Segmentation• Dynamic segmentation associates multiple

sets of attributes to any portion of a linear feature

• Dynamic segmentation models linear

© Arthur J. Lembo, Jr.Salisbury University

y gfeatures using routes and events– A route represents a linear feature, such as a

street, highway or stream– Events are attributes associated with a route

Dynamic Segmentation Commands

• Example of Dynamic Segmentation

© Arthur J. Lembo, Jr.Salisbury University

4/8/2013

2

What is Dynamic Segmentation

• Dynamic segmentation models linear features using routes and events

• Routes represent linear features (track centerline, stream, road)

© Arthur J. Lembo, Jr.Salisbury University

)• Routes contain measures which describe

distance along them• Events model data along routes

Where Dynamic Segmentation is Used• Collecting data along such linear features as

roads, rivers and railways• Managing pavement quality• Managing public transit

Managing railroad track quality

© Arthur J. Lembo, Jr.Salisbury University

• Managing railroad track quality• Managing rivers and streams• Modeling shorelines• Modeling pipelines• Analyzing oil and gas exploration

5-Year Frequency Analyses Maps from TC -81

© Arthur J. Lembo, Jr.Salisbury University

4/8/2013

3

© Arthur J. Lembo, Jr.Salisbury University

Dynamic Segmentation of TC-81 Data

SuperelevationWide Gauge Wide Gauge

Superelevation

© Arthur J. Lembo, Jr.Salisbury University

4/8/2013 8

;Cold Spring Harbor

Su

Wide Gauge

© Arthur J. Lembo, Jr.Cornell University

Routing and Scheduling

4/8/2013

4

What is routing• Once you find where your clients are, the next thing you have to do is

figure out how to get to them.• But, if you want to stay in business, you better figure out how to get to

them better than your competitor.• This concept will focus on routing and scheduling, which is a fast

growing area of geospatial analysis, used by businesses to enhance

© Arthur J. Lembo, Jr.Salisbury University

their competitive edge.• Routing is a computing method for finding a shortest or least-cost path

in which to visit locations in a street network. The cost doesn’t have to be just money. It could represent time (which in business is money ☺), or it could be distance, or even danger.

• We’ve just thrown a couple buzz words at you: network, and least-cost.

• When we talk about "networks" we are really talking about a branch of mathematics called graph theory. In mathematics, a "graph" represents the mathematical description of a series of nodes that are often joined by links. You can think of the links as lines connecting the

d

Routing terms

© Arthur J. Lembo, Jr.Salisbury University

nodes. • For clarification, we will not be using the term lines because routing is

focused on graph theory, or networks, and mathematicians use the term links instead. So to separate the differences between network analysis and basic GIS we will use the term link.

• Links are termed either directed or undirected. A directed link is like a one-way street: it starts at one node and ends at another node. In the case of a directed link, one assumes the travel paths have directionality, and are often called directed networks. Structuring a network with directed links would prevent a path from driving the wrong way on a one way link

Routing terms

Directednetwork

© Arthur J. Lembo, Jr.Salisbury University

driving the wrong way on a one way link.• An undirected link has no implied direction.

Therefore, you can traverse in any direction. So, if a two lane road was represented in a GIS by a single centerline, the network representation would be an undirected link. Networks that have only undirected links are called undirected networks.

• Transportation systems used in business geographics usually are usually a combination of both directed and undirected networks

Un-Directednetwork

4/8/2013

5

• We also introduced the term least-cost. Links and nodes in networks may also have weights associated with them. Weights are values assigned to the link or node that represents a potential constraint on the object such as the flow capacity, the

Routing terms

© Arthur J. Lembo, Jr.Salisbury University

p y,length of the link, the speed limit, the average travel time, or the number of delivery points along the link. Nodes can also have weights that might represent a penalty for a left hand turn, or the delay for stopping at an intersection.

• Graphs or networks that have weights associated with them are termed weighted graphs

• A directed route is a represented in a graph where all the edges in the route from the first node to the last node are oriented in the correct way to allow a continuous path from the beginning to the end.

• Path was another term we used. A path is essentially a minimum cost route through a network between targeted locations. Paths are usually visited in a specified order that are known beforehand. For instance, a

Routing terms

© Arthur J. Lembo, Jr.Salisbury University

visited in a specified order that are known beforehand. For instance, a repairman might have appointments that he must keep throughout the day, so he looks for the least cost path between appointments.

• A tour represents situation where we don’t know the order. So, we have to find both the order to visit the stops and the shortest path between the stops. Therefore, a tour orders the stops and then finds the least-cost path among them.

• We’ll see more of this shortly.

Dijkstra’s Algorithm• For a given source vertex (node) in the graph, the

algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex.

• It can also be used for finding costs of shortest paths from a single vertex to a single destination vertex by

© Arthur J. Lembo, Jr.Salisbury University

g g ystopping the algorithm once the shortest path to the destination vertex has been determined.

• For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities.

4/8/2013

6

Dijkstra’s Pathfinding Algorithm

• Understanding the algorithm helps design better databases and analyses; helps anticipate and diagnose problems

• One way to find the least-cost path would be

© Arthur J. Lembo, Jr.Salisbury University

y pto examine all of them– Trouble is: this gets real big, real fast– http://students.ceid.upatras.gr/~papagel/project/k

ef5_7_1.htm– http://www.dgp.toronto.edu/people/JamesStewart/

270/9798s/Laffra/DijkstraApplet.html

Dijkstra’s Pathfinding Algorithm

• Important terms– Origin node – the starting node– Adjacent nodes – for any node, the nodes on the

other end of the connected arcs

© Arthur J. Lembo, Jr.Salisbury University

• Uses a “reached” table that stores any node that has been reached by the least cost path

• Uses a “scanned” table to keep track of temporary costs to nodes as they are processed

Dijkstra’s Pathfinding AlgorithmSet the origin node as reached, place it on the reached tables, and scan the adjacent nodes

Pick the scanned node with the lowest cumulative cost and put it on the reached table

Any more

© Arthur J. Lembo, Jr.Salisbury University

Trace least-cost path between origin and destination

Scan nodes adjacent to the node just reached and put them on the scanned table

nodes

to scan?Yes

No

4/8/2013

7

Network Analysis in Arc

• Finding the best path (shopping centers)

• Finding the closest facilityFi di i

© Arthur J. Lembo, Jr.Salisbury University

• Finding service areas• Create OD cost matrix

UNIQUE ISSUES INROUTING

• Routing in a GIS is actually the marriage of two powerful state of the art sciences: namely, integrating

Marriage of State-of-the-Art

© Arthur J. Lembo, Jr.Salisbury University

y, g ggeographic information systems with mathematical graph theory.

GIS Technologies

Advanced Routing Algorithms based on graph

theory

© Arthur J. Lembo, Jr.Salisbury University

• For most people, routing is typically thought of as the method for getting from one place to another. Similar to this Mapquest web page.

• It is certainly true that what Mapquest is doing through their web page is routing. However, we will see that routing can be a whole lot more, and a whole lot more beneficial to a business.

4/8/2013

8

CLASSIFICATION OF ROUTING AND SCHEDULING PROBLEMS

Routing and scheduling problems can be broken down intomany different sub categories. We will look at the following:

Shortest Path ProblemTraveling Salesman Problem (TSP)

© Arthur J. Lembo, Jr.Salisbury University

g ( )M-TSPSingle Depot, Multiple Vehicle RoutingMultiple Depot, Multiple VehicleSingle Depot, Mult. Vehicle w/ DemandsCapacitated Arc Routing Problem

• The shortest path problem is the most basic routing solution. Essentially, we are interested in finding the least cost method to get from point A to point B on a connected graph.

• The problem is generally very easy to solve from a mathematical standpoint.

Shortest Path

© Arthur J. Lembo, Jr.Salisbury University

solve from a mathematical standpoint. In fact, most Sophomore or Junior college students obtaining a degree in operations research are often required write a shortest path algorithm as a class project.

• The following examples show a shortest path route in an example graph, and one on a real street network.

• This is an example of a simple path.

© Arthur J. Lembo, Jr.Salisbury University

4/8/2013

9

• Just because you have a GIS that can compute shortest path doesn’t mean you are doing routing. Hardly, as you will see, it gets more complex, way more complex.

Shortest Path

2

3 1

© Arthur J. Lembo, Jr.Salisbury University

y• For example, if we added

three more stops (#1, #2, #3) and just ran a shortest path algorithm, are answer would be less than ideal.

• By just coming up with shortest paths from 1 -> 2 -> 3 and then back home, is not the best solution.

• What we really want is the best overall tour through a graph

2

3 1

© Arthur J. Lembo, Jr.Salisbury University

© Arthur J. Lembo, Jr.Salisbury University

4/8/2013

10

• You can see that our second example actually created a tour, rather than multiple paths. This is often referred to as the traveling salesman problem.

• In theory, a salesman must find the most efficient way to visit all of the appointments in his territory. And, he doesn’t want to go back to an appointment he already made.

Traveling Salesman Problem

© Arthur J. Lembo, Jr.Salisbury University

to go back to an appointment he already made. • In reality, once you add more than a few links and a few

appointments (nodes) the problem is impossible to solve. The true optimal solution requires too many calculations, even with modern computers.

• Therefore, a heuristic (a fancy word for an educated guess) finds an approximate best tour, and for the most part is usually very close to the optimal solution.

• So, you can see that this is quite more complicated than a shortest path – hang on, we’re not out of the woods yet…

• We just modified our shortest path problem to create a tour for a single salesman. But, how many companies do you know that have only one salesman?

• The reality is, just because

Multiple Traveling Salesman Problem

© Arthur J. Lembo, Jr.Salisbury University

the GIS software you are thinking of buying can solve the traveling salesman problem, doesn’t mean its going to meet your need.

• That adds to the complexity alittle more, doesn’t it.

• The example on the right determines the least cost tour for two salesmen and five delivery points.

• You might be happy with our solution, IF YOU WERE THE RED SALESMAN!!!

• Obviously just finding the least cost tour is not enough here. One salesman is working four times harder than the other one.

• This is a classic example of what

Multiple Traveling Salesman –Balanced workloads

© Arthur J. Lembo, Jr.Salisbury University

This is a classic example of what happens in the sanitation or meter reading industries. One crew may be able to finish really early and go home (with pay), while the other crew has to work overtime (with time and a half pay). This amounts to a lot of money wasted on inefficiencies.

• The important consideration is to not just solve an optimal tour, but also meet a new constraint Cw(worktime) . That is, trying to get everyone to nominally work an 8 hour day.

4/8/2013

11

• This is a takeoff on the last example. But here, there is a single depot that the workers start at, and a single depot where they drop their truck off. This is a fairly typical scenario for a company that has delivery trucks housed at

Single Depot, Multiple Vehicle Routing

© Arthur J. Lembo, Jr.Salisbury University

has delivery trucks housed at their warehouse.

• We up-the-anty on this scenario by adding multiple depots and multiple salesmen.

• Each one of these scenarios, though having their basis in the shortest path, shortest tour, actually have some significant additions that you may not find in GIS software.

• Any college road-trip with 7 people trying to fit into a VW Bug will tell you that there is a finite amount of room in a vehicle. This same reality applies to routing.

• Whether you are delivering pizza, washing machines, or flowers, there is only so much space available within a truck Also if

Adding some demands – fixed capacity vehicles

© Arthur J. Lembo, Jr.Salisbury University

available within a truck. Also, if you are picking up things like garbage, there is only so much available space before you have to unload the truck.

• So here, one of the pickup locations has more merchandise. So, the routes may not be as short as we would like, but we need to satisfy our additional constraint of a fixed capacity vehicle.

– And remember, we may still have to meet our other constraints –nominal 8 hour days, multiple vehicles, single depot…

• If you have ever ordered an appliance, you understand the problem a customer faces when they are told the delivery truck will be there sometime on Tuesday. Or, to be real helpful, they may tell you Tuesday afternoon. This is an unacceptable requirement for some customers. And, if you want to stay ahead of your competition you have

Adding some demands – time windows

© Arthur J. Lembo, Jr.Salisbury University

y p yto provide better information like

– Our delivery truck is scheduled to be at your house between 3:00 and 4:00 in the afternoon.

• This just becomes another constraint within the routing solution. Here we need to find the best tour, while satisfying the condition of being at a particular location during a specific time, or not being at a location during a specific timeframe.

• A good example of avoiding an area at a certain time is for sanitation pickup. At restaurants you want to avoid stopping there during lunch or dinner times.

4/8/2013

12

• Just because you route to a street where a location exists, doesn’t mean that you are meeting all your criteria.

• Sometimes it makes sense t if th id f th

Adding some demands – side of street

© Arthur J. Lembo, Jr.Salisbury University

to specify the side of the street you want to drive up.

• For example, the bus should pull up on the correct side of the road so that riders don’t have to cross the street to get on the bus. There is no magic to make that happen, right hand side of the road pickup must be programmed into the software.

• Its one thing to find the shortest paths to individual delivery points, its another if your business visits all the locations on a street.

• Businesses like sanitation companies, the US Postal Service, and electric and gas utilities often have to visit every house on a block. Therefore, instead of 200 delivery points, there are possibly 100,000 or more delivery points and you might

Neighborhood Routing

© Arthur J. Lembo, Jr.Salisbury University

more delivery points, and you might have to visit every street in a neighborhood.

• So, the problem we are trying to answer is:

– Given an undirected network with demands for each link which must be satisfied by one or more vehicles, each of capacity W, find the vehicle tours that satisfy all demands at a minimal total cost

Considerations when building routes

We’ve certainly come a long way from our assumption that routing is simply finding the shortest path from point A to point B. Here are a few other considerations when performing routing. Think about these points when you evaluate routing software and ask the question “does the

© Arthur J. Lembo, Jr.Salisbury University

g qsoftware support this kind of functionality”

4/8/2013

13

• Number and types of vehicles available –can you change the number of vehicles in the fleet. Also, can to assign different types of vehicles such as a large truck or small truck.

• Vehicle costs – can each of the vehicles in the fleet be assigned different costs (some vehicles get better gas mileage than others)N b d hi l ti f t

Considerations when building routes

© Arthur J. Lembo, Jr.Salisbury University

• Number and geographic location of stops to service – can you assign the geographic location for multiple stops, or does the software only support a shortest path between two points?

• Frequency of collection – does the software allow you to assign the frequency of collection or delivery for individual stops (for example, in a nursing agency, does Mrs. Jones get visited on M,W,F, while Mrs. Smith only gets visited on T,R, and Mrs. Park has to be checked in both the AM and PM on W and F).

• Volume variability – Does the software allow you to change the amount of volume per site. If you are collecting garbage, some on restaurant have more garbage than others. Or, on Valentines Day, you certainly deliver more flowers than on other days. Also, funeral parlors typically get more flowers than residential customers.

Considerations when building routes

© Arthur J. Lembo, Jr.Salisbury University

• Crew availability and costs – Does the software allow you to assign different crews or skill-sets to a vehicle. For instance, do you have less people available on Mondays to work. Or, if you do construction, are your electricians available on M and W, and your plumbers are only available on M.

• Geography (terrain, barriers to travel) – Does the software allow you to consider the terrain in assigning costs. That is, if you collect garbage, do you want to avoid areas with hills at the end of the day since the truck will be more full.

• Transportation network (one way streets, seasonality) – does the software use a single street centerline, or can you modify the centerlines to account for some streets being closed in the winter?

• Disposal sites (location, queuing and dump time) – Can the software allow you to specify multiple pick up locations, or do you have to stick with one. For example, if you work for a retailer,

Considerations when building routes

© Arthur J. Lembo, Jr.Salisbury University

have to stick with one. For example, if you work for a retailer, delivering furniture, can you pick up furniture in a warehouse on the east end of town, and later in the day, pick up addition furniture in the west end warehouse. Also, can you program in the amount of time it takes to drop off the furniture at a location (for example, maybe a TV takes 30 minutes, but a dining room table takes 2 hours because the company offers “set-up”).

4/8/2013

14

Two Approaches to Solving Routing Problems

POINT TO POINT ROUTING

• Service Required at

NEIGHBORHOOD ROUTING

• Service Required on

© Arthur J. Lembo, Jr.Salisbury University

Individual Locations

• Low Density of Points to be Serviced

Most Street Segments

• Higher Density of Points to be Serviced

Two Approaches to Solving Routing Problems

Point to Point Routing• Easier to perform than

neighborhood routing• However, becomes difficult if

you try to represent very high density of customers as

Neighborhood Routing• Much more difficult to

perform than point to point routing

• Represents reality better than point to point routing

© Arthur J. Lembo, Jr.Salisbury University

high density of customers as points

than point to point routing when considering high density of customers

Point-to-Point RoutingKey Considerations

• When you perform point-to-point routing, you have to consider the following:

– Create route that go to the actual customer address

© Arthur J. Lembo, Jr.Salisbury University

– Create routes that Restriction the time of service

– Control the number and duration of routes– Support the insertion of new customers and

and the ability to swap routes (give route A to a different person

4/8/2013

15

Neighborhood RoutingKey Considerations

• When you perform point-to-point routing, you have to consider the following:

– Generate routes based on the length of the day, number of routes, or a combination of both Walk this circle

© Arthur J. Lembo, Jr.Salisbury University

– Create routes that can be walked, driven, or a combination of both. Like the example shown, a meter reader might drive a car to a subdivision, and then get out and walk the rest of the route. The question then is

• Where is the most efficient place to park the car and then walk

Drive to here

What to Look for In Routing Solutions

• You want to make sure that you accurately models real life constraints as we discussed in this concept.

• You want to make sure that the software

© Arthur J. Lembo, Jr.Salisbury University

can balance and optimize workload.

• The system supports “what-if” scenarios (closed streets, people calling in sick so you have a smaller crew

• Solutions can be output in both text direction and map formats

Benefits of Good Routing Solutions

• Studies in routing solutions show that here is often anywhere from 10% to 23% reduction in fleet costs when using routing and optimization software• Crew cost savings• Mileage reduction• Vehicle cost savings

© Arthur J. Lembo, Jr.Salisbury University

• Reduction in Route Planning Efforts• City of Charlotte, NC estimates a savings in excess of

2,800 person hours in route planning• Improved Customer Service

• Reliable scheduling• Meet time window demands of your customers • And, as they say on the VISA commercial

Staying ahead of your competition - PRICELESS

4/8/2013

16

Conclusion• We have covered a lot of ground, and have

really expanded the notion of shortest path to some real life routing solutions.

• You should be able to appreciate the kinds of

© Arthur J. Lembo, Jr.Salisbury University

ppcomplexities that routing solutions can offer, and also articulate the kinds of things you need a routing solution to do for you.