Graphs Eulerian and Hamiltonian Applications Graph layout software
Graphs
SET07106 Mathematics for Software Engineering
School of Computing Edinburgh Napier University Module Leader: Uta Priss
2010
Copyright Edinburgh Napier University Graphs Slide 1/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Outline
Graphs
Eulerian and Hamiltonian
Applications
Graph layout software
Copyright Edinburgh Napier University Graphs Slide 2/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Binary relations
5 1 3 45 7 9 a e a 4 c 7 d d z 9 3 e c 1 z
{ (a,5), (e,5),(e,4),(z,7) }
Copyright Edinburgh Napier University Graphs Slide 3/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
A binary relation can be represented as a graph
Students Subjects
Tim maths Mary biology John computing Sue Pete science
John
Tim biology Petecomputing maths
Sue Mary science
Copyright Edinburgh Napier University Graphs Slide 4/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
A graph consists of nodes (vertices) and edges
John
Tim biology Petecomputing maths
Sue Mary science
Copyright Edinburgh Napier University Graphs Slide 5/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Undirected and directed graphs
John
Tim biology Petecomputing maths
Sue Mary science
John
Tim biology Petecomputing maths
Sue Mary science
Copyright Edinburgh Napier University Graphs Slide 6/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
The complete graphs for n ≤ 6
Copyright Edinburgh Napier University Graphs Slide 7/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Exercises
I Draw the complete graph with 7 nodes.
I How many edges does every node have in a complete graph?
I How many edges does a complete graph have?
Copyright Edinburgh Napier University Graphs Slide 8/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
A graph can be connected or disconnected
John
Tim biology Petecomputing maths
Sue Mary science
Copyright Edinburgh Napier University Graphs Slide 9/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
A bipartite graph has two sets of nodes
Edges are from one set of nodes to the other. There are no edges within the same set of nodes.
Tim
Pete computing maths
Sue Mary science
Copyright Edinburgh Napier University Graphs Slide 10/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Exercise
Are there any complete graphs which are bipartite?
Copyright Edinburgh Napier University Graphs Slide 11/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Can you draw this figure ...
in one go without starting and stopping in between?
Copyright Edinburgh Napier University Graphs Slide 12/31 Graphs Eulerian and Hamiltonian Applications Graph layout software
Eulerian path
Each edge is visited once.