Compare the solution quality and time and memory used

Assignment Help Data Structure & Algorithms
Reference no: EM133776533

Algorithms Assignment:

Learning Outcome 1:  Apply specific search algorithms studied in the course to slightly unfamiliar problems.
Learning Outcome 2: Select appropriate data structures to optimize the performance of the search algorithms.
Learning Outcome 3: Measure and compare the solution quality and time and memory used by algorithms.

General Instructions
Programming Language: All students are required to use the Java programming lan- guage for this assignment. You may only use in-built Java library methods and classes (that are listed in the documentation for the Java Standard Edition API), as well as ones you write yourself. You are not permitted to import any third-party libraries to use in this assignment.

Individual Assignment: Each student must complete the main tasks specified as an indi- vidual to demonstrate achievement of the learning outcomes; no collaboration is permitted.

Marking Guideline: Marks are provided for functionality and for efficiency (optimising the execution times of your algorithms). The purpose of these tasks is three-fold: (i) you need to problem-solve: figure out how best to solve each task, (ii) implement and test the solution, and
(iii) measure execution time and/or memory needed for the algorithms to solve the problems.

Getting Started
Download the package assignment2base.zip from Canvas. In this package you will find three files:
UpgradeCheck.jar: A pre-compiled Java file that contains two classes: MapGenerator and
UpgradeCheck. These classes are black-boxes, you do not need to know how they work.
When compiling, you will need to ensure this jar file is on the Java classpath. You can use the -cp flag when invoking the Java compiler to set the classpath. For example:
javac -cp .;UpgradeCheck.jar *.java
This file was compiled with Java 21. To run it, you will need to use version 21 or higher.
UpgradeCalculator.java: This is where you will complete your assignment, some starting code has been provided to allow compilation.
UpgradeMain.java This is the main class to control the program, calling your methods from UpgradeCalculator.java. You may modify this file underneath the marked comment in order to test your code, but the modifications will not be really not part of the assignment.

Problem Scenario
Perhaps you remember the bustling metropolis of Veridian City in Assignment 1. The initial chaos of rush hour has been meticulously mapped and analysed. Thanks to your brilliant work as a digital traffic engineer, the city council now has a clear picture of the traffic bottlenecks and inefficiencies plaguing the streets. However, understanding the problem is only the first step. Your mission in Assignment 2 is to take your analysis to the next level. The city council is counting on you to design and propose real, actionable changes to the traffic system to solve the problems that have been identified. This involves tackling more complex problems and developing innovative solutions that go beyond basic analysis. Your task is to optimize traffic flow, reduce congestion, and improve overall commute times. The future of Veridian City's transportation network depends on your ability to think creatively and implement effective strategies. Every decision you make could lead to smoother commutes, lower emissions, and a happier, more efficient city.

661_Upgradation problem.jpg

Figure 1 shows an example of a roadmap of a city like the Veridian city. In fact it is the test map given in UpgradeMain.java in the base code supplied to you. Note that in every run of your program, a map generated randomly by the MapGenerator class will be used. Also, note that the points or intersections are denoted by indexes 0, . . . , n - 1, the roads by a pair of end points
while the other values at the points and the roads in the map could have fractions.

Each city point or intersection in the map needs certain amount of money and length of time to upgrade the point with security cameras, traffic lights, and so on. If a point or intersection is upgraded, then all the roads incident on the point are basically covered and the congestion levels of the incident roads get improved with certain levels. To be more specific, the value of upgrading a point should be considered equal to the sum of the weights of the incident roads. Note that upgrading only one end point of a road is considered sufficient in this case to improve the congestion level of a road. So upgrading both end points will not make any difference from upgrading just either end. The city council has a maximum budget of the money and also a time limit on the upgradation tasks to be completed. Obviously, the city council wants to maximise the coverage of the roads in the city and thus reduce the congestion level. You have to find which city points are to be upgraded.

The above problem actually could be modelled using a two dimensional knapsack problem. Let mk and tk be the money and time needed for point k. The total money and the time available are M and T respectively. Let sk be a boolean variable to denote whether a city point is selected for upgradation. Also, let c(s, k) denote congestion improvement possible if point k is upgraded but clearly c(s, k) will depend on the selection of other points in s since a road might have been already covered by the other end point of the road. So mathematically, the problem is as follows:

1389_Upgradation problem1.jpg

 

Problem Tasks

There are 4 tasks in this assignment. Three are to solve the problem using three methods such as dynamic program, heuristics, and metaheuristics. The other one is to report their performance.

The problem generator will give you the required arrays and the budgets as shown in Figure 1. You will use these as input in your solvers. The solvers will find the points to be upgraded, total congestion improvement that could be achieved, and total money and time to be spent. Also, determine the execution time and memory required by each solver to solve a given problem.

Dynamic Programming Solver: A method named dynamicProgrammingSolver is in the UpgradeCalculator.java. Write code inside that method to get a dynamic program- ming solver for the problema. Hint: use the example program for the dynamic programming
solver for the knapsack problem as a seed.

Heuristic Solver: Another method named heuristicSolver is also in the UpgradeCalculator.java. Write code inside that method to get a heuristic solver.

Hill Climbing Solver: Yet another method named hillClimbingSolver in the UpgradeCalculator.java. Write code inside that method to get a hill climbing metaheuristic solver for the problem. Hint: use the example program for the hill climbing solver for theknapsack problem as a seed.

Reporting Solver Performance: Generate 5 problems of different sizes using the problem generator given in the UpgradeCheck.jar file. Run each of the solver on the generated problems. The dynamic programmig solver would give the same solution every time you run the solver on the same problem and that is the optimum solution. The other two solvers may give different solutions in different runs, if randomised decisions have been made.In that case, run each solver on each problem at least three times and take the average to report the results. Include all the five instances in the report. Show all the results in tables or charts. Write a commentary on the solvers and compare their performance.

Task 1 Dynamic Programming Solver:
Correctly implements a dynamic programming algorithm to give an exact solution
Efficient implementation in time complexity
Efficient implementation in space complexity

Task 2 Heuristic Solver
Implementation of a heuristic algorithm
Selection of an appropriate heuristic
Quality of solution (exact solution not required, but the closer the better)
Efficient implementation in time complexity
Efficient implementation in space complexity

Task 3 Hill Climbing Solver:
Implementation of a hill climbing algorithm
Quality of solution (exact solution not required, but the closer the better)
Efficient implementation in time complexity
Efficient implementation in space complexity

Report:
Test data and results (five problems with three runs each on each solver)
Good discussion with comparison of solver performance.
Correct time complexity given for each algorithm with matching code provided
Correct space complexity given for each algorithm with matching code provided
Providing correct proofs and explanation.

Reference no: EM133776533

Questions Cloud

In terms of project management budgeting : In terms of project management budgeting, what does the term reserve mean? Should a reserve amount be included in a project proposal?
Subroutine structure of your matlab code : Present an outline of the procedural approach along with a flowchart showing the flow of control and subroutine structure of your Matlab code.
Engagement through culturally responsive practices : The role of the director of Scribbles Early Learning Program who is invested in supporting family engagement through culturally responsive practices.
Team members feel less motivated to work : This is leading to low performance because the team members feel less motivated to work. How can Karan solve this issue with his team?
Compare the solution quality and time and memory used : Algorithms - Measure and compare the solution quality and time and memory used by algorithms and Apply specific search algorithms studied in the course
Qualifications of health information technology : Briefly provide information on any additional experience you believe supports your qualifications of health Information Technology
Write your hypothesis or statement of the problem : BADM 440- Based on your chosen research method, write your hypothesis or statement of the problem for your research question.
Your model in regard to your particular change : Consider an organizational change you may have experienced in your work, church, discuss the associated steps of your model in regard to your particular change
Managing employees in global society : Competency Formulate strategies for conducting business and managing employees in a global society.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd