11_graphs

# 11_graphs - Graphs Graph theory is often considered to have...

This preview shows pages 1–13. Sign up to view the full content.

Graphs

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! Graph theory is often considered to have been born with Leonhard Euler ! In 1736 he solved the Konigsberg bridge problem ! Konigsberg was a city in Eastern Prussia ! Renamed Kalinigrad when East Prussia was divided between Poland and Russia in 1945 ! Konigsberg had seven bridges in its centre The inhabitants of Konigsberg liked to see if it was possible to walk across each bridge just once And then return to where they started ! Euler proved that it was impossible to do this, as part of this proof he represented the problem as a grap h October 2004 John Edgar 2
October 2004 John Edgar 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
October 2004 John Edgar 4
! The Konigsberg graph is an example of a multigraph ! A multigraph has multiple edges between the same pair of vertices ! In this case the edges represent bridges October 2004 John Edgar 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! Graphs are used as representations of many different types of problems ! Network configuration ! Airline flight booking ! Pathfinding algorithms ! Database dependencies ! Task scheduling ! Critical path analysis ! October 2004 John Edgar 6
! A graph consists of two sets ! A set V of vertices (or nodes) and ! A set E of edges that connect vertices ! | V | is the size of V , | E | the size of E ! Two vertices may be connected by a path ! A sequence of edges that begins at one vertex and ends at the other A simple path does not pass through the same vertex more than once A cycle is a path that starts and ends at the same vertex October 2004 John Edgar 7

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! If a graph has v vertices, how many edges does it have? ! If every vertex is connected to every other vertex … v 2 v ! If the graph is a tree v – 1 ! Minimum number of edges 0 October 2004 John Edgar 8
! A connected graph is one where every pair of distinct vertices has a path between them ! A complete graph is one where every pair of vertices has an edge between them ! A graph cannot have multiple edges between the same pair of vertices ! A graph cannot have self edges , an edge from and to the same vertex October 2004 John Edgar 9 connected graph complete graph disconnected graph and a tree

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! In a directed graph (or digraph) each edge has a direction and is called a directed edge ! A directed edge can only be traveled in one direction ! A pair of vertices in a digraph may have two edges between them, one in each direction October 2004 John Edgar 10 directed graph
! In a weighted graph each edge is assigned a weight ! Edges are labeled with their weights ! Each edge’s weight represents the cost to travel along that edge ! The cost could be distance, time, money or some other measure ! The cost depends on the underlying problem October 2004 John Edgar 11 weighted graph 1 3 2 4 3 1 3 5 2 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! Create an empty graph ! Test to see if a graph is empty ! Determine the number of vertices in a graph ! Determine the number of edges in a graph ! Determine if an edge exists between two vertices ! and in a weighted graph determine its weight ! Insert a vertex ! each vertex is assumed to have a distinct search key
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/17/2010 for the course CMPT 11151 taught by Professor Gregorymori during the Spring '10 term at Simon Fraser.

### Page1 / 49

11_graphs - Graphs Graph theory is often considered to have...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online