CSE 2102 Module 4

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Consider the greedy algorithm that solves the interval scheduling problem. In which order will the requests be chosen?

By increasing finish time

Consider the greedy algorithm that solves the interval partitioning problem. In which order are the intervals selected?

By increasing start time

Which one of the following best describes the cycle property?

Consider a cycle in the graph. The most expensive edge in the cycle cannot be in any minimum spanning tree.

Which one of the following best describes the cut property?

Consider a partition of the nodes in a graph into two sets. The cheapest edge joining the sets must be in any minimum spanning tree.

In Dijkstra's algorithm, node will be added iteratively to a tree of shortest paths. Which one of the following selection strategies best describes Dijkstra's algorithm?

Consider all nodes reachable from the tree that are not already in the tree. Choose the one that has the shortest distance from the start node.

Which proof technique is commonly used to show that a greedy algorithm is not optimal?

Counterexample

Consider the problem of finding a minimum spanning tree of a weighted graph. Which one of the following algorithms does not find an optimal solution to the problem?

Dijkstra's algorithm

Consider the proof of correctness of Dijkstra's algorithm. We call the graph G, the start node s, the set of explored nodes S and the set of active nodes A. What is the claim that we prove to be true in each step of the algorithm?

For any node v in S, the path from s to v given by the algorithm is the shortest s-v-path in G. No shorter path can be found outside of S.

Which proof technique is used to show that the greedy algorithm that solves the interval scheduling problem is optimal?

Greedy stays ahead

Which strategy is used to prove correctness of Dijkstra's algorithm?

Greedy stays ahead

Consider the following graph. We use Dijkstra's algorithm to find the shortest distances from the node A to every other node. Which one of the following can not be the order in which the final distances for each one of the nodes are found?

A, C, D, E, F, G, B

At the point in Dijkstra's algorithm when a node is added to the set of explored nodes, we consider its neighbors. This might lead to a new shorter distance to one or more of them. In order to update the shortest distance when needed, we must keep track of the position of the nodes in the graph present in the primary data structure used in the implementation. Which secondary data structure can be used?

An array with n elements

Consider the greedy algorithm that solves the minimize lateness problem. Which proof technique is used to prove optimality of the algorithm?

An exchange argument

Consider the proof of optimality of the greedy algorithm that solves the interval scheduling problem. In the last step of the proof, a proof by contradiction is used. Which assumption is made that leads to a contradiction?

Assume that the greedy solution is not optimal.

We have seen that Dijkstra's algorithm solves the problem of finding the shortest paths in a weighted graph, from one start node to all the other nodes. Which algorithm or algorithms solve the same problem in an unweighted graph?

Breadth-first search

Consider the greedy algorithm that solves the minimize lateness problem. In which order are the requests selected?

By increasing deadline

Consider the problem of finding the minimum spanning tree of a weighted graph G = (V, E). An algorithm starts with the set of nodes V and successively inserts edges from E in order of increasing cost. Any edge that would create a cycle is discarded. What is the name of the algorithm described?

Kruskal's algorithm

Consider a greedy algorithm that solves the problem of finding a minimum spanning tree of a graph. Which one of the following best describes the asymptotical running time?

O(m log n)

In the proof of correctness of Dijkstra's algorithm, we use induction on k. What does k represent?

The number of explored nodes

Consider the algorithm that computes the shortest paths from one start node to all the other nodes in a weighted graph. Which one of the following best describes its running time?

O(mlogn)

Consider the minimize lateness problem and the greedy algorithm that solves it. Which one of the following is not true regarding the schedule produced?

Only requests that meet their deadline have been scheduled.

Consider the problem of finding the minimum spanning tree of a weighted graph G = (V, E). An algorithm starts in a node s and successively adds edges from E to a partial tree in order of increasing cost. Any edge that connects two nodes already present in the tree is discarded. What is the name of the algorithm described?

Prim's algorithm

Consider the optimal implementation of the greedy algorithm that solves the interval partitioning problem. Which data structure is used?

Priority Queue

Which data structure is needed in an efficient implementation of Dijkstra's algorithm?

Priority queue

Consider the greedy algorithm that solves the interval scheduling problem. Which one of the following is not part of the greedy stays ahead proof used to prove optimality?

Proof by counterexample

What is the goal of the interval partitioning problem?

Schedule all the requests using as few resources as possible.

Consider a set of n requests and one resource. What is the goal of the interval scheduling problem?

Schedule as many non-overlapping requests as possible

Consider an optimization problem where the goal is to find the solution with the minimal cost. Which one of the following best describes the exchange argument proof technique?

Start with an optimal solution Exchange pieces without increasing the cost Argue that any optimal solution can be transformed into the greedy solution This proves that the greedy solution is also an optimal solution

Consider the greedy algorithm that solves the interval partitioning problem. Which proof technique was used to prove optimality of the algorithm?

Structural bound: Prove that there is a lower bound and that the greedy algorithm achieves it.

Three out of these four statement correctly describes any greedy algorithm. Which one does not?

The algorithm has linear running time.

Consider a consecutive inversion, two jobs scheduled as positions i and j with i < j and di > dj. Both jobs have non-negative latenesses. Which one of the following statements is true if the jobs are swapped?

The new lateness of job i cannot exceed the previous lateness of job j.

Consider the problem of finding the minimum spanning tree of a weighted graph G = (V, E). An algorithm starts with the graph G and removes edges in order of decreasing cost. An edge will not be removed if its removal disconnects the graph. What is the name of the algorithm described?

The reverse-delete algorithm

Consider the proof of optimality for the greedy algorithm that solves the interval scheduling problem. The greedy solution A is compared to an optimal solution O. Both are ordered by increasing start and finish times. What property of the greedy solution that is true for any index r ≤ k is used to prove optimality?

The rth interval in the greedy algorithm has an earlier finish time than the rth interval in the optimal solution

Consider the minimize lateness problem. Which one of the following statements regarding optimal solutions is true?

There is an optimal schedule with no inversions and no idle time.

Consider the problem of finding a minimum spanning tree in a graph. What can the cut property be used for?

We use the cut property to show that each addition of an edge in Kruskal's algorithm is justified.

Consider the problem of finding a minimum spanning tree in a graph. What can the cycle property be used for?

We use the cycle property to show that each removal of an edge in the reverse-delete algorithm is justified.

Consider the minimize lateness problem. For request i, we define ti duration di deadline si start time fi finish time What is the definition of the lateness li of a request?

li = max(fi - di, 0)


Ensembles d'études connexes

Chinese III Lesson 3 Can you help me move into my new house? (Part 1.Nouns)

View Set

Tort of Negligence - Superseding Cause and Affirmative Duties

View Set

Ed 1355 Exam 3 practice problems

View Set

Elements of Earth Science Lab: Quiz 8

View Set

General Science Module 8 (General Chemistry)

View Set

TXST Marketing 3343 Natesan - Exam 4

View Set