08-ch4-graphs.ppt

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

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

CS4102: Graph Traversals • Review: Section 2.5 • Definitions, data structures • Note: review definitions, data structures, and BFS from CS216 slides from 4-16-03 • 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)

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

View Full Document
Problems: e.g. Airline Routes
Problems: e.g. Flowcharts

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

View Full Document
Problems: e.g. Binary relation • x is a proper factor of y
Problems: e.g. Computer Networks

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

View Full Document
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
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…

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

View Full Document
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
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

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

View Full Document
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

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

View Full Document
Definition: Directed graph • Directed Graph • A directed graph, or digraph, is a pair • G = (V, E)
This is the end of the preview. Sign up to access the rest of the document.

## 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
Ask a homework question - tutors are online