CSU22012 Optimisation AlgorithmsJava

130 阅读3分钟

School of Computer Science Statistics CSU22012 Project Optimisation AlgorithmsGeneral Instructions . From Hash Code 2017, Online Qualification Round: “Have you ever wondered what happens behind the scenes when you watch a YouTube video? As more and more people watch online videos (and as the size of these videos increases), it is critical that video-serving infrastructure is optimized to handle requests reliably and quickly. This typically involves putting in place cache servers, which store copies of popular videos. When a user request for a particular video arrives, it can be handled by a cache server close to the user, rather than by a remote data center thousands of kilometers away. Given a description of cache servers, network endpoints and videos, along with predicted requests for individual videos, decide which videos to put in which cache server in order to minimize the average waiting time for all requests.”. This project is not focusing on the Google Hash Code contest as such – it is only a (good) excuse to make you design and implement optimisation algorithms. Be sure to read the adjoining “hashcode 2017 qualification round.pdf” .. You are encouraged to collaborate with your peers on this project, but all written work must be your own. In particular we expect you to be able to explain every aspect of your solution if asked.. We ask you to hand in a 10 page pdf report of your work (no need to include code in it).. The report should include the following sections:1. A short introduction;2. A requirement section that answers the question what is the system supposed to do;3. An architecture/design section that answers the question how your solution hasbeen designed to address the requirements described in the previous section;4. A series of sections that describe the different challenges you faced and your solutions. For instance, take one of your function, describe any difficulty you faced and your solution. These sections can be short – the objective here is to show how you crafted the solutions with the tools you have learnt so far; 5. a short conclusion. . We expect you to reference papers or blogs you use for your report (e.g., when choosing parameters for the genetic algorithm, etc.). We really want this report to show some degree of reflection.. The project is worth 30% of the total grade for this module. The breakdown of marks for the project will be as follows:– reading the file and creating the solutions (2D array) and fitness function: 15%– hill-climbing: 15%– genetic algorithm: 20%– different “greedy” or “neighbouring” algorithms, evaluation of some parameters of the genetic algorithm, etc.: 15%– “ ...and beyond”: different, more advanced algorithms (e.g., particle swarm op- timisation, ant colony optimisation etc.) or exploration of the performance of the algorithms or using a distributed system/a supercomputer or etc. (ask TA/demonstrators about this if you’re unsure): 15%– 代 写CSU22012 Optimisation AlgorithmsJava report: 20%. Reports will be submitted via Blackboard. All code is to be submitted via GitHub Classroom.. Due date: 31/03/2024 Section 1. Reading a Problem FileAccept the project assignment from GitHub Classroom: classroom.github.com/ a/RFySNB_D. There, you will find a Java file “ReadInput.java” that reads the files with the different instances of the problem (you’ll find them in the “input” directory). Try to read the different input files and check “empirically” that each of the fields of the data structure populated by the function “readGoogle” is correct.Section 2. Representation of a SolutionThe first step of any optimisation algorithm consists in representing a solution, i.e., a viable (or not) composition of the different simple elements of the problem. In our case, a solution is an assignment of the different files to the cache servers. An example of this can be seen on slide 5 of “CSU22012 Project2 Presentation.pdf” – i.e., “file 2 to cache 0; files 1 and 3 to cache 1; files 0 and 1 to cache 2”. We can represent that using a 2 dimensional array, showing whether a file (one dimension) is situated in any of the cache servers (the other dimension).Table 1 shows an example with 4 files and 3 cache servers. You can see that file 1 is only assigned to cache server 1 and file 2 is located in two cache servers (2 and 3), while file 3 is in none of the cache servers and file 4 is in all of them.File 1 File 2 File 3 File 4 Cache 1 1 0 0 1 Cache 2 0 1 0 1 Cache 3 0 1 0 1 Table 1: Example of a solution (2 dimensional array)Another way of representing that (without any conceptual difference) is the following:((1, 0, 0, 1), (0, 1, 0, 1), (0, 1, 0, 1)) (1)The problem has only one constraint: each file has a size (MB) and each cache server has a maximum capacity. You have to make sure that the following formula is always satisfied:A cache ci , A file fjfj ∈ ci , Σ fj < capacity(ci) (2)This means that for every solution as given above you need to check whether the condition holds or not – i.e., you just need (for each cache) to sum up the sizes of the files that are assigned to the cache and check whether it is less than the capacity of the cache.The fields “number of videos” and “number of caches” of the data structure populated by the function “readGoogle” should give you all the information you need to create the 2D array (matrix) required to represent a solution. Start with a solution with only 0s (i.e., no file is in any of the cache servers).For more detail, see the deck of slides “CSU22012 Project2 Presentation.pdf” .Section 3. Fitness FunctionNow we want to evaluate the solutions. For that, create a function that takes a solution (2D array) and computes the fitness function:. for each cache server, check that the sum of fi WX:codehelp