• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 27 páginas
Examen

Cs6515 Graph Algorithms Questions And Complete Solutions

Document preview thumbnail
Vista previa 3 fuera de 27 páginas

CS6515 GRAPH ALGORITHMS QUESTIONS AND COMPLETE SOLUTIONS

Vista previa del contenido

Name: Score:


22 Multiple choice questions

Term 1 of 22
SCC algorithm time complexity

Use for max flow problems where capacities are always integers

O(n+m)
Uses topological sort (O(n+m)) on the reverse graph


O(mC), Pseudo-polynomial. C=size of max flow. Assumes integer capacities

To find the MST of an undirected graph

Term 2 of 22
When to use Dijkstra's?

Only useful for directed graphs. Use to get a metagraph of connected components. Each
SCC is represented as a single node. The resulting metagraph is always a DAG.

Use for max flow problems where capacities are not necessarily integers. Uses BFS to
find paths to augment. Use if C is unbounded, because runtime is O(nm^2)

Works for both directed and undirected graphs. Must have only non-negative edge
weights.


Use for max flow problems where capacities are always integers

,Term 3 of 22
Dijkstra's runtime?

O((n+m) log n)
log n is from using the min heap (to get the lowest cost weight)

O(n*m)
Remember, this uses a dynamic programming table. Will have found the shortest path
distances after n - 1 iterations. If the distances keep updating, there is a negative weight
cycle.

O(m log n) for both Kruskal's and for Prim's


Returns an n by n matrix of shortest path costs between EVERY pair of vertices.

Term 4 of 22
Edmunds Karp runtime

O(n^3)


visited array.

O(nm^2)

dist array, prev array

Term 5 of 22
When to use Bellman Ford?

Only useful for directed graphs. Use to get a metagraph of connected components. Each
SCC is represented as a single node. The resulting metagraph is always a DAG.

Use for max flow problems where capacities are not necessarily integers. Uses BFS to
find paths to augment. Use if C is unbounded, because runtime is O(nm^2)

Use for max flow problems where capacities are always integers


Use when there is a graph with negative edge weights. Gives us the shortest path from s
to every other vertex v. Slower than Dijkstra's algorithm. Dijkstra's was O((n+m)logn), but
this is O(n*m). Can also be used to detect negative weight cycles IF the cycle is reachable
from sources.

, Term 6 of 22
Complexity to find an MST

O(m log n) for both Kruskal's and for Prim's


Returns an n by n matrix of shortest path costs between EVERY pair of vertices.

O((n+m) log n)
log n is from using the min heap (to get the lowest cost weight)

O(n*m)
Remember, this uses a dynamic programming table. Will have found the shortest path
distances after n - 1 iterations. If the distances keep updating, there is a negative weight
cycle.

Term 7 of 22
How can we construct the minimum st cut from Ford Fulkerson?

Use for max flow problems where capacities are always integers

Take a max flow from Ford Fulkerson, f. In the residual network of G, using f, we know
that there is no path from s to t. We can set L to be the vertices reachable from s in the
residual network and R to be the vertices reachable from t in the residual network.

Use for max flow problems where capacities are not necessarily integers. Uses BFS to
find paths to augment. Use if C is unbounded, because runtime is O(nm^2)

An st cut is a cut that partitions the vertices of a graph into one set containing the source
vertex s and the other containing t. The st cut also specifies the edges that have one
endpoint in the set containing s and the other endpoint in the set containing t. The
weight/capacity of an st cut is the sum of the weights of the edges that cross the cut. The
minimum capacity st cut is also known as the maximum flow of the graph

Información del documento

Subido en
28 de noviembre de 2024
Número de páginas
27
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$9.50

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
STUDYFIELD
4.2
(20)
Vendido
97
Seguidores
14
Artículos
3222
Última venta
1 mes hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes