Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

carrying stones. You are given a directed acyclic graph G = (V,E) with n vertices and m edges, along with a node t e V.

image text in transcribed

carrying stones. You are given a directed acyclic graph G = (V,E) with n vertices and m edges, along with a node t e V. At each ) In addition, each edge e E E has a capacity c[el, which is a positive integer. Now, you can start out at any node with an empty bag, and then can travel along a path picking up stones along the way, adding them to your bag as you go: if the path visits node v, you can pick up pvstones and add them to your bag. However, whenever you traverse an edge along this path, the number of stones in your bag cannot exceed the capacity of this edge: if you have too many stones, you can drop some of them off before traversing the edge. You can think of each edge e as a "bridge" that cannot support the weight of more than clel stones vertex v E V, there are a number of stones qlv (so qlv is a nonnegative integer Your goal is to find a path, starting at any node with empty bag, and ending at t, so that you arrive at t with as many stones as possible (if there are any stones at t itself, you can also add those to your bag) To simplify the problem, instead of computing an optimal path, just compute the number of stones that such an optimal path will yield. Show how to solve this problem in time O(n + m). carrying stones. You are given a directed acyclic graph G = (V,E) with n vertices and m edges, along with a node t e V. At each ) In addition, each edge e E E has a capacity c[el, which is a positive integer. Now, you can start out at any node with an empty bag, and then can travel along a path picking up stones along the way, adding them to your bag as you go: if the path visits node v, you can pick up pvstones and add them to your bag. However, whenever you traverse an edge along this path, the number of stones in your bag cannot exceed the capacity of this edge: if you have too many stones, you can drop some of them off before traversing the edge. You can think of each edge e as a "bridge" that cannot support the weight of more than clel stones vertex v E V, there are a number of stones qlv (so qlv is a nonnegative integer Your goal is to find a path, starting at any node with empty bag, and ending at t, so that you arrive at t with as many stones as possible (if there are any stones at t itself, you can also add those to your bag) To simplify the problem, instead of computing an optimal path, just compute the number of stones that such an optimal path will yield. Show how to solve this problem in time O(n + m)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

d. What language(s) did they speak?

Answered: 1 week ago