graphs chapter 19. 2 chapter contents some examples and terminology road maps airline routes mazes...
TRANSCRIPT
![Page 1: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/1.jpg)
Graphs
Chapter 19
![Page 2: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/2.jpg)
2
Chapter Contents
Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees
Traversals Breadth-First Traversal Dept-First Traversal
Topological Order Paths
Finding a Path Shortest Path in an
Unweighted Graph Shortest Pat in a
Weighted Graph
Java Interfaces for the ADT Graph
![Page 3: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/3.jpg)
3
Some Examples and Terminology
A graph is a collection of distinct vertices and distinct edges Edges can be directed or undirected When it has directed edges it is called a
digraph Vertices or nodes are connected by edges A subgraph is a portion of a graph that
itself is a graph
![Page 4: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/4.jpg)
4
Road Maps
A portion of a road map. Undirected edges
NodesNodes
EdgesEdges
![Page 5: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/5.jpg)
5
Street Maps
A directed graph representing a city's street map. Directed edges
![Page 6: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/6.jpg)
6
Path
A sequence of edges that connect two vertices in a graph
In a directed graph the direction of the edges must be considered Called a directed path
A cycle is a path that begins and ends at same vertex Simple path does not pass through any vertex
more than once A graph with no cycles is acyclic
![Page 7: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/7.jpg)
7
Weight
A weighted graph has values on its edges Weights or costs
A path in a weighted graph also has weight or cost The sum of the edge weights
Examples of weights Miles between nodes on a map Driving time between nodes Taxi cost between node locations
![Page 8: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/8.jpg)
8
Weights
A weighted graph.
![Page 9: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/9.jpg)
9
Connected Graphs
A connected graph Has a path between every pair of distinct
vertices A complete graph
Has an edge between every pair of distinct vertices
A disconnected graph Not connected
![Page 10: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/10.jpg)
10
Connected Graphs
Undirected graphs
![Page 11: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/11.jpg)
11
Adjacent Vertices
Two vertices are adjacent in an undirected graph if they are joined by an edge
Sometimes adjacent vertices are called neighbors
Vertex A is adjacent to B, but B is not adjacent to A.
![Page 12: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/12.jpg)
12
Airline Routes Note the graph with two subgraphs
Each subgraph connected Entire graph disconnected
Airline routes
![Page 13: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/13.jpg)
13
Mazes
(a) A maze; (b) its representation as a graph
![Page 14: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/14.jpg)
14
Course Prerequisites
The prerequisite structure for a selection of courses as a directed graph without cycles.
![Page 15: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/15.jpg)
15
Trees All trees are graphs
But not all graphs are trees A tree is a connected graph without cycles Traversals
Preorder, inorder, postorder traversals are examples of depth-first traversal
Level-order traversal of a tree is an example of breadth-first traversal
Visit a node For a tree: process the node's data For a graph: mark the node as visited
![Page 16: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/16.jpg)
16
Trees
The visitation order of two traversals; (a) depth first; (b) breadth first.
![Page 17: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/17.jpg)
17
Breadth-First Traversal(ctd.) A trace of a breadth-first traversal for a directed graph,
beginning at vertex A.
![Page 18: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/18.jpg)
18
Breadth-First Traversal Algorithm for breadth-first traversal of nonempty
graph beginning at a given vertex
Algorithm getBreadthFirstTraversal(originVertex)vertexQueue = a new queue to hold neighborstraversalOrder = a new queue for the resulting traversal orderMark originVertex as visitedtraversalOrder.enqueue(originVertex)vertexQueue.enqueue(originVertex)while (!vertexQueue.isEmpty()){ frontVertex = vertexQueue.dequeue()
while (frontVertex has an unvisited neighbor){ nextNeighbor = next unvisited neighbor of frontVertex
Mark nextNeighbor as visitedtraversalOrder.enqueue(nextNeighbor)vertexQueue.enqueue(nextNeighbor)
}}return traversalOrder
A breadth-first traversal visits a vertex and then each of the
vertex's neighbors before advancing
A breadth-first traversal visits a vertex and then each of the
vertex's neighbors before advancing
![Page 19: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/19.jpg)
19
Depth-First Traversal
Visits a vertex, then A neighbor of the vertex, A neighbor of the neighbor, Etc. Visit them, and push them into stack
Advance as much as possible from the original vertex
When no unvisited neighbor exists, back up by one level by popping up current vertex Considers the next neighbor branch
![Page 20: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/20.jpg)
20
Depth-First TraversalA trace of a depth-first traversal
beginning at vertex A of the directed graph
![Page 21: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/21.jpg)
21
Depth-First TraversalAlgorithm getDepthFirstTraversal(originVertex)
vertexStack = a new stack to hold vertices as they are visitedtraversalOrder = a new queue for the resulting traversal orderMark originVertex as visitedtraversalOrder.enqueue(originVertex)vertexStack.push(originVertex)while (!vertexStack.isEmpty()){
topVertex = vertexStack.peek()if (topVertex has an unvisited neighbor){ nextNeighbor = next unvisited neighbor of topVertex
Mark nextNeighbor as visitedtraversalOrder.enqueue(nextNeighbor)vertexStack.push(nextNeighbor)
}else // all neighbors are visited
vertexStack.pop()
}return traversalOrder
![Page 22: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/22.jpg)
22
Graph Traversal Exercises
Breadth-First and Depth-First Traversal starting from aBreadth-First and Depth-First Traversal starting from a
![Page 23: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/23.jpg)
23
Some of the possible Answers
Breadth-first a f h e g i d j k c l n b m o
Depth-first a f e d c b g h i j k l m n o
![Page 24: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/24.jpg)
24
Topological Order
Given a directed graph without cycles (DAG) An ordering of vertices in a directed acyclic
graph. In a topological order
Vertex a precedes vertex b whenever A directed edge exists from a to b
![Page 25: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/25.jpg)
25
Topological Order
First find any vertex with no incoming edges. Print this vertex, and remove it, along with its
edges from the graph. Then we apply the same strategy to the rest
of graph. Indegree of node: Incoming number of edges
![Page 26: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/26.jpg)
26
Topological Order
Three topological orders for the graph
![Page 27: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/27.jpg)
27
Topological Order
An impossible prerequisite structure for three courses as a directed graph with a cycle.
![Page 28: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/28.jpg)
28
Topological Orderundershorts
pants
belt
socks
shoes
shirt
tie
jacket
watch
![Page 29: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/29.jpg)
29
Topological Order
![Page 30: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/30.jpg)
30
Topological Order
The graph shown has many valid topological sorts, including:
7,5,3,11,8,2,9,10 7,5,11,2,3,10,8,9 3,7,8,5,11,10,9,2
![Page 31: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/31.jpg)
31
Shortest Path in an Unweighted Graph
(a) an unweighted graph and (b) the possible paths from vertex A to vertex H.
![Page 32: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/32.jpg)
32
Shortest Path in an Unweighted Graph
The graph after the shortest-path algorithm has traversed from vertex A to vertex H
![Page 33: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/33.jpg)
33
Shortest Path in an Unweighted Graph
Finding the shortest path from vertex A to vertex H in the unweighted graph
![Page 34: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/34.jpg)
34
Shortest Path in an Weighted Graph
(a) A weighted graph and (b) the possible paths from vertex A to vertex H.
![Page 35: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/35.jpg)
35
Shortest Path in an Weighted Graph
Shortest path between two given vertices Smallest edge-weight sum
Algorithm based on breadth-first traversal (Dijkstra algorithm)
Several paths in a weighted graph might have same minimum edge-weight sum Algorithm given by text finds only one of these
paths
![Page 36: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/36.jpg)
36
Shortest Path in an Weighted Graph
Finding the cheapest path from vertex A to vertex H
in the weighted graph
![Page 37: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/37.jpg)
37
Shortest Path in an Weighted Graph
The graph after finding the cheapest path from vertex A to vertex H.
![Page 38: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/38.jpg)
38
Shortest Path in an Weighted Graph
Shortest Path from A to E?
![Page 39: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/39.jpg)
39
Minimum Spanning Tree
The minimum spanning tree (MST) of a graph defines the cheapest subset of edges that keeps the graph in one connected component.
Telephone companies are particularly interested in minimum spanning trees, because the minimum spanning tree of a set of sites defines the wiring scheme that connects the sites using as little wire as possible.
![Page 40: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/40.jpg)
40
Greedy Algorithm
Greedy algorithms work in phases. In each phase, a decision is made that appears to be good, without regard for future consequences.
A greedy algorithm makes the locally optimum choice at each phase with the hope of finding the global optimum.
![Page 41: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/41.jpg)
41
Kruskal's Algorithm
Let G be a connected graph with n vertices Initialize n components, each one containing
one vertex of G. Now sort the edges in increasing order by
weight and set T = the empty set. Now examine each edge in turn. If an edge
joins two components, add it to T and merge the two components into one. If not, discard the edge.
Stop when only one component remains.
![Page 42: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/42.jpg)
42
Example
![Page 43: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/43.jpg)
43
Kruskal's Algorithm Ordered edges: [1,4], [6,7], [3,4], [1,2], [4,2], [3,1], [4,7], [3,6], [7,5], [4,5], [6,4], [2,5]
Components T (edges)1,2,3,4,5,6,7 empty[1,4], 2, 3, 5,6,7 [1,4][1,4], 2,3,5,[6,7] [1,4], [6,7][1,4,3], 2, 5,[6,7] [1,4], [6,7], [3,4][1,4,3,2], 5, [6,7] [1,4], [6,7], [3,4], [1,2][1,4,3,2,6,7], 5 [1,4], [6,7], [3,4], [1,2], [4,7][1,4,3,2,6,7,5] [1,4], [6,7], [3,4], [1,2], [4,7], [7,5]
![Page 44: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/44.jpg)
44
MST
![Page 45: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/45.jpg)
45
Find a MST
![Page 46: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/46.jpg)
46
Java Interfaces for the ADT Graph
Methods in the BasicGraphInterface addVertex addEdge hasEdge isEmpty getNumberOfVertices getNumberOfEdges clear
![Page 47: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/47.jpg)
47
Java Interfaces for the ADT Graph
A portion of the flight map
Operations of the ADT graph enable creation of a graph and
answer questions based on relationships among vertices
Operations of the ADT graph enable creation of a graph and
answer questions based on relationships among vertices
![Page 48: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/48.jpg)
48
The Adjacency Matrix
(a) A directed graph and (b) its adjacency matrix.
![Page 49: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/49.jpg)
49
The Adjacency Matrix
Adjacency matrix uses fixed amount of space Depends on number of vertices Does not depend on number of edges
Typically the matrix will be sparse Presence of an edge between two vertices
can be known immediately All neighbors of a vertex found by scanning
entire row for that vertex
![Page 50: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/50.jpg)
50
The Adjacency List
Adjacency lists for the directed
graph
![Page 51: Graphs Chapter 19. 2 Chapter Contents Some Examples and Terminology Road Maps Airline Routes Mazes Course Prerequisites Trees Traversals Breadth-First](https://reader038.vdocuments.site/reader038/viewer/2022103122/56649ccf5503460f9499b517/html5/thumbnails/51.jpg)
51
The Adjacency List
Represents only edges that originate from the vertex
Space not reserved for edges that do not exist Uses less memory than corresponding adjacency
matrix Thus more often used than adjacency matrix