• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 27 pages
Exam (elaborations)

Cs 6515 Exam(Graphs) Actual Exam Questions With Complete Solution Guide (A+ Graded 100% Verified) Latest Version 2025!!

Document preview thumbnail
Preview 3 out of 27 pages

CS 6515 EXAM(GRAPHS) ACTUAL EXAM QUESTIONS WITH COMPLETE SOLUTION GUIDE (A+ GRADED 100% VERIFIED) LATEST VERSION 2025!!

Content preview

CS 6515: Graphs

Topological ordering, is a list where every
vertex appears after all vertices it de-
pends on. For the image attached, this
would be the topological ordering:

XYZWU
XYZUW
Topological Ordering? XYUZW




Strongly Connected Components.

A component is strongly connected if
there is a path between a source vertex
and a destination vertex, and a path from
What is SCC? the destination vertex back to the source
vertex.

Another way a component is strongly
connected, is if no other vertex can reach
it. (Sink vertex)
{A},{B,E},{C,F,G},{D},{H,I,J,K,L}


What are the SCC, in this graph? Graph
is in the definition.



Does v with lowest post # always lie in a
No.
sink SCC?
Does v with the highest post # always lie
Yes
in a source scc?


,CS 6515: Graphs

input: DAG = (V,E) in adj list:
1. Construct reverse graph
2. Run DFS on the Reverse Graph
SCC Algorithm 3. Order V(vertex) by post # in decreas-
ing order
4. Run undirected connected compo-
nents all on G
dfs(G):

for all v V :
visited(v) = false

for all v V :
if not visited(v): explore(v)
DFS (Graph) Algorithm
Runtime: O (|V| + |E|})




Input: G = (V,E) is a graph; v V
Output: visited(u) is set to true for all
nodes u reachable from v

visited(v) = true
previsit(v)
Explore Algorithm
for each edge (v, u) E:
if not visited(u): explore(u)

Tip: The previsit and postvisit procedures
are optional
Previi
Runtime: O (E)



, CS 6515: Graphs




previsit(v):
ccnum[v] = cc

Background Info: Check if a graph is con-
nected and, more generally, to assign
each node v an integer ccnum[v] identi-
fying the connected component to which
it belongs.

Previsit(Vertex) CC needs to be initialized to zero and
to be incremented each time the DFS
procedure calls explore.




previsit(v):
pre[v] = clock
clock = clock + 1
Time Orderings: with Previsit(vertex) and
Postvisit(vertex)
postvisit(v):
post[v] = clock
clock = clock + 1



Undirected Graph Edges

Document information

Uploaded on
May 24, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Antitest
5.0
(514)
Sold
9632
Followers
5
Items
4344
Last sold
15 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions