08-ch4-graphs.ppt

08-ch4-graphs.ppt - CS4102: Graph Traversals Review:...

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

View Full Document Right Arrow Icon
CS4102: Graph Traversals • Review: Section 2.5 • Definitions, data structures • Note: review definitions, data structures, and BFS from CS216 slides from 4-16-03 http://www.cs.virginia.edu/~cs216/notes/slides/graphs2.pdf • Read: Chapter 4 (from 4.2 on) • Traversing Graphs • Depth-first Search (DFS) • Breadth-first Search (BFS) • Applications of DFS strategy (things not in text) • Backtracking, Exhaustive Search (handout)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Problems: e.g. Airline Routes
Background image of page 2
Problems: e.g. Flowcharts
Background image of page 3

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

View Full DocumentRight Arrow Icon
Problems: e.g. Binary relation • x is a proper factor of y
Background image of page 4
Problems: e.g. Computer Networks
Background image of page 5

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

View Full DocumentRight Arrow Icon
Terms You Should Know or Learn Now • Vertex (plural vertices ) or Node • Edge (sometimes referred to as an arc ) • Note the meaning of incident • Degree of a vertex: how many adjacent vertices • Digraph: in-degree (num. of incoming edges) vs. out-degree • Graphs can be: • Directed or undirected • Weighted or not weighted • weights can be reals, integers, etc. • weight also known as: cost, length, distance, capacity,… • Undirected graphs: • Normally an edge can’t connect a vertex to itself • A directed graph (also known as a digraph ) • “Originating” node is the head , the target the tail • An edge may connect a vertex to itself
Background image of page 6
Terms You Should Know or Learn Now • Size of graph? Two measures: • Number of nodes. Usually n • Number of edges: usually m • Dense graph: many edges • Maximally dense? • Undirected: each node connects to all others, so m = n(n-1)/2 Called a complete graph • Directed: m = n(n-1) why? • Sparse graph: fewer edges • Could be zero edges…
Background image of page 7

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

View Full DocumentRight Arrow Icon
Terms You Should Know or Learn Now • Path vs. simple path • One vertex is reachable from another vertex • A connected graph • undirected graph, where each vertex is reachable from all others • A strongly connected di graph: • direction affects this! • node u may be reachable from v, but not v from u • Strongly connected means both directions • Connected components for undirected graphs
Background image of page 8
Terms You Should Know or Learn Now • Cycle • Directed graph: non-empty path with same starting and ending node • An edge may appear more than once (but why?) Simple cycle : no node repeated except start and end • Undirected graph: same idea • If an edge appears more than once (I.e. non-simple) then we traverse it in the same direction • Acyclic: no-cycles • A connected, acyclic undirected graph: free tree • If we specificy a root, it’s a rooted tree • Acyclic but not connected? a undirected forest • Directed acyclic graph: a DAG
Background image of page 9

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

View Full DocumentRight Arrow Icon
Self-test: Understand these Terms? • Subgraph • Symmetric digraph • complete graph • Adjacency relation • Path, simple path, reachable • Connected, Strongly Connected • Cycle, simple cycle • acyclic • undirected forest • free tree, undirected tree • rooted tree • Connected component
Background image of page 10
Background image of page 11

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

View Full DocumentRight Arrow Icon
Definition: Directed graph • Directed Graph • A directed graph, or digraph, is a pair • G = (V, E)
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 50

08-ch4-graphs.ppt - CS4102: Graph Traversals Review:...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online