1 answer

10. Maxima search a. A point (xi, yi) in the Cartesian plane is said to be...

Question:

10. Maxima search a. A point (xi, yi) in the Cartesian plane is said to be dominated by point (xj, уј ) İfxī x; and yi y, with at least one of the two inequalities being strict. Given a set of n points, one of them is said to be a maximum of the set if it is not dominated by any other point in the set. For example, in the figure below, all the maximum points of the set of 10 points are circled. YA Design an efficient algorithm for finding all the maximum points of a given set of n points in the Cartesian plane. What is the time efficiency class of your algorithm? b. Give a few real-world applications of this algorithm.

10. Maxima search a. A point (xi, yi) in the Cartesian plane is said to be dominated by point (xj, уј ) İfxī x; and yi y, with at least one of the two inequalities being strict. Given a set of n points, one of them is said to be a maximum of the set if it is not dominated by any other point in the set. For example, in the figure below, all the maximum points of the set of 10 points are circled. YA Design an efficient algorithm for finding all the maximum points of a given set of n points in the Cartesian plane. What is the time efficiency class of your algorithm? b. Give a few real-world applications of this algorithm.

Answers

Sort all points by increasing x coordinates. If two points have the same x coordinate, sort them by decreasing y coordinates. Now, it can be shown that a subset of points is non-dominated if and only if their y coordinates are non-increasing in our sorted sequence, meaning each y coordinate is less than or equal to the previous one in the subsequence.

So the algorithm would be:

  1. Sort the points as described above. Time: O(n*logn).
    Use merge sort.
  2. Find the longest non-increasing sub-sequence of y coordinates. Time: O(n*logn).
    This can be done by adapting the algorithm for finding the longest increasing sub-sequence.

Longest Increasing Sub-sequence :

The algorithm outlined below solves the longest increasing subsequence problem efficiently with arrays and binary searching.

It processes the sequence elements in order, maintaining the longest increasing subsequence found so far. Denote the sequence values as X[0], X[1], etc. Then, after processing X[i], the algorithm will have stored values in two arrays:

M[j] — stores the index k of the smallest value X[k] such that there is an increasing subsequence of length j ending at X[k] on the range ki. Note that j(i+1), because j ≥ 1 represents the length of the increasing subsequence, and k ≥ 0 represents the index of its termination.

P[k] — stores the index of the predecessor of X[k] in the longest increasing subsequence ending at X[k].

In addition the algorithm stores a variable L representing the length of the longest increasing subsequence found so far. Because the algorithm below uses zero-based numbering, for clarity M is padded with M[0], which goes unused so that M[j] corresponds to a subsequence of length j.

A real implementation can skip M[0] and adjust the indices accordingly.

Note that, at any point in the algorithm, the sequence

X[M[1]], X[M[2]], ..., X[M[L]]

is increasing. For, if there is an increasing subsequence of length j ≥ 2 ending at X[M[j]], then there is also a subsequence of length j-1 ending at a smaller value: namely the one ending at X[P[M[j]]]. Thus, we may do binary searches in this sequence in logarithmic time.

Psuedo Code :

P = array of length N  M = array of length N + 1   L = 0  for i in range 0 to N-1:    // Binary search for the largest positive j ≤ L    // such that X[M[j]] < X[i]    lo = 1    hi = L    while lo ≤ hi:      mid = ceil((lo+hi)/2)      if X[M[mid]] < X[i]:        lo = mid+1      else:        hi = mid-1     // After searching, lo is 1 greater than the    // length of the longest prefix of X[i]    newL = lo     // The predecessor of X[i] is the last index of     // the subsequence of length newL-1    P[i] = M[newL-1]    M[newL] = i     if newL > L:      // If we found a subsequence longer than any we've      // found yet, update L      L = newL   // Reconstruct the longest increasing subsequence  S = array of length L  k = M[L]  for i in range L-1 to 0:    S[i] = X[k]    k = P[k]   return S

Time complexity :

The algorithm is composed of two steps, each taking O(n*logn) time.
This gives our algorithm O(n*logn) time.

Q2)

  • Finding the outer region of any area/city.
  • Covering a field or deciding the outer region till when to use crop planes.

******************NOTE******************

If there is any problem with the code.. or If you have some doubts... please ask in the comments.

:)
If everything is good, please rate positively ... as it directly affects our payscale :)

.

Similar Solved Questions

1 answer
JAVA DATA STRUCTURES: Reading a Text file of words into two different data structures 1. Use a Binary search tree and then 2.Use a Hash Map. *USE BOTH BINARY & HASH MAP* * Get the file name as a u...
JAVA DATA STRUCTURES: Reading a Text file of words into two different data structures 1. Use a Binary search tree and then 2.Use a Hash Map. *USE BOTH BINARY & HASH MAP* * Get the file name as a user input.* Present a menu to the user with the below options: 1) Delete the first occurrence of a g...
1 answer
HRM732 Individual Assignment #2 (30 Marks) 15% of the overall grade for the course The year...
HRM732 Individual Assignment #2 (30 Marks) 15% of the overall grade for the course The year has passed and Ron has become used to being able to come to you with more and more complex finance and accounting questions about this Ukrainian Division. He has come into your office in the middle of Novembe...
1 answer
Plz solve this, I tried so many times i kept getting 0 or 6.5 and they...
Plz solve this, I tried so many times i kept getting 0 or 6.5 and they were wrong, thank u in advance, rating will follow for sure! Two small metallic spheres, each of mass m-0.25 g, are suspended as pendulums by light strings from a common point as shown in the figure below. The spheres are give...
1 answer
Acid-catalyzed dehydration of secondary and tertiary alcohols proceeds through an E1 mechanism. The first step is...
Acid-catalyzed dehydration of secondary and tertiary alcohols proceeds through an E1 mechanism. The first step is the protonation of the alcohol oxygen to form an oxonium ion Dehydration of 3-methyl-2-butanol forms one major and two minor organic products. Draw the structures, including hydrogen ato...
1 answer
Fill in the missing items for the following inventories: в с $ $ $ А 14,200...
Fill in the missing items for the following inventories: в с $ $ $ А 14,200 12,400 44,000 33,500 28,000 Beginning balance Ending balance Transferred in Transferred out 17,000 16,000 85,000 19,000...
1 answer
Let a vector z Rn be given. For X > 0 consider the problem (i) Show...
Let a vector z Rn be given. For X > 0 consider the problem (i) Show that for any λ 0 this problem has a unique solution「. (ii) Determine the unique solution「(as a function of λ and 2) Hint: Note that Λ is not differentiable everywhere. Remark: The solution of (i...
1 answer
How do you find the slope and intercept of #y=2x-1#?
How do you find the slope and intercept of #y=2x-1#?...
1 answer
Reviewing for finals. Getting stuck on these for some reason... Help is appreciated! How many grams...
Reviewing for finals. Getting stuck on these for some reason... Help is appreciated! How many grams of NaCl would be needed to prepare a 2.0M NaCl solution? Molar mass of NaCl is 58.44g/mol What is the molarity of a solution prepared by dissolving 3 mol NaI in 6L of solution?...
1 answer
A series circuit contains a 4.40-H inductor, a 6.00-Ω resistor, and a 4.50-V battery. The current...
A series circuit contains a 4.40-H inductor, a 6.00-Ω resistor, and a 4.50-V battery. The current is initially zero when the circuit is connected at t = 0. At what time will the current reach the following? (a)    33.3% of its final value ______________ s (b)  &n...
1 answer
Please assist with the information provided: Trico Company set the following standard unit costs for its...
please assist with the information provided: Trico Company set the following standard unit costs for its single product. Direct materials (30 Ibs. @ $4.40 per Ib.) Direct labor (6 ha. @ $14 per hr.) Factory overhead-variable (6 hrs. @ $8 per hr.) Factory overhead-fixed 16 hrs. @ $11 per hr.) ...
1 answer
Hi! I need help with finding the conversion for total units to be assigned cost! thank...
Hi! I need help with finding the conversion for total units to be assigned cost! thank you Cost of Production Report Hana Coffee Company roasts and packs coffee beans. The process begins by placing coffee beans into the Roasting Department. From the Roasting Department, coffee beans are then tra...
1 answer
Edwards Manufacturing Company​ (EMC) is considering replacing one machine with another. The old machine was purchased...
Edwards Manufacturing Company​ (EMC) is considering replacing one machine with another. The old machine was purchased 3 years ago for an installed cost of $ 10000. The firm is depreciating the machine under​ MACRS, using a​ 5-year recovery period.​ The new machine costs $ 244...
1 answer
Doakes Corporation uses a job-order costing system with a single plantwide predetermined overhead rate based on...
Doakes Corporation uses a job-order costing system with a single plantwide predetermined overhead rate based on direct labor-hours. The company based its predetermined overhead rate for the current year on the following data: Total direct labor-hours 60,000 Total fixed manufacturing overhe...
1 answer
The money raised and spent (both in millions of dollars) by all congressional campaigns for 8...
The money raised and spent (both in millions of dollars) by all congressional campaigns for 8 recent 2-year periods are shown in the table. The equation of the regression line is 9 -0.957x + 15.099. Find the coefficient of determination and interpret the result. 4 Money raised, 465.1 Money spent y 4...
1 answer
Alyeska Services Company, a division of a major oil company, provides various services to the operators...
Alyeska Services Company, a division of a major oil company, provides various services to the operators of the North Slope oil field in Alaska. Data concerning the most recent year appear below: Sales Net operating income Average operating assets $ 17,200,000 $ 4,800,000 $ 36,200,000 Required: 1. Co...
1 answer
Stock Expected Dividend Expected Capital Gain A $0 $10 B $5 $5 C $10 $0 A....
Stock Expected Dividend Expected Capital Gain A $0 $10 B $5 $5 C $10 $0 A. If each stock is priced at $110, what are the expected net percentage returns on each stock to (i) a pension fund that does not pay taxes, (ii) a corporation paying tax at 35% (the effective tax rate on dividends re...
1 answer
Two forces of magnitude 30 newtons (N) and 40 N act on an object at angles...
Two forces of magnitude 30 newtons (N) and 40 N act on an object at angles of 30 and -45° with the positive x-axis as shown in the figure. Find the direction and magnitude of the resultant force, that is, find F, Fm F1 = 30 N F21 - 40 N F +F₂= Dit Di Simplify your answer including any radi...