




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























CMSC 132 - Week 9
โ A graph is a pair ( V , E ), where โ V is a set of nodes, called vertices โ E is a collection of pairs of vertices, called edges โ Vertices and edges can be objects that store some information. โ Example: โ A vertex represents an airport and stores the 3-letter airport code โ An edge represents a flight route between 2 airports, and stores the route mileage Figure from Dr. Noha Adlyโs lectures, Alexandria University
โ End vertices or endpoints of an edge ( u, v ) โ Degree of a vertex in an undirected graph (in-degree and out-degree for directed graphs) โ Parallel edges: h and i are parallel edges โ Self-loops: j is a self-loop Figure from Dr. Noha Adlyโs lectures, Alexandria University
Adjacency List Adjacency Matrix List of Edges (A,B) (A,C) (A,D) (B,E) (B,F) (C,F)
Figure from Dr. Noha Adlyโs lectures, Alexandria University
Output: A D C F B E