CS101-09 Graphs - CJD 09 Graphs CJD Graphs G = Graph = a...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
CJD 09 Graphs
Image of page 1

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

View Full Document Right Arrow Icon
CJD Graphs G = Graph = a collection of vertices (or nodes) and connections between them = G(V,E) V = Vertex Set (the nodes) E = Edge Set (the connections) A B C D E F G H
Image of page 2
CJD Applications Applications : Flights between airports Personal or material relationships Intersections and streets, Mazes Network connections between computers; the Internet Oil Pipelines
Image of page 3

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

View Full Document Right Arrow Icon
CJD Definitions Directed Graph = Digraph = where each edge is an ordered pair from a source vertex to a target vertex. Self-loops – edges from a vertex to itself – allowed in digraphs Undirected Graph = Simple Graph = where each edge is a set of two vertices. Self-loops are disallowed. Multigraph = Graph in which two vertices can be joined by multiple edges and self-loops are allowed. Two vertices are adjacent if there is an edge between them. Complete Graph = undirected graph where each pair of vertices are adjacent.
Image of page 4
CJD Pictorial Representation of Graphs A B C D E F G H a b c d e f g h 1 5 6 3 7 V II 4 2 I IV III Undirected Graph Digraph Disconnected Tree U S T Complete
Image of page 5

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

View Full Document Right Arrow Icon
CJD More Definitions For undirected graphs : The degree of a vertex is the number of edges incident on it. For directed graphs : The in-degree of a vertex is the number of edges entering it. The out-degree of a vertex is the number of edges leaving it. Two graphs are isomorphic if their vertex and edge sets are the same after a suitable renaming. Graph G’(V’,E’) is a subgraph of G(V,E) if V’ V and E’ E and E' connects vertices in V'.
Image of page 6
CJD More Definitions … (2) A Path of length k is a sequence <v 0 , v 1 , … v k > of vertices, each vertex is adjacent to the next. v is reachable from u if there is a path from u to v. A path is simple if the vertices in the path are distinct. The path is a cycle if v 0 = v k An undirected graph is connected if every pair of vertices is connected by a path A directed graph is strongly connected if every vertex is reachable from every other vertex. A tree is a connected, acyclic undirected graph
Image of page 7

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

View Full Document Right Arrow Icon
CJD Graph Representation A B C D E F G H 1. Adjacency Matrix 2. Adjacency List
Image of page 8
CJD Adjacency Matrix Representation A table with as many rows and columns as the number of vertices of a graph. A table entry is 1 if an edge is incident from the vertex represented by that row to the vertex represented by that column. It is 0 otherwise. Symmetric for undirected graphs. A B C D E F G H A B C D E F G H A 0 1 1 1 0 0 0 0 B 1 0 0 1 1 0 0 0 C 1 0 0 1 0 0 0 0 D 1 1 1 0 1 1 0 0 E 0 1 0 1 0 0 0 0 F 0 0 0 1 0 0 1 1 G 0 0 0 0 0 1 0 0 H 0 0 0 0 0 1 0 0
Image of page 9

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

View Full Document Right Arrow Icon
CJD Adjacency List Representation For each vertex of a graph, there is a linked list of all vertices adjacent to it.
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern