Graphs - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Graphs

Description:

Title: PowerPoint Presentation Author: Terry Griffin Last modified by: Terry Created Date: 11/10/2003 3:05:15 AM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:131
Avg rating:3.0/5.0
Slides: 21
Provided by: terryg7
Category:
Tags: depth | first | graphs | search

less

Transcript and Presenter's Notes

Title: Graphs


1
Graphs
4
2
1
3
5
6
7
10
8
9
2
What good is a graph.
  • Maps
  • Hypertexts
  • Circuits
  • Networks
  • Matching
  • Transactions
  • Schedules
  • Program structure

3
Graphs
  • A graph is a set of Vertices and a set of Edges
    that connect pairs of distinct vertices (with at
    most 1 edge connecting any pair of vertices).
  • This is a simple graph
  • What does this mean??

4
2
3
5
1
4
Graphs
  • Simple graphs have a property about the maximum
    number of edges
  • A graph with V vertices has at most
  • V(V-1) / 2 edges

5
Graphs Terms
  • Vertex Node
  • Arc Edge Link
  • Adjacent - Two graph edges are adjacent if they
    have a vertex in common. Likewise, two vertices
    are adjacent if they are joined by a graph edge.
  • Incident - An edge is incident to a vertex if the
    vertex is at one end of the edge. A vertex is
    incident to an edge if that edge is incident to
    the vertex.

1
6
Graphs Terms
  • Degree - The number of edges incident to a given
    vertex. Each vertex in a directed graph has both
    an indegree, the number of edges coming in to the
    vertex as well as an outdegree, the number of
    edges going out of the vertex.

7
Graphs Terms
  • Subgraph - A graph G1 is called a subgraph of
    graph G2, if every vertex of the first graph is a
    vertex in the second graph, every edge of the
    first graph is an edge in the second graph, and
    every edge of the first graph joins the same
    vertices as it does in the second graph. The
    purple vertices with bold edges G2 is a subgraph
    of the larger graph G1.

4
2
1
3
5
6
7
10
8
9
8
Graphs Terms
  • Isomorphic The simple graphs G1 and G2 are
    isomorphic if there is one-to-one correspondence
    between their sets of vertices which preserves
    vertex adjacency. For directed graphs the
    one-to-one correspondence must preserve adjacency
    while also preserving relative origins and ends
    of edges.
  • Which are isomorphic to each other??

9
Graphs Terms
  • Path A path in a graph is a set of vertices in
    which each successive vertex (after the first) is
    adjacent to its predecessor in the path.

4
2
1
3
5
6
7
10
8
9
10
Graphs Terms
  • Simple Path vertices and edges are distinct
  • Cycle Simple path in which the first and last
    vertices are the same.

4
2
1
3
5
6
7
10
8
9
11
Graphs Terms
  • Connected Graph A graph is connected if there
    is a path from every vertex to every other vertex
    in the graph.

12
Graphs Terms
  • Complete Graph A graph where all edges are
    present.

13
Graphs Terms
  • Spanning Tree
  • black edges part of the spanning tree
  • pink edges not

14
Graphs Terms
  • Compliment

15
Graphs Terms
  • Clique A maximum complete subgraph, or simply
    subgraph, which is not a part of any larger
    complete subgraph. The graph shown below has
    three cliques induced by the sets of vertices 1,
    2, 1, 3, 5, and 3, 4, 5, 6.

16
Graphs Terms
  • Bipartite A bipartite graph is a simple graph
    where the set of vertices can be separated into
    two subsets, called parts, so that every edge in
    the graph joins vertices from separate parts. For
    example, below shows a simple graph which is also
    a bipartite graph because it may be divided into
    two parts, given by the subsets 1, 2 and 3, 4,
    5, where every edge in the graph goes from a
    vertex in one part to a vertex in the other part.

17
Matrix Implementation
18
List Implementation
19
List vs. Matrix
  • List Implementation
  • Space E V
  • Finding an edge is proportion to V
  • Sparse Graphs??
  • Matrix Implementation
  • Space V2
  • Finding an edge is constant
  • Dense Graphs??

20
Graph Traversals
  • Breadth First Search
  • Depth First Search
  • Euler Path
Write a Comment
User Comments (0)
About PowerShow.com