Docsity

Graph Theory: Understanding Connectedness, Cycles, and Representations in Computer Science, Study notes of Data Structures and Algorithms

Partial preview of the text

Download Graph Theory: Understanding Connectedness, Cycles, and Representations in Computer Science and more Study notes Data Structures and Algorithms in PDF only on Docsity!

Data Structures and Algorithms

CS245-2009-15Graphs^ David GallesDepartment of Computer ScienceUniversity of San Francisco

15-0:^ Graphs^ A graph consists of:^ A set of

nodes^ or^ vertices

(terms are

interchangable) A set of^ edges

or^ arcs^ (terms are

interchangable) Edges in graph can be either directed or undirected

15-2:^ Graph Problems^ There are several problems that are “naturally”graph problems^ Networking problems^ Route planning^ etc^ Problems that don’t

seem^ like graph problems can also be solved with graphs^ Register allocation using graph coloring

15-3:^ Connected Undirected Graph^ Path from every node to every other node^12

Connected

15-5:^ Connected Undirected Graph^ Path from every node to every other node^12

3

4 Not^ Connected

15-6:^ Strongly Connected Graph^ Directed Path from every node to every other node

Strongly Connected

15-8:^ Strongly Connected Graph^ Directed Path from every node to every other node

Not Strongly Connected

15-9:^ Weakly Connected Graph^ Directed graph w/ connected backbone

Weakly Connected

15-11:^ Cycles in Graphs^ Undirected cycles^12

Contains an undirected cycle

15-12:^ Cycles in Graphs^ Undirected cycles^12

Contains^ no

undirected cycle

15-14:^ Cycles in Graphs^ Directed cycles^12

Contains a directed cycle

15-15:^ Cycles in Graphs^ Directed cycles^12

Contains a directed cycle

15-17:^ Cycles in Graphs^ Directed cycles^12

Contains^ no

directed cycle

15-18:^ Cycles & Connectivity^ Must a connected, undirected graph contain acycle?