Programming for Geographical Information Analysis: Advanced Skills Online mini-lecture: Introduction to Networks Dr Andy Evans.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Graph. -traffic modeling MAXIMUM FLOW -shortest (fastest) route SHORTEST PATH -efficient distribution, logistics, pickup/delivery HAMILTONIAN PATH/CYCLE,
Chapter 8 Topics in Graph Theory
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
DMOR Networks. Graphs: Koenigsberg bridges Leonard Euler problem (1736)
BY: MIKE BASHAM, Math in Scheduling. The Bridges of Konigsberg.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Discrete Math Round, Round, Get Around… I Get Around Mathematics of Getting Around.
GRAPH Learning Outcomes Students should be able to:
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Chapter 2 Graph Algorithms.
Graph Theory Topics to be covered:
© Nuffield Foundation 2011 Nuffield Free-Standing Mathematics Activity Chinese postman problems What route can I take to avoid going along the same street.
Representing and Using Graphs
Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we can find a path that goes over all.
Graphs Rosen, Chapter 8. Isomorphism (Rosen 560 to 563) Are two graphs G1 and G2 of equal form? That is, could I rename the vertices of G1 such that the.
Chinese postman problem
Structures 7 Decision Maths: Graph Theory, Networks and Algorithms.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
CS 200 Algorithms and Data Structures
Mathematics of Networks (Cont)
Graphs, Puzzles, & Map Coloring
Data Structures & Algorithms Graphs
Unit 5 Graphs & Trees 1 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Unit 5 Discrete Mathematics and Statistics Graphs and Trees.
Graphs Edge(arc) Vertices can be even or odd or undirected (two-way) Edges can be directed (one-way) This graph is connected. Degree(order) = 3 Odd vertex.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Mathematics in Management Science
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
Chapter 6: Graphs 6.1 Euler Circuits
Introduction to Graph Theory
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1) Find and label the degree of each vertex in the graph.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
Introduction to Graph & Network Theory Thinking About Networks: From Metabolism to the Genome to Social Conflict Summer Workshop for Teachers June 27 th.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
An Introduction to Graph Theory
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics Sixth Edition
EECS 203 Lecture 19 Graphs.
Çizge Algoritmaları.
Data Structures Graphs - Terminology
CS1022 Computer Programming & Principles
Routing Through Networks - 1
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
EECS 203 Lecture 20 More Graphs.
Discrete Maths 9. Graphs Objective
Graph Algorithm.
Can you draw this picture without lifting up your pen/pencil?
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graphs Chapter 13.
Genome Assembly.
Foundations of Discrete Mathematics
Networks Kruskal’s Algorithm
Graph Theory Relations, graphs
Presentation transcript:

Programming for Geographical Information Analysis: Advanced Skills Online mini-lecture: Introduction to Networks Dr Andy Evans

This lecture Introduction. Graph theory. Types of Networks. Path analysis. Flow analysis.

Networks? Vehicle / Distribution: Motorways, rail, electricity grid, water, nerves, circuits. Socio-economic: Trade, politics, friendship. Spatial-temporal: Timetables, zonal maps, chemical structures. Almost any set of complex relationships between variables can be represented as a network in variable space.

Graph Theory The study of networks as graphs. How do we efficiently move around networks? How do networks break down? Can we add links to improve networks? How do things spread around networks?

Combination of (potentially disconnected) Vertices and Edges. Can be Directional (sometimes called digraphs) What is a graph?

Vertices are the points on a network. Edges are the relationships. The degree of a vertex is the number of edges it has connected to it.

Representing networks Note that it is only the connections that matter, not how they’re drawn. E.g. contiguousness in maps

Types of graph Planar graphs can be redrawn without crossing. Tree Complete: each vertex is connected to all the others. Regular: each vertex has the same number of edges. Simple: no loops or multiple paths.

Walks, Trails and Paths A Walk: any sequence of adjacent edges. A Trail: any sequence of unrepeated adjacent edges. A Path: any sequence of adjacent edges that don’t visit the same vertex more than once. A trail, but not a path. A path that ends where it begins is called a Cycle.

Eulerian networks A graph is Eulerian if there is a trail containing every edge in a graph. Euler solved the K ö nigsberg Bridges problem: can you cross all the bridges and return to your starting point, crossing each once and once only… A B C D

Eulerian networks A graph will contain a cycle if each vertex has a degree of >2. A connected graph is Eulerian if, and only if, the degree of each vertex is even. A semi-Eulerian network is the same but doesn’t end up at its start. A connected graph is semi-Eulerian when only two of its vertices are odd. Uses: Designing one-way systems. Designing diversions / flow alterations.

Fleury’s Algorithm How to construct a Eulerian trail in a Eulerian graph. Start with any vertex, and travel through the edges, following these rules… 1. As you go through each edge, mark it as taboo. 2. If you create isolated vertices, mark them as taboo. 3. Only use a bridge as a last resort. A bridge is an edge connecting two otherwise disconnected graphs…

Hamiltonian networks A graph is Hamiltonian if there’s a path taking in every vertex once only, that ends where it began. A graph is semi-Hamiltonian if there’s a trail taking in every vertex once only that doesn’t end where it began. Dirac’s Theorem A simple graph with n vertices (more than two) is Hamiltonian if the degree of each vertex is greater than n/2. Note that there may be more Hamiltonian situations.

Weighted graphs So far we’ve only been interested in connections, but we can add strength, capacity, or length of connections. This gives much more realistic networks, and allows us to study real path optimisation problems Path length = 5

Path optimisation problems Three major problems Shortest Path Problem What is the shortest path between two points? Chinese Postman Problem What is the shortest way around a network back to the start taking in each edge (imagining the edges to be roads of houses)? Travelling Salesman Problem What is the shortest way around a network back to the start taking in each vertex (imagining each to be a city)?

Shortest Path Problem Find the shortest path across a weighted graph AB

Shortest Path Problem algorithm Move from A to B, treating all the vertices at each distance from the start in turn. Attribute the value of the shortest path to each vertex to that vertex, then reassess each of its neighbours to see if the path is now shorter to them. Continue until at the destination and follow back shortest path A A 0 2 3

Chinese Postman Problem Suggested by Mei-Ku Kwan Find the shortest walk taking in all the weighted edges and coming back to the start. If the graph is Eulerian we can use Fleury’s method. If not we find a semi-Eulerian trail using Fleury’s to take in all the edges. We then use the Shortest Path algorithm to find our way back to the start.

Travelling Salesman Problem Find the shortest weighted path needed to visit a number of cities once (i.e. the shortest Hamiltonian path). No efficient accurate algorithm. Could calculate all the possible Hamiltonians and pick the shortest. However, for 20 cities on a Hamiltonian graph, there are about 6 x such possible paths. One solution is to use a Minimum Connector.

The Minimum Connector Problem Work out the smallest sub-network to connect a set of vertices on a weighted network – a spanning tree. 1) Choose the smallest weighted edge. 2) Continue picking the next smallest connected edges but not using edges that form cycles with the ones already picked

The Travelling Salesman revisited If we remove a vertex from a Hamiltonian path, we end up with a spanning tree. To get an good approximation for the Travelling Salesman path, we… 1) Remove a vertex from the graph, and its associated edges. 2) Form the minimum connector for the rest of the graph. 3) Add in the vertex and the two of its edges with the minimum weights. This will give us a semi-Hamiltonian which the solution can’t be better than, and which the solution will be close to. Alternatively use AI to search the solution space.

Network flows: strong connection Strongly connected graphs are those digraphs where every vertex can be reach from every other. A graph can be made into a strongly connected one if each edge is in a cycle. I.e. you can’t make a purely one-way system in a town split by a single bridge. Strongly connected Not strongly connected

Maximum Flow – Minimum Cut Given each part of a network has a capacity, what is the maximum capacity of the network? It equals the minimum capacity “cut” of the graph. A cut is a set of edges which a flow must pass through one of A B Cut 1Cut 2 Cut 3 Maximum flow 6 1 1

Other things Graph Theory can help with Finding the distribution of flow in interconnected networks with resistances and inputs/outputs. Calculating whether graph lines, e.g. railways, need to cross. Calculating the number of rearrangements possible between vertices on a graph. The maximum number of different paths between two places. Timetabling (using rooms and people as components). How many colours it takes to colour a zonal map. How long it takes to do a number of parallel tasks. Magic squares. Arranged marriages.

Summary Graph theory encapsulates the mathematics of networks. Eulerian graphs are those where you can visit all the edges one and end up at the start. Hamiltonian graphs are those where you can visit all the vertices once and end up at the start. The rules for these graphs help us design network systems.

Summary By giving weights to edges we can model real dynamic systems. We can find out optimal paths. We can work out transport loads.