Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 33, Problem 1P

a.

Program Plan Intro

To give an algorithm that takes O(n2) timeto find the convex layers of a set havingn points.

a.

Expert Solution
Check Mark

Explanation of Solution

The technique used to compute the convex hull of set Q is known as Package wrapping technique. It was given by Jarvis march.

The total running time of the algorithm is O(nh) , where h is the number of vertices of CH (Q).

And if there are K convex layers and the Introduction to Algorithms, Chapter 33, Problem 1P layer contains li points, the total running time is

  O(nl1+nl2+.+nlk)O(n2) .Since i=1Kli=n .

b.

Program Plan Intro

To prove that the time required to compute the convex layers of set having npoints is Ω(nlogn) .

b.

Expert Solution
Check Mark

Explanation of Solution

The following is the sorting problem which can be done in linear time.

  • If the numbers are given in sorted order, the convex layers can be determined in linear time.
  • Suppose there is a convex layer say A with 3 points into set Q for each A[k]:(0,0),(k,0) and (0,A[k]) .
  • Also supposeQ be withn convex layers and Qi be a triangle representation with the vertices (0,0),(n+i1,o) and (0,B[i]) .
  • Therefore, the corresponding sorted value can be obtained from each convex layer when they are converted.
  • Since, finding convex layers can be done in lower bound. The time taken to determine convex layers will be O(nlogn) and also these can be sorted in O(nlogn) time.

Hence, a convex layer takes Ω(nlogn) time.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Given a directed graph with positive edge lengths and two distinct vertices uand v in the graph, the “all-pairs uv-constrained shortest path problem” is the problemof computing for each pair of vertices i and j the length of the shortest path from i toj that goes through the vertex u or through the vertex v. If no such path exists, theanswer is ∞. Describe an algorithm that takes a graph G = (V, E) and vertices u and v asinput parameters and computes values L(i, j) that represent the length of uv-constrainedshortest path from i to j for all 1 ≤ i, j ≤ |V|, i ! = u, j ! = u, i != v, j ! = v. Provide clearpseudocode solution. Prove your algorithm correct. Your algorithm must have runningtime in O(|V| ^2).
Let G = (V, E) be a connected, undirected graph, and let s be a fixed vertex in G. Let TB be the spanning tree of G found by a bread first search starting from s, and similarly TD the spanning tree found by depth first search, also starting at s. (As in problem 1, these trees are just sets of edges; the order in which they were traversed by the respective algorithms is irrelevant.) Using facts, prove that TB = TD if and only if TB = TD = E, i.e., G is itself a tree.
Algorithm: Network Flow(Maximu Flow, Ford-Fulkerson) and Application of Flow (Minimum Cuts, Bipartite Matching)   Consider a flow network and an arbitrary s, t-cut (S, T). We know that by definition s must always be on the S "side" of a cut and t is always going to be on the T "side" of the cut. Obviously, this is true for any cut. Now, consider minimum cuts. This is obviously still true for s and t, but what about other vertices in the flow network? Are there vertices that will always be on one side or the other in every minimum cut?   Let's define these notions more concretely. • We say a vertex v is source-docked if v ∈ S for all minimum cuts (S, T). • We say a vertex v is sink-docked if v ∈ T for all minimum cuts (S, T). • We say a vertex v is undocked if v is neither source-docked nor sink-docked. That is, there exist minimum cuts (S, T) and (S 0 , T0 ) such that v ∈ S and v ∈ T'   Give an algorithm that takes as input a flow network G and assigns each vertex to one of the three…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education