0% found this document useful (0 votes)
13 views5 pages

Problem Set 4: Graphs: CS 3510: Design & Analysis of Algorithms

The document outlines Problem Set 4 for CS 3510, focusing on graphs and algorithms, with a due date of February 12th, 2025. It includes instructions for formatting solutions, specific requirements for algorithm explanations, and multiple problems involving Dijkstra's and Kruskal's algorithms, as well as true/false questions related to graph theory. Additionally, it presents a scenario involving intergalactic travel, requiring the development of an algorithm to minimize travel time between two points.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

Problem Set 4: Graphs: CS 3510: Design & Analysis of Algorithms

The document outlines Problem Set 4 for CS 3510, focusing on graphs and algorithms, with a due date of February 12th, 2025. It includes instructions for formatting solutions, specific requirements for algorithm explanations, and multiple problems involving Dijkstra's and Kruskal's algorithms, as well as true/false questions related to graph theory. Additionally, it presents a scenario involving intergalactic travel, requiring the development of an algorithm to minimize travel time between two points.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CS 3510: Design & Analysis of Algorithms February 4th 2025

Problem Set 4: Graphs


YOUR NAME HERE Due: February 12th 2025

• Please type your solutions using LATEX or any other software. Handwritten solutions will not
be accepted for this assignment.

• Your algorithms must be in plain English & mathematical expressions. Pseudo-code without
sufficient explanation will receive no credit.

• If we ask for an algorithm with a specific runtime, we will only accept answers with that
specific runtime, even if a faster solution exists. If we ask for an “efficient” algorithm, we
will not accept answers if a faster algorithm than the one provided exists.

• Unless a question explicitly states that no work is required to be shown, you must provide
an explanation or justification for your answer.
1.) Reference this graph for both parts of this problem:

10 3
A F C
5 8 4
4 6 3
4
H B D
3 4
2 1
3
G E

Part A

In the event of a tie, choose the node that is alphabetically first. Run Dijkstra’s on this graph to
find the shortest distance from node A to every other node. Show your work; we do not require a
specific format but we want to see that some work was performed.

Solution: [Write your answer here]

Part B

a) Run Kruskal’s algorithm on the given graph. Show your work and your final answer (the
MST).

Solution: [Write your answer here]

b) Suppose you are given an undirected graph. Show that if all the edge weights on the graph as
positive, then any subset of edges that connects all vertices and has a minimum total weight
must be a tree.

Solution: [Write your answer here]


2.) For each of the questions below, either answer True or False. If you answer False, provide
a counter example and a 1-2 sentence justification. If your counter-example is a graph, the graph
can have at most 4 nodes. If you answer True, provide a short 3-4 sentence explanation/proof.

a) Graph G has a single negative weighted edge e with weight w. We can find the shortest path
through G by adding |w| to all edges and running Dijkstra’s.

Solution: [Write your answer here]

b) Weighted graph G has a maximum spanning true M . If all edge weights in G are negated
to form G′ , M will be the minimum spanning tree in G′ .

Solution: [Write your answer here]

c) In every connected, undirected graph where each vertex has distinct edge weights, there are
multiple possible Minimum Spanning Trees.

Solution: [Write your answer here]

d) The Union-Find data structure is commonly used in Prim’s algorithm to help detect cycles
when building a Minimum Spanning Tree (MST).

Solution: [Write your answer here]


3.) You are given a strongly connected directed graph G = (V, E) with positive edge weights along
with a particular node v0 ∈ V . Give an efficient algorithm for finding shortest paths between all
pairs of nodes, with the one restriction that these paths must all pass through v0 .

(a.) Describe your algorithms to a degree where someone could implement it if given your answer.

Solution: [Write your answer here]

(b.) Argue why your algorithms are correct (given any input, why does your algorithm produce
the correct outputs).

Solution: [Write your answer here]

(c.) Give the runtime of your algorithm and explain the reasoning.

Solution: [Write your answer here]


4.) You recently found out that your sibling, who was adopted by aliens, lives on a distance planet
in a neighboring galaxy. Both of you want to reunite as soon as possible. However, the intergalactic
travel network is complex and requires stops at various planets before reaching each other’s galaxy.
To minimize travel time, you agree to meet at an intermediate planet, and then you simultaneously
jump into your spaceships and start flying toward each other. But where exactly should you meet?

You are given a weighted undirected graph G = (V, E), where the vertices V represent planets and
the edges E represent intergalactic routes that directly connect planets. Each edge e has a weight
w(e) equal to the time required to travel between the two planets. You are also given a vertex p,
representing your starting location, and a vertex q, representing your sibling’s starting location.

Describe and analyze an algorithm to find the target vertex t that allows you and your sibling to
meet as quickly (minimum total travel time) as possible.

(a.) Describe your algorithms to a degree where someone could implement it if given your answer.

Solution: [Write your answer here]

(b.) Argue why your algorithms are correct (given any input, why does your algorithm produce
the correct outputs).

Solution: [Write your answer here]

(c.) Give the runtime of your algorithm and explain the reasoning.

Solution: [Write your answer here]

You might also like