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 !
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern