1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
FromTheMoon [43]
3 years ago
10

Choose a problem that lends to an implementation that uses dynamic programming. Clearly state the problem and then provide high-

level pseudocode for the algorithm. Explain why this algorithm can benefit from dynamic programming. Try to choose an algorithm different from any already posted by one of your classmates.
Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
8 0

Answer:

Explanation:

The maximum weighted independent collection of vertices in a linear chain graph is a straightforward algorithm whereby dynamic programming comes in handy.

Provided a linear chain graph G = (V, E, W), where V is a collection of vertices, E is a set of edges margins, and W is a weight feature function applied to each verex.  Our goal is to find an independent collection of vertices in a linear chain graph with the highest total weight of vertices in that set.

We'll use dynamic programming to do this, with L[k] being the full weighted independent collection of vertices spanning from vertex 1 \to vertex k.

If we add vertex k+1 at vertex k+1, we cannot include vertex k, and thus L[k+1] would either be equivalent to L[k] when vertex k+1 is not being used, or L[k+1] = L[k-1] + W[k+1] when vertex k+1 is included.

Thus, L[k+1] = max \{ L[k], \ L[k-1] + W[k+1] \}

As a result, the dynamic programming algorithm technique can be applied in the following way.

ALGO(V, W, n) // V is a linearly ordered series of n vertices with such a weight feature W

\text{1. L[0] = 0, L[1] = W[1], L[2] = max{W[1], W[2]} //Base cases} \\ \\ \text{2. For i = 3 to n:- \\} \\ \\\text{3........ if ( L[i-1] > L[i-2] + W[ i ] )} \\ \\ \text{4............Then L[ i ] = L[i-1]} \\ \\ \text{5.........else} \\ \\ \text{6................L[i] = L[i-2] + W[i] }\\ \\ \text{7. Return L[n] //our answer.}

As a result, using dynamic programming, we can resolve the problem in O(n) only.

This is an example of a time-saving dynamic programming application.

You might be interested in
Which of the following can computer maintenance software determine?
Softa [21]

Answer:

A

Explanation:

Becuase i picked that and i git it right

7 0
3 years ago
Son opciones de configuración espacio multimedia llamado blog
Softa [21]

NSaAnswer:

th

Explanation:

nks

6 0
3 years ago
Which of the following could result from heat being transferred to a substance?
lbvjy [14]

Answer: i dont see the following sorry cant help ya

Explanation:

8 0
3 years ago
When inserting a fly in animation what is the first step in the process?
marishachu [46]

Answer:

The answer: select the element you wish to animate.

Explanation:

4 0
3 years ago
What type of network is the Internet? The Internet is an example of a_____network.
7nadin3 [17]

The Internet is an example of a WAN: Wide Area Network

5 0
3 years ago
Other questions:
  • In Paint, which of the following are ways to use a picture that you have saved on your computer? (Select all that apply.)
    8·1 answer
  • 1.Characters archetypes are typical characters that represent universal patterns of human or human roles. (True or false)
    14·1 answer
  • Escribe, en los siguientes cuadros, los conceptos que correspondan
    10·1 answer
  • Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need t
    13·1 answer
  • Analyze the following code. // Program 1: public class Test { public static void main(String[] args) { Object a1 = new A(); Obje
    5·1 answer
  • What piece of software tells the operating system how to use a specific hardware device? a. User interface b. System service c.
    14·1 answer
  • You’re having trouble connecting to the Internet so you call your Internet service provider for help. They need to know the perm
    15·1 answer
  • Friday Night Funkin Fans, does this count as a leak if I share it?
    13·2 answers
  • Avi does not want to save his internet browsing details on his computer. What should he do?
    11·1 answer
  • In what way, if any, is the impact of a given risk affected by the timing of a project?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!