





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Some concept of Data Structures and Algorithm are Permutation, Representation, Implemented, Algorithm Design, Dynamic Programming, Graph Data Structures, String Processing, General Trees. Main points of this lecture are: Graph Data Structures, Sort Yourselves, Alphabetical, Order, Midterms Efficiently, Return, Graphs, Unifying Themes, Computer Science, Vertices
Typology: Slides
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















Sort yourselves in alphabetical order so I can return the midterms efficiently!
In modeling a road network, the vertices may represent the cities or junctions, certain pairs of which are connected by roads/edges.
vertices - cities edges - roads
Stony Brook Green Port Orient Point
Montauk
Shelter Island
Sag Harbor
Riverhead
Islip
In an electronic circuit, with junctions as vertices as components as edges.
vertices: junctions edges: components
A graph G = (V, E) is undirected if edge (x, y) ∈ E implies that (y, x) is also in E.
undirected directed
Road networks between cities are typically undirected. Street networks within cities are almost always directed because of one-way streets. Most graphs of graph-theoretic interest are undirected.
In weighted graphs, each edge (or vertex) of G is assigned a numerical value, or weight.
unweighted
5
9 2
5
4 7
3
7
12 weighted
3
The edges of a road network graph might be weighted with their length, drive-time or speed limit. In unweighted graphs, there is no cost distinction between various edges and vertices.
Graphs are sparse when only a small fraction of the possible number of vertex pairs actually have edges defined between them.
sparse dense
Graphs are usually sparse due to application-specific con- straints. Road networks must be sparse because of road junctions. Typically dense graphs have a quadratic number of edges while sparse graphs are linear in size. Docsity.com
An acyclic graph does not contain any cycles. Trees are connected acyclic undirected graphs.
cyclic acyclic
Directed acyclic graphs are called DAGs. They arise naturally in scheduling problems, where a directed edge (x, y) indicates that x must occur before y.
A graph is embedded if the vertices and edges have been assigned geometric positions.
embedded topological
Example: TSP or Shortest path on points in the plane. Example: Grid graphs. Example: Planar graphs.
In labeled graphs, each vertex is assigned a unique name or identifier to distinguish it from all other vertices.
unlabeled labeled
B C
D E G F
A
An important graph problem is isomorphism testing , deter- mining whether the topological structure of two graphs are in fact identical if we ignore any labels.
A graph is undirected if (x, y) implies (y, x). Otherwise the graph is directed. The “heard-of” graph is directed since countless famous people have never heard of me! The “had-sex-with” graph is presumably undirected, since it requires a partner.
An edge of the form (x, x) is said to be a loop. If x is y’s friend several times over, that could be modeled using multiedges , multiple edges between the same pair of vertices. A graph is said to be simple if it contains no loops and multiple edges.
If I were trying to impress you with how tight I am with Mel Brooks, I would be much better off saying that Uncle Lenny knows him than to go into the details of how connected I am to Uncle Lenny. Thus we are often interested in the shortest path between two nodes.
A graph is connected if there is a path between any two vertices. A directed graph is strongly connected if there is a directed path between any two vertices.