Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Shortest building time (15 points) Imagine you are the main contractor building a large skyscraper. You are promised a huge bonus if you can finish

Shortest building time (15 points) Imagine you are the main contractor building a large skyscraper. You are promised a huge bonus if you can finish the job fast. Obviously, there are some constraints; you cannot install windows until you have built the walls. However, you can easily install windows and doors at the same time, while also painting the walls. You want to get an estimate on how long it will take you to build the skyscraper. (You may assume that each task is taking exactly one day to finish.) You have enough resources to perform independent tasks simultaneously.

(a) (2 points) Find how to represent this problem by using a directed graph. Make sure to give a precise description of how nodes, edges and directions are assigned.

(b) (5 points) Assume you are given a directed graph in an adjacency list format. Suppose you are removing nodes and the adjacent edges one at a time (in random order). Find an O(m + n) algorithm to keep track of the current indegree of each node.

(c) (8 points) Find an efficient algorithm that returns the order in which tasks should be executed. Your algorithm will return an array A of lists, such that the list A[i] consists of the tasks that can be executed on day i. [Hint: In each iteration find all the nodes with zero indegree and remove. To do this efficiently you may find the algorithm from part (b) useful.]

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

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. What are the pros and cons of diversity for an organisation?

Answered: 1 week ago

Question

1. Explain the concept of diversity and equality in the workplace.

Answered: 1 week ago