SlideShare una empresa de Scribd logo
1 de 6
Boris, Ben, Bob, Bess, Beth and Bill are waiting in a
doctor’s surgery. Looking around the room, each of them
sees that they know some of the other people in the room.
Ben knows five of the other people sitting in the room,
Bob knows four of the others,
Beth and Bill both know three of the others,
Bess knows two of the others and
Boris only knows one of the other people.

Who knows who in the waiting room?
Adjacency Matrices
• Directed and Undirected Graphs
• Weighted graphs
Adjacency Matrix or List
• Matrix is fast and direct
• Quick for adding and deleting edges
• Not so good for adding and deleting
  vertices
• Can be very ‘sparse’ and therefore
  inefficient
Paths and Path problems
• From one vertex to another along edges

• Explorer’s problem
• Path that travels each edge once and returns
  to starting point

• Traveller’s problem
• Path that visits each vertex only once before
  returning to starting point.
Closed paths and cycles
• Closed Path or circuit:
  Path that ends at the starting vertex
• Cycle
  circuit for which each intermediate
  vertex is different
• Tree
  Undirected connected graph with no
  cycles
Closed paths and cycles
• Closed Path or circuit:
  Path that ends at the starting vertex
• Cycle
  circuit for which each intermediate
  vertex is different
• Tree
  Undirected connected graph with no
  cycles

Más contenido relacionado

Más de grahamwell

Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch developgrahamwell
 
The software story
The software storyThe software story
The software storygrahamwell
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphicsgrahamwell
 
Database field types
Database field typesDatabase field types
Database field typesgrahamwell
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and typesgrahamwell
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and typesgrahamwell
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9grahamwell
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your projectgrahamwell
 
The rail fence
The rail fenceThe rail fence
The rail fencegrahamwell
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryptiongrahamwell
 
Server side scripts
Server side scriptsServer side scripts
Server side scriptsgrahamwell
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and controlgrahamwell
 
Gm names n stuff
Gm   names n stuffGm   names n stuff
Gm names n stuffgrahamwell
 
Reverse polish notation
Reverse polish notationReverse polish notation
Reverse polish notationgrahamwell
 

Más de grahamwell (20)

Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
The software story
The software storyThe software story
The software story
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
 
Database field types
Database field typesDatabase field types
Database field types
 
Databases 101
Databases 101Databases 101
Databases 101
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and types
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
 
The rail fence
The rail fenceThe rail fence
The rail fence
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryption
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
 
Mtslesson
MtslessonMtslesson
Mtslesson
 
Hashing
HashingHashing
Hashing
 
Hashing
HashingHashing
Hashing
 
Gm names n stuff
Gm   names n stuffGm   names n stuff
Gm names n stuff
 
Reverse polish notation
Reverse polish notationReverse polish notation
Reverse polish notation
 

Graphs two

  • 1. Boris, Ben, Bob, Bess, Beth and Bill are waiting in a doctor’s surgery. Looking around the room, each of them sees that they know some of the other people in the room. Ben knows five of the other people sitting in the room, Bob knows four of the others, Beth and Bill both know three of the others, Bess knows two of the others and Boris only knows one of the other people. Who knows who in the waiting room?
  • 2. Adjacency Matrices • Directed and Undirected Graphs • Weighted graphs
  • 3. Adjacency Matrix or List • Matrix is fast and direct • Quick for adding and deleting edges • Not so good for adding and deleting vertices • Can be very ‘sparse’ and therefore inefficient
  • 4. Paths and Path problems • From one vertex to another along edges • Explorer’s problem • Path that travels each edge once and returns to starting point • Traveller’s problem • Path that visits each vertex only once before returning to starting point.
  • 5. Closed paths and cycles • Closed Path or circuit: Path that ends at the starting vertex • Cycle circuit for which each intermediate vertex is different • Tree Undirected connected graph with no cycles
  • 6. Closed paths and cycles • Closed Path or circuit: Path that ends at the starting vertex • Cycle circuit for which each intermediate vertex is different • Tree Undirected connected graph with no cycles