代写辅导接单-COMP3027 and COMP3927 Algorithm Design Assignment 3 s1 2024

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

Algorithm Design Assignment 3 s1 2024

 This assignment is due on April 24 and should be submitted on Gradescope. All submitted work must be done individually without consulting someone else’s so- lutions in accordance with the University’s “Academic Dishonesty and Plagiarism” policies.

As a first step go to the last page and read the section: “Advice on how to do the assignment”.

This assignment is for both COMP3027 and COMP3927 students. COMP3027 students should do Problems 1 and 2 while COMP3927 students should do Problems 1 and 3.

Problem 1. (20 points)

To begin, let us consider the Ford-Fulkerson algorithm. Consider below the flow

network G,c in Figure 1 and the current s−t flow f in Figure 2. Your task is to run one iteration of the Ford-Fulkerson algorithm on the flow network.

c

48f 2

11 1 d 5 s2t 10 6 2 10

2

76

   a

           b

g e

Figure 1: Flow network G with c : E → Z+ (edge capacities)

c

   45f 1

a 51d5

    s0t 8228

     b

g e

0 66

  Figure 2: f : E → Z+ (current flow through G)

1

 

Algorithm Design Assignment 3 s1 2024

 a) Draw the residual graph associated with the flow f. Specify the residual capacity of every edge. You are allowed to draw this by hand and insert a photo.

b) Specify an s − t path used to update the flow.

c) After the update, is the new flow through the network a max flow? Explain

why.

d) Specify a Min-Cut associated with graph G.

Problem 2. (80 points) (COMP3027 only)

You and your friends have decided to go on a great go-karting adventure. You’ve

heard that there is to be a symposium for algorithms and computing theory (SACT for short) in the bush (with music!), and since your good friend André owns k go-karts, you decide that the most fun way to get there is via an epic four wheel journey. There is only one issue - the go-karts can only go so far before they need to be refueled, meaning you need to design a trip that allows for picking up fuel every 10km. Even worse, you have realised that all these stops only have enough fuel for one go-kart, meaning that each individual go-kart will need to refuel at different stops. Formally, the SACT Go-Kart Problem is the following; given a positive integer k, n (2-dimensional) Cartesian points describing fuel stations and both a starting point S and end point T in the Cartesian plane, determine if k friends have valid paths from S to T. Note that a valid path involves stopping at a fuel station every 10km or less.

Figure 3: Map including go-karts start location, fuel stations, and the bush sympo- sium. A go-kart cannot travel 10km without visiting a fuel station.

As a keen algorithm’s student (after all, you’re trying to get to an algorithms conference!), you realise that the SACT Go-Kart Problem can potentially be solved through the use of flow network algorithms!

 2

 

Algorithm Design Assignment 3 s1 2024

  Figure 4: Map showing paths the go-karts could take to get to the symposium. Note that a fuel station can only be visited by one car, making three the highest number of paths from the starting location to the bush symposium.

Your task is to design a reduction from the SACT Go-Kart Problem above to an instance of Max Flow. For full marks, your reduction should be as fast as possible.

a) Describe how you translate an instance of the SACT Go-Kart Problem into an instance of Max Flow. In particular, you need to describe how you construct the flow network H based on the input of fuel stations, start and end points.

b) State which algorithm you use to compute the max flow in H.

c) Describe how you translate the output of the algorithm in (b) into a solution for the SACT Go-Kart Problem. In particular, describe how you determine if all k people are able to make the bush conference, and what their paths would be.

d) Prove the correctness of your reduction. In particular, you need to prove that there exists an integer F for which the following two statements hold:

• If the max flow is at least F, then your translation procedure in (c) pro- duces feasible paths for all k people.

• If there are feasible paths for all k people, then the max flow is at least F.

e) Prove the time complexity of your entire reduction, taking into account the steps in parts (a), (b) and (c). Make sure that your time complexity is stated in terms of n and k.

3

 

Algorithm Design Assignment 3 s1 2024

 Problem 3. (80 points) (COMP3927 only)

People have caught wind of your algorithm for getting to the SACT in the bush,

and others want to join your go-karting expedition (see Problem 2 for context). You decide to investigate how many go-karts you can get access to for the event, and find that if people are willing to get to different starting locations, many more peo- ple will be able to get to the bush conference. Furthermore, you have been granted the ability to add extra fuel to fueling stations, meaning multiple karts can now visit the same station. Of course, you’re now in charge of optimally adding this extra fuel to maximise the number of algorithm-enthusiasts who can make it to the SACT bush conference.

Formally, we define the p-SACT Go-Kart Problem as the following; given a pos- itive integer p representing the amount of extra fuel you can add to stations, n (2-dimensional) Cartesian points describing fuel stations, l starting points Si (with a positive integer k go-karts each) and an end point T all also in the Cartesian plane, determine the maximum number of valid paths starting from some Si(i ∈ l) ending at T. Note that 1 unit of fuel allows one more kart to pass through a given station. You wish to maximise the number of people who can get to the bush conference from starting points, and return the paths they could take.

Your task is to design a reduction from the p-SACT Go-Kart Problem above to an instance of Max Flow. For full marks, your reduction should be as fast as possible.

a) Describe how you translate an instance of the p-SACT Go-Kart Problem into an instance of Max Flow. In particular, you need to describe how you construct the flow network H based on the input of fuel stations, start and end points.

b) State which algorithm you use to compute the max flow in H. You should also describe how you optimise for the extra p fuel you add.

c) Describe how you translate the output of the algorithm in b) into a solution for the p-SACT Go-Kart Problem. In particular, describe where the extra fuel has been used and how you determine how many people are able to make the bush conference, and what their paths would be.

d) Prove the correctness of your reduction. In particular, you need to prove that there exists an integer F for which the following two statements hold:

• If the max flow is at least F, then your your translation procedure in (c) produces feasible paths for F people.

• If there are feasible paths for F people, then the max flow is at least F.

e) Prove the time complexity of your entire reduction, taking into account the steps in parts (a), (b) and (c). Make sure that your time complexity is stated in terms of n, l, k and p.

4

 

Algorithm Design Assignment 3 s1 2024 Advice on how to do the assignment

• Assignments should be typed and submitted as pdf (no pdf containing text as images, no handwriting).

• Start by typing your student ID at the top of the first page of your submission. Do not type your name.

• Submit only your answers to the questions. Do not copy the questions.

• When asked to give a plain English description, describe your algorithm as you would to a friend over the phone, such that you completely and un- ambiguously describe your algorithm, including all the important (i.e., non- trivial) details. It often helps to give a very short (1-2 sentence) description of the overall idea, then to describe each step in detail. At the end you can also include pseudocode, but this is optional.

• In particular, when designing an algorithm or data structure, it might help you (and us) if you briefly describe your general idea, and after that you might want to develop and elaborate on details. If we don’t see/understand your general idea, we cannot give you marks for it.

• Be careful with giving multiple or alternative answers. If you give multiple answers, then we will give you marks only for "your worst answer", as this indicates how well you understood the question.

• Some of the questions are very easy (with the help of the slides or book). You can use the material presented in the lecture or book without proving it. You do not need to write more than necessary (see comment above).

• When giving answers to questions, always prove/explain/motivate your an- swers.

• When giving an algorithm as an answer, the algorithm does not have to be given as (pseudo-)code.

• If you do give (pseudo-)code, then you still have to explain your code and your ideas in plain English.

• Unless otherwise stated, we always ask about worst-case analysis, worst case running times, etc.

• As done in the lecture, and as it is typical for an algorithms course, we are interested in the most efficient algorithms and data structures.

• If you use further resources (books, scientific papers, the internet,...) to for- mulate your answers, then add references to your sources and explain it in your own words. Only citing a source doesn’t show your understanding and will thus get you very few (if any) marks. Copying from any source without reference is considered plagiarism.

 5

 

 

51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468