# CO3002 Analysis And Design Of Algorithms: Computer Science And Engineering

Get 30% Off + \$20 Signup Bonus ! Limited Time, Hurry !

### Questions:

This assignment consists of two parts. The first part is to be completed individually. The second part can be completed in groups of size up to three. Further instructions about group work will be provided separately.

You should prepare your answers electronically, in a Word document or pdf file. Where mathematical formulas, diagrams etc are needed you can use handwriting and insert them into the document as pictures, but any substantial amount of text should be typeset and not handwritten. You should have the individual and group parts in different files; there are separate submission points for the two parts on Blackboard.
In line with university policy,  marking will be done anonymously.   Please do not include your name or other personally identifiable information in your submission.

Part A (Individual, 30 marks)
In each of the following, a greedy algorithm is proposed for the given problem. Give a simple counterexample for each of them to show that the proposed greedy algorithm does not always return the optimal solution. You should (1) give an example input, (2) state the  solution returned by the greedy algorithm on that input, and (3) state the optimal solution (or indeed any better solution than the greedy one) for that input.

(a)    Input: An undirected graph G(V, E).
Problem: Find a minimum spanning tree T of G. Algorithm:
Choose an arbitrary vertex s in G Initialise S := {s}, T := {} (empty set), and u := s while S /= V do Find the minimum-weight edge e among all edges (u, v) where v is not in S Add v to S, add e to T , and set u := v end while (Note:  this is not Prim’s algorithm.)    [10 marks]
(b)    Input: A set A of animals, and a set of pairs (ai, aj) indicating animal ai cannot be put together with animal aj (because for example ai attacks or eats aj).
Problem: Choose a subset AJ of animals from A so that the animals in AJ can be safely put together, and that the number of animals in AJ is as large as possible.

Algorithm: Initialise AJ to be empty. For each animal in A, count the number of other animals it can be safely put together. In decreasing order of this count, consider each animal in turn and add it to AJ  if it can be put safely together with all other animals already in AJ.    [10 marks]

(c)    Input: A set of n tasks,  each with a required “amount” of “work”;  a set of  m workers all of whom can work on any of the tasks.
Problem:  Assign the  tasks  to  the  workers  so  that  the  work is  “distributed as  evenly as possible among the workers”, or more precisely, the amount of work assigned to the busiest worker (the one with the largest amount of work) is as small as possible.

Algorithm: Sort the tasks in decreasing order of amount of work. For each task in this sorted order, assign it to the worker who currently (i.e., based on the assignment made so far) has the least amount of work assigned.    [10 marks]

Part B (Group, 70 marks)
Your country is being invaded. As part of the invasion, a long line of enemy armoured vehicles are moving along a road towards you. You can launch some drone attacks to damage or destroy some of those vehicles. Unfortunately you only have one drone, so you have to plan your attacks carefully to maximise the damage you cause to the enemy.

The line of n vehicles is moving at a constant speed past the point where you are stationed (and where you launch your attack). For simplicity, we assume they move one unit of distance per unit of time, and that the vehicles are spaced one unit of distance apart from each other. Each enemy vehicle has a certain “value” (how much it is worth to destroy it). So, we can assume there is a sequence of vehicles x1, x2, . . . , xn with values v1, v2, . . . , vn. At time i = 1, 2, . . ., vehicle xi is directly under your drone and is the only one you can attack. Based on satellite imaging, you have all the information about these vehicles in advance.

Your drone can only perform one attack at a time. After it fired, it needs to return to base, refills its ammunition (“ammo” for short), and goes up in the air again. The more ammo it carries, the more powerful the strike is, but it also takes more time to be loaded up. To be precise, it needs one unit of time for returning to base, w units of time to refill it with w units of ammo, and another unit of time to go up in air. Thus in total it needs w + 2 units of time between two strikes, if it is to be loaded with w units of ammo. You can assume you have unlimited ammo, but the drone can carry at most W  units of ammo each time.  Assume w and W are all integers.

A strike at an enemy vehicle may not completely destroy it; we assume that with w units of ammo, one strike causes w2 units of damage to the vehicle (i.e. reduces its value by w2), and if the value goes down to 0 it is completely destroyed. Note that each strike uses up all the ammo the drone carries, and you only get at most the value of that vehicle. For example if the drone carries 5 units of ammo and fires it at an vehicle with value only 7, you only caused 7 units of damage (reduced its value from 7 to 0), not 25.

You can have the drone loaded and up in the air already before the enemy arrives (so the first strike does not require loading time and it can carry maximum ammo). Your task is to determine the timing of the strike(s) and how much ammo to carry in each strike, so as to maximise the total damage to the vehicles.

The following is  an  example.  Suppose  n  =  13,  v1..v13 =  [2, 3, 0, 1, 4, 4, 1, 0, 4, 0, 1, 6, 4], W = 3. Suppose the drone initially carries 3 units of ammo and first strikes at time t = 2, causing min(v2, 32) = 3 units of damage to x2.  Then it returns to base and fills up 2 units of ammo, so it is only ready at time t = 6. Then it strikes at t = 6, causing min(v6, 22) = 4 units of damage to x6. Then it returns to base and refill with 3 units of ammo, so it will only be ready to fire again at time t = 11, and it waits until t = 12 to fire and causes min(6, 32) = 6 units of damage to x12. In total the damage done is 3 + 4 + 6 = 13 units. Alternatively, if the drone strikes at times t = 1, 5, 9, 13, with 2 units of ammo each time, it causes a damage of 2 + 4 + 4 + 4 = 14 (why?) There are many other possible strategies. Your task is to find the best one.

(a)    Design an efficient algorithm for this problem. You should: (the following is described in terms of the design of a dynamic programming algorithm, since you almost certainly should use it)

•    In plain English or using some mathematical notation, give a recursive formulation of the problem.
•    Give the pseudocode of the algorithm that is based on this formulation.
•    Analyse the time and space complexity of your algorithm.
•   Illustrate how your algorithm works when given the 13-vehicle example above as input. You only need to show the contents of the completed dynamic programming tables. [50 marks]

Hint: One possible approach is to define V (i) to be the optimal total damage where the input consists of only the vehicles  x1, . . . , xi.  At  time i, either the  drone doesn’t strike, or it does with w units of ammo on board for some w. In the latter case, the previous strike (if there is one) can only happen at time i − w − 2 or earlier, and we have to find the optimal solution of the problem where xi−w−2 is the last vehicle. Consider all these possible scenarios and use recursion for the subproblems. Note that if i − w − 2 ≤ 0 then there cannot be a previous strike (i.e. this is the first strike) so it can carry maximum ammo with no loading time; you need to handle this correctly.

There are other correct approaches; the above is just one possible formulation.
(b)    Unfortunately, as it turns out, you don’t have unlimited ammo; you only have M units of ammo, so all the strikes together can use at most M  units of ammo.  Again assume M  is an integer.
Design an efficient algorithm for the same problem in this limited-ammo case. You only need to give a recursive formulation and/or pseudocode and explain the time complexity.
Hint: one possible approach is to define V (i, k) to be the optimal total damage where the input consists of only the vehicles x1, . . . , xi and with k units of ammo available. Consider all possibilities on what happens at time i as in (a).) [20 marks

### CO3002 Analysis And Design Of Algorithms

Solved by qualified expert

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

If you are searching for premium quality, fast written and mistake-free essays, MyAssignmenthelp.com is the perfect companion for you. Whether you need an assignment for degree or to get admission in college, our top quality assignment is a perfect treat for you. Our PhD qualified writers are proficient to serve custom essay help, online assignment help and dissertations written from the scratch. No matter how late you are to approach us, MyAssignmenthelp.com always delivers your tasks right on time. MyAssignmenthelp.com is a renowned academic assignment help in UK, US and Australia that promise 100 percent unique, custom made and plagiarism-free content. Connect with us through our flexible communication modes of direct mail facility, telephonic conversation or live online chat. Our professionalism is beyond comparison as we treat our customers with best ever assignment help services.

## More ECO3002 CO3002 Analysis And Design Of Algorithms: Questions & Answers

### CIS6005 Computational Intelligence

Question:
Learning Outcomes
On the completion of this assignment you will be able to:
Critically appraise a comprehensive/detailed understanding of the computational intelligence domain.
Design and develop computational intelligence software artefacts.
Critique and contextualise emerging re …

### ISY1003 Foundations of Programming

Question:
Program expectation:
· The student must be able to explain the working of the program and its logic.
· Program should be indented, proper comments should be given, modification history should be present, variable names and data types should be chosen appropriately.
&middo …

### Information Technology and Engineering

Learning Objectives:The learning objectives for this major assignment are:K1. Explain the principles of inheritance, composition and their consequencesK2. Discuss basic object oriented conceptsK3. Explain the principles of event-driven programmingS1. develop object-oriented programs involving severa …

### D303 mobile development

App ScenarioThe Android app is for a company called “Tuck Box”. This company is looking to provide a lunch delivery service for customers in Palmerston North, Feilding, Ashhurst, and Longburn. Tuck Boxwill initially offer 4 different meals options for customers to select from. There will …

### Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.

##### Billy Blevins

I am a Mechanical Engineer from Detroit, USA, and I have got my Masters degree from Michigan Technological University.

700 – Completed Orders

Hire Me

##### Thomas Nelson

MS in Information Systems Technology with Specialization in Database Administration

134 – Completed Orders

Hire Me

##### Jaydon Key

research scholar in Columbia University and am pursuing my doctorate degree in Physics.

300 – Completed Orders

Hire Me

## Still in Two Minds? The Proof is in Numbers!

38983 Genuine Reviews With a Rating of 4.9/5.

#### Management

16 days

Hi thank you once again excellent service and timely, thank you for the hard work please thank the writer much appreate the effort involved

User ID: 7***88 Melbourne, Australia

#### It Write Up

5 days

The assignment was done on time and received good feedback from the teacher. Thank you team for helping out

User ID: 3***28 Melbourne, United States

#### Programing

3 days

Excellent work for this particular assignment, and it is extremely helpful thanks!

User ID: 8***44 Melbourne, United States

#### Management

14 days

I was impressed with the work done,especially with explaining to the detail and maintaining the word limit and giving good references.happy to receive …

User ID: 8***74 Launceston, India

#### Assignment

4 days

it was a good essay but it didn’t give me a very good mark in all , I was able to get a pass for the unit.

User ID: 3***08 Launceston, Australia

#### Project Management

9 hours

I received an A; great job; A LOT of APA formatting errors, but the data on the homework itself, GREAT!!

User ID: 8***71 Thornton Heath, United States

#### Management

1 day

great work …i can always trust this site for doing my work that too within my budget.

#### Management

7 days

the work was fine. i had no problem in the plagiarism thing. although it was a bit late but u guys still managed to do and were cooperative with it

User ID: 8***64 United Kingdom, Great Britain

#### English

6 days

The Paper was great had a few errors but did an outstanding job. I will recommend a friend

User ID: 8***01 Beaufort, United States

#### Operations

3 days

Very good and hard work I’m so happy and glad to hear about this company Anyone can order from this company I’m sure you will be so happy for this …

User ID: 3***20 United Kingdom, Great Britain

#### Healthcare

7 days

good work done by expert. satisfied with grade. Looking forward to get help with all my assignments. Than k you

User ID: 7***17 United Kingdom, Australia

#### Audit

3 days

Thank you again for great work. The expert was perfect for this assignment. I highly recommend my assignment help.

User ID: 8***29 United Kingdom, Canada

#### Healthcare

9 days

headacefree pass good job i recommande to trust my assignment help group…………………

User ID: 3***24 United Kingdom, Australia

#### Operations

22 days

Thank you, good job, my rating is 4.5good report covered all the assignment requirements well done !

User ID: 8***10 United Kingdom, Egypt

#### Biology

3 days

Glad with the work and recommend it’s usage by students who need help. I was content with the presentation of the work, I just did some few changes …

User ID: 5***86 Gaborone, United States

#### Programing

14 hours

It would be better if the experts could read the documentation requirements carefully

#### Statistics

4 days

Amazing work and very detailed oriented. I would recommend to anyone. This is amazing work and they know what they are doing

User ID: 8***00 Gaborone, United States

#### Marketing

4 days

i’m really happy with your determination to finish this project or wok on my assignment.i know it was not easy ,but i knew your team doing very wel …

User ID: 8***10 United Kingdom, Great Britain

#### Accounting

9 days

Passed the course thanks to you, everything is fine, and you are my number one to go site

User ID: 8***33 United Kingdom, Saudi Arabia

#### Finance

24 days

Looks amazing everything is fine, this is my 3rd time using your help and you guys never fail me, thanks

User ID: 8***33 United Kingdom, Saudi Arabia

#### Management

16 days

Hi thank you once again excellent service and timely, thank you for the hard work please thank the writer much appreate the effort involved

User ID: 7***88 Melbourne, Australia

#### It Write Up

5 days

The assignment was done on time and received good feedback from the teacher. Thank you team for helping out

User ID: 3***28 Melbourne, United States

#### Programing

3 days

Excellent work for this particular assignment, and it is extremely helpful thanks!

User ID: 8***44 Melbourne, United States

#### Management

14 days

I was impressed with the work done,especially with explaining to the detail and maintaining the word limit and giving good references.happy to receive …

User ID: 8***74 Launceston, India

#### Assignment

4 days

it was a good essay but it didn’t give me a very good mark in all , I was able to get a pass for the unit.

User ID: 3***08 Launceston, Australia

#### Project Management

9 hours

I received an A; great job; A LOT of APA formatting errors, but the data on the homework itself, GREAT!!

User ID: 8***71 Thornton Heath, United States

#### Management

1 day

great work …i can always trust this site for doing my work that too within my budget.

#### Management

7 days

the work was fine. i had no problem in the plagiarism thing. although it was a bit late but u guys still managed to do and were cooperative with it

User ID: 8***64 United Kingdom, Great Britain

#### English

6 days

The Paper was great had a few errors but did an outstanding job. I will recommend a friend

User ID: 8***01 Beaufort, United States

#### Operations

3 days

Very good and hard work I’m so happy and glad to hear about this company Anyone can order from this company I’m sure you will be so happy for this …

User ID: 3***20 United Kingdom, Great Britain

#### Healthcare

7 days

good work done by expert. satisfied with grade. Looking forward to get help with all my assignments. Than k you

User ID: 7***17 United Kingdom, Australia

#### Audit

3 days

Thank you again for great work. The expert was perfect for this assignment. I highly recommend my assignment help.

User ID: 8***29 United Kingdom, Canada

#### Healthcare

9 days

headacefree pass good job i recommande to trust my assignment help group…………………

User ID: 3***24 United Kingdom, Australia

#### Operations

22 days

Thank you, good job, my rating is 4.5good report covered all the assignment requirements well done !

User ID: 8***10 United Kingdom, Egypt

#### Biology

3 days

Glad with the work and recommend it’s usage by students who need help. I was content with the presentation of the work, I just did some few changes …

User ID: 5***86 Gaborone, United States

#### Programing

14 hours

It would be better if the experts could read the documentation requirements carefully

#### Statistics

4 days

Amazing work and very detailed oriented. I would recommend to anyone. This is amazing work and they know what they are doing

User ID: 8***00 Gaborone, United States

#### Marketing

4 days

i’m really happy with your determination to finish this project or wok on my assignment.i know it was not easy ,but i knew your team doing very wel …

User ID: 8***10 United Kingdom, Great Britain

#### Accounting

9 days

Passed the course thanks to you, everything is fine, and you are my number one to go site

User ID: 8***33 United Kingdom, Saudi Arabia