0% found this document useful (0 votes)
6 views21 pages

Graphs and Networks

The document provides an overview of graphs and networks, detailing concepts such as vertices, edges, weighted graphs, and various types of graphs including trees and complete graphs. It explains important graph theory terminology, including walks, paths, trails, cycles, and the handshake lemma. Additionally, it discusses connected graphs, directed graphs, and isomorphic graphs, with examples and exercises to test understanding.

Uploaded by

sahriamalik20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views21 pages

Graphs and Networks

The document provides an overview of graphs and networks, detailing concepts such as vertices, edges, weighted graphs, and various types of graphs including trees and complete graphs. It explains important graph theory terminology, including walks, paths, trails, cycles, and the handshake lemma. Additionally, it discusses connected graphs, directed graphs, and isomorphic graphs, with examples and exercises to test understanding.

Uploaded by

sahriamalik20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Graphs and Networks

Decision 1 Overview

1:: Algorithms 2:: Graphs and networks


Sorting and bin What is a graph and how they 3:: Algorithms on graphs
packing. represent things. What algorithms do I need to
be able to apply?
4:: Route inspection
5:: The Travelling Salesman
Find the shortest route 6:: Linear Programming
Find the shortest route
which travels along all How to find an optimal
which visits all places.
roads solution graphically

7:: The simplex algorithm


8:: Critical path analysis
How to find an optimal
solution algebraically. How to plan a project.
2.1 Modelling with graphs
A graph consists of points (called vertices or nodes) which are connected
by lines (edges or arcs).
If a graph has a number associated with each edge (usually called its
weight), then the graph is known as a weighted graph or network.

These are both graphs, for both say…


1) Why is it a graph?
2) What do
(a) the vertices,
(b) the edges represent?
2.1 Modelling with graphs

150 E 60
A Watch out – a weighted
30 80 100 F
B graph is not normally
60 50 D 90 drawn to scale.
Server

80
100 C

The network shows the length of time (in ms)


for a ping between different computers on a
network.
a) Write down the time it would take for 50ms
computer B to ping computer D.
b) Write a list of the computers which are A, B and F
directly connected to computer E.
c) List some of the routes a signal could take Server-A-E-F
from the server to computer F. Server-B-D-F
Server-B-A-E-F
Server-C-D-B-E-F
2.2 Graph theory terminology
B
A

F
D E

The vertices, or nodes are A, B, C, D, E and F, this list is sometimes called


the vertex set.

The edges, or arcs are AB, AC, AF, BC, BD, CE, CE and DE this list is
sometimes called the edge set.
Subgraphs
B
A

F
D E

A subgraph of G is a graph , each of whose vertices belongs to G and each of


whose edges belongs to G. It is simply a part of the original graph.
B B
A

C
F
D E D E

Two possible subgraphs of the graph above. Draw another subgraph in here
Degree or valency
B
A

F
D E

The degree or valency or order of a vertex is the number of edges incident to it.

Vertex Degree
If a vertex has even degree we
A 3
say it is even, similarly if the
B 3 vertex has odd degree we say
C 3 it is an odd vertex.
D 2
E 2
F 1 An odd vertex.
Test you understanding
B
A

The degree or valency or order of a vertex is the number of edges incident to it.

Vertex Degree
A 2
B 4
C 5
D 3
Walks, paths, trails and cycles
B
An example of a …
A Walk is FAEDFAB
Path is FAEC
C Trail is FABCEA
Cycle is FAEDF
F
Hamiltonian cycle
D E is FABCEDF

A walk is a route through a graph along edges from one vertex to the next.
A path is a walk in which no vertex is visited more than once.
A trail is a walk in which no edge is visited more than once.
A cycle is a walk in which the end vertex is the same as the start vertex and no
other vertex is visited more than once.
A Hamiltonian cycle is a cycle which includes every vertex.

LEARN ALL THESE DEFINITIONS!!!


Do not click this box. YOU WILL BE TESTED ON THESE NEXT LESSON!!!!
Test your understanding
B
A Walk is ABCDC
Path is ABCD
Trail is ABCDBFDB
Cycle is ADFA
F
Hamiltonian cycle
D C is ABCDF

A walk is a route through a graph along edges from one vertex to the next.
A path is a walk in which no vertex is visited more than once.
A trail is a walk in which no edge is visited more than once.
A cycle is a walk in which the end vertex is the same as the start vertex and no
other vertex is visited more than once.
A Hamiltonian cycle is a cycle which includes every vertex.

Do not click this box before you complete this slide…


Connected graphs
Two vertices are connected if there is a path between them. A graph is
connected if all its vertices are connected.

B
In this network A is connected
C to C but the network is not
connected because E is not
connected to the server.
A

If E were connected to any


other node the network would
E D
be said to be connected.

Make the graph connected…

Is the Great Britain mainland road network connected? Think then click.
Test your understanding
Which of these graphs are connected?
Connected Not connected
B
A
B
A

F
F D E
D C

Connected Not connected


B
A

F D
Loops and multiple edges
A loop is an edge which starts and finishes at the same vertex.

B
A

D
A loop
If a graph represented a
telephone network, why would
you want multiple edges?

Multiple edges So an organisation can make


multiple phone calls
simultaneously.
Simple graphs
A simple graph is one in which there are no loops and there is at most
one edge connecting any pair of vertices.

B
A
Two examples of simple graphs
C

F D

Source
Directed Graphs
A directed graph is one in which the edges of the graph have a
direction associated with them, the edges are known as directed
edges. Directed graph is often abbreviated to digraph.

A B

F D

Two examples of directed graphs


The Handshake Lemma
In any undirected graph, the sum of the degrees of the vertices is equal
to the number of edges, as a consequence, the number of odd vertices
must be even. This result is known as the handshake lemma.

B
A
On this graph there are 2
C odd vertices

B On this graph there are 4


A
odd vertices
C
Try and draw a graph with an
F odd number of odd vertices
D E and see what happens.
2.3 Special types of graph
A tree is a connected graph with no cycles.

Bush Not a tree – contains a cycle


B B
A A

Tree C

F
D C D

Not a tree – not connected


B B
A

Tree C C

D E F D
2.3 Spanning trees
A spanning tree is a subgraph, which
includes all the vertices and is a tree.

Graph G Draw all the possible spanning trees of G


B B
A A
C
C
D

A B
D
C

B D
A B A
C C
A B
D B D
A C
C
D
D
2.3 Complete graphs
A complete graph is a graph in which every vertex is directly
connected by a single edge to each of the other vertices.

𝐾1 𝐾2 𝐾3

𝐾4 𝐾5 𝐾6
Isomorphic graphs
Isomorphic graphs are graphs which show the same information
but may be drawn differently.

Is isomorphic to
B and B
A A E
Is isomorphic to
E C

F D F
C D
Test your understanding
Identify the two isomorphic graphs below and justify why they
are isomorphic.
A
B
A 1 B
3 C
D C

B
Graph 1 is isomorphic to graph 2.
On both graphs
C • Vertex A is directly connected to B and D
A
2 • Vertex B is directly connected to A, B
and with a double edge to C
D
• Vertex D is directly connected to A, B,
and with a double edge to C
• Vertex C is directly connected to with a
double edge to D and B and a loop

You might also like