2+-+Graphs+and+Networks

=Graphs and Networks=

flat

= Edges and Vertices = Networks are used to model many real-life situations. For example, the network below is a simple map showing estimated distances and times between some English towns. A **graph** is a diagram consisting of **edges** and **vertices** that represent how objects are related to each other.

A **vertex** (or node) is a point where edges meet. The vertex is **even** or ** odd ** according to whether an even or odd number of edges meet there.

An **edge** is a line joining two vertices. It can be **directed** (i.e. one-way) or ** undirected ** (two-way).

A **weight** can be allocated to an edge. This may represent distance, time or costs. In the graph shown here, the vertices represent towns and the edges represent roads with weights representing the distances (or times) between the towns.

flat

=Paths and Cycles= A **path** is a route through the graph that does not visit any vertex more than once and does not go along any edge more than once. The graph above includes lots of paths. Two examples are given below.

A **cycle** is a path that forms a loop by returning to its starting point. Path B above is a cycle, but Path A is not a cycle.

flat

=Connected Graphs= A graph is **connected** if there is at least one route between each pair of vertices.

All the graphs above are connected, but the one shown here is not:

There is no road joining any of the English towns to Hoek van Holland (though you can get there by ferry from Harwich).

flat

=Matrices= A **matrix** is an array of numbers and is mathematical way of describing a graph without a diagram. It is easier to use abbreviations for the town names in this example: In an **adjacency** **matrix** these numbers represent the number of edges that directly join each pair of vertices.

In a **distance matrix** the numbers give the distance between each pair of vertices. The graph of the road network above can be written as adjacency and distance matrices:

flat

= Questions = Try these questions to see if you understand this section: (1) Copy and complete the table for the graphs below:


 * **Graph** || **Number of edges** || **Even nodes** || **Odd nodes** ||
 * A ||  ||   ||   ||
 * B ||  ||   ||   ||
 * C ||  ||   ||   ||

(2) The graph shows the rail network connecting six places in England. a) Draw an adjacency matrix. b) Draw a distance matrix. c) Sketch two paths through the graph. d) List nodes that give a cycle in the graph.

(3) This distance matrix gives the mileages between Manchester (M), Leeds (L), Sheffield (S), Doncaster (D) and Kingston upon Hull (K). Draw the corresponding graph of the network. Show on it the distances given in the matrix.

flat

=Answers= Here are the corresponding answers to the questions above:

(1)
 * ** Graph ** || ** Number of edges ** || ** Even nodes ** || ** Odd nodes ** ||
 * A ||  7  ||  Q, R, S  ||  P, T  ||
 * B ||  7  ||  W, X, Y  ||  V, Z  ||
 * C ||  8  ||  R, S, V, W  ||  T, U  ||

(2) (c) Sketches of any 2 routes that do not visit any vertex more than once and do not go along any edge more than once (e.g. BGWO, GBSDO)

(d) Any list of nodes that give a path that forms a loop by returning to its starting points

(3)

c) Sketches of any two routes that do not visit any vertex more than once and do not go along any edge more than once (eg BGWO, GBSDO)

d) Any list of nodes that give a path that forms a loop by returning to its starting point (eg GBSG, GSDOWG, GBSDOWG).