Graph theory

620 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
620
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Graph theory

  1. 1. Graph Theory
  2. 2. Objectives• Understand the terms: – Graph • Vertex • Arc – Simple Graph – Directed Graph – Adjacency Matrix – Adjacency List
  3. 3. Definitions• Graph is a finite number of points connected by lines. Points are normally called vertices or nodes• Lines are called edges or arcs Edge/Arc Vertex Node
  4. 4. Network or weighted graph• Each edge/arc has an associated number 5 Time Distance 4 Money 3 3
  5. 5. “Connected”• Vertices are connected if there is a edge joining them• A graph is connected if all pairs of vertices are connected• A Simple Graph is one in which there are no loops and at most one edge connects any pair of vertices• A degree (or order) of a vertex is the number of edges connected to the vertex
  6. 6. Worked examples• Simple Graph G has six vertices and their degrees are 2d,2d,2d+1,2d+1,2d+1,3d-1 – where d is an integer• Show that d is even• Use the fact that the graph is simple to show that d < 3 and find a value for d• Draw a possible graph G
  7. 7. Directed graphs• Graph that has directed edges, eg: arrows on the edges 8 12 10 15
  8. 8. Complete Graph• Every vertex is connected by an edge to each of the other vertices. 5 vertices 4+ 3+ 2+ 1 edges
  9. 9. Question• Graph G has four vertices and edges of length 7,8, 8 and 9• Explain why G is not a complete graph• Stat the number of edges that must be added to G to make it complete• Draw a directed graph for a round- robin tournament involving three teams - A, B and C
  10. 10. Adjacency Matrix x 1 2 3 4 51 3 1 - 1 1 1 0 5 2 1 - 0 1 0 3 1 0 - 1 22 4 4 1 1 1 - 1 5 0 0 2 1 -
  11. 11. Adjacency List Vertex Adjacent Vertices1 3 1 2,3,4 5 2 1,42 4 3 1,4,5 4 1,2,3,5 5 3,4
  12. 12. Objectives• Understand the terms: – Graph • Vertex • Arc – Simple Graph – Directed Graph – Adjacency Matrix – Adjacency List

×