Question: 2. (35 pts.) Parallel Compilation Suppose you're compiling a large software package which consists of many source files. Some files depend on each other, so

2. (35 pts.) Parallel Compilation Suppose you're compiling a large software package which consists of many source files. Some files depend on each other, so that file A must be compiled before file B is compiled; we can represent such a dependency using a directed graph with an edge from A to B. If compiling each file takes 1 minute, then if there are n files, it would ordinarily take n minutes to compile the whole package. However, you have a large computer with many cores, so you can compile as many files as you want in parallel if their dependencies are already compiled. For example, if files A and B depend on file C, then you can compile all three files in only two minutes: first C, then A and B in parallel. (a) (30 pts.) Describe an algorithm to compute how long it will take to compile the package, given the dependency graph G (which you may assume is acyclic). (b) (5 pts.) What is the asymptotic runtime of your algorithm, if G has n vertices and m edges
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
