Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 The degree(order) of a vertex is the number of edges meeting at a vertex vertex (node) Degree(Order) = 2 Even vertex This is a graph.

2 The stations are the nodes and the tracks are the arcs. The London Tube map is an example. The arcs only indicate which nodes are joined not the distance between them. It should be called the London Tube Graph

3 Graph

4 Map

5 Before Harry Beck redesigned the tube map 1931 (Beck was responsible for the iconic, more user-friendly version we use today), Londoners used this map to navigate the underground network. It has many lost stations on it as well as different names for some existing ones.

6

7 49 mins 39 mins 28 mins 22 mins 24 mins 29 mins 34 mins 15 miles 17 miles 15 miles 12 miles 17 miles 21 miles 20 miles Networks Colchester Stowmarket Ipswich Sudbury Bury St Edmunds Harwich In a Network the arcs have values such as distances or journey times or traffic flow

8 Degree 3 Degree 2 loop Multiple arc arc The Degree ( Order) of a node An arc that starts and finishes at the same vertex is a LOOP. A graph with no loops or multiple edges is called a simple graph. is the number of arcs that meet at that node.

9 A connected graph has all nodes linked in. A graph that ‘falls apart’ is disconnected. disconnected simple connected graph

10 Bipartite Graphs have two sets of nodes with edges only joining nodes between sets and not within sets.

11 If every node in set 1 is joined to every node in set 2 then the graph is called a complete Bipartite Graph denoted by K r,s K 2,3 All the nodes are connected to nodes in the other set but nodes within the set are not connected.

12 A little history: the Bridges of Koenigsberg “Graph Theory” began in 1736 Leonhard Eüler – Visited Koenigsberg – People wondered whether it is possible to take a walk, end up where you started from, and cross each bridge in Koenigsberg exactly once

13 The Bridges of Koenigsberg A D C B 12 4 3 7 6 5 Is it possible to start in A, cross over each bridge exactly once, and end up back in A?

14 The Bridges of Koenigsberg A D C 12 4 3 7 6 5 Translation into a graph problem: Land masses are “nodes”. B

15 The Bridges of Koenigsberg 12 4 3 7 6 5 Translation into a graph problem : Bridges are “arcs.” A C D B

16 The Bridges of Koenigsberg 12 4 3 7 6 5 Is there a “walk” starting at A and ending at A and passing through each arc exactly once? Such a walk is called an eulerian cycle. A C D B

17 If every node is linked to every other node by a single edge it is complete. Everything meets when its complete If a graph is complete it is given the name K n where n is the number of nodes. K5K5 K3K3

18 If every node is linked to every other node by a single edge it is complete. K5K5 K3K3 How many arcs(edges)? Find a rule! Make a table K 3, K 4, K 5, K 6 etc

19 If a graph contains a closed trail then that section is called a cycle. A,B,D is a cycle in the graph below. B A D C A Cycle:

20 A connected graph in which there are no cycles (not closed) is called a Tree. The number of arcs of a tree is one less than the number of nodes. No. Arcs =No. Nodes = Tree 7 8 No. arcs = No. nodes -1

21 Paths Routes that do not visit any vertex more than once and do not go along any edge more than once except the start. A cycle forms a loop by returning to its starting point

22 Colchester Stowmarket Ipswich Sudbury Bury St Edmunds Harwich adjacency matrix B Su C H I St An Adjacency Matrix shows which vertices are joined

23 Colchester Stowmarket Ipswich Sudbury Bury St Edmunds Harwich distance matrix B Su C H I St 15 miles 17 miles 15 miles 12 miles 17 miles 21 miles 20 miles An Distance Matrix shows the distance between vertices. As it is undirected the matrix is symmetrical Harwich to Colchester = Colchester to Harwich

24 Directed Graphs (Digraph) If it is only possible to travel along the arcs in one direction then the graph is called a digraph. If a graph represents a street plan then some of the streets may be one way. Arrows are used to indicate the allowable direction. Arcs without arrows can be travelled in either direction

25 B A D C 3 2 1 4 5 If the network is a directed graph then the direction matters and the matrix is not symmetrical as can be seen below. It is not possible to go From A To B as the route is directed. A To C is 4 whereas C To A is 5 From To

26 B A D C 3 2 1 4 Networks A network is graph where each arc has a weight. This could be a distance if it represents a map or the number of cars that can travel down a road in a specified time without becoming congested. Representing a network using a matrix

27 Graphs in our daily lives Transportation Telephone Computer Electrical (power) Pipelines Molecular structures in biochemistry

28 Telephone network

29

30 Molecular chain of atoms in protein

31 Review of Graphs A graph (or network) consists of – a set of points – a set of lines connecting certain pairs of the points. The points are called. The lines are called Example: nodes (or vertices) arcs (or edges or links).

32 Terminology of Graphs: Paths A path between two nodes is a sequence of distinct nodes and edges connecting these nodes. Example: Walks are paths that can repeat nodes and arcs. a b

33 Adding two bridges creates such a walk 12 4 3 7 6 5 A C D B 8 9 Here is the walk. Note: the number of arcs incident to B is twice the number of times that B appears on the walk.

34 Existence of Eulerian Cycle 12 4 3 7 6 5 A C D B 8 9 The degree of a node is the number of arcs that meet at the node 6 4 4 4 Theorem. An undirected graph has an eulerian cycle if and only if (1) every node degree is even and (2) the graph is connected (that is, there is a path from each node to each other node).


Download ppt "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."

Similar presentations


Ads by Google