Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HW 1 : VBA IN MS EXCEL - A GREEDY ALGORITHM FOR SCHEDULING PROBLEM You are going to use Greedy . xlsm workbook for homework

HW1: VBA IN MS EXCEL -
A GREEDY ALGORITHM FOR SCHEDULING PROBLEM
You are going to use Greedy.xlsm workbook for homework which requires a greedy
algorithm to solve a scheduling problem. You need to assign tasks to existing workstations
using a greedy algorithm as described below.
1. A Greedy Algorithm for Scheduling Problem
Having n tasks to be assigned to m workstations, a simple Greedy algorithm selects the
unassigned task with the maximum processing time at each step and assigns it to the
workstation with the smallest total processing time.
An example is given below:
Suppose we have 9 tasks with the following processing times: 3,5,6,10,11,14,15,18, and
20 minutes.
And suppose we have 3 workstations on which these tasks can be processed.
At each step, the algorithm selects the unassigned task with the maximum processing time
and assigns it to the workstation with the least total processing time.
The result is as follows:
The algorithm makes 9 choices and finds the solution in 9 iterations. You can check how the
algorithm works manually.
2. ASSIGNMENT
You are expected to create a sub procedure that runs the Greedy Algorithm to assign 26
tasks (with no precedence relation) to the two available stations (A and B).
In the Assignment sheet of the attached file Greedy.xlsm, you will see a table containing the
following columns:
HW 1: VBA IN MS EXCEL SOLVING A SINGLE-ROW LAYOUT 1/3/24
Tasks: the task names are listed in this column. We have tasks from T1 to T26.
Task Times: Processing times of the tasks are displayed in this column. Given task
times are just random integers (you may change them for testing your code).
Due time: Shows the due time of the corresponding task assuming that you are
currently at time zero.
Assigned Station: Initially, this column is empty. Your code is expected to:
o type A for the tasks that are assigned to the first station.
o type B for the tasks that are assigned to the second station.
Order in Station: Initially, this column is also empty. Your code is expected to type
the order of the task in the station that it is assigned to.
Status: For each task in the list, show the status (Finished in time, finished late,
in-process or waiting) at the time given next to cell Current Time (cell K5).
Finishing Time: The time when the task is finished. Leave blank if it is not finished
yet at the time given next to cell Current Time (cell K5).
Macro 1: Create a macro that carries out the algorithm defined in 1.1. Assign your macro to
Assign Tasks button in Assignment sheet.
Macro 2: Create another macro that gives the Status and Finishing Time information.
Assign this macro to View Status button. This macro should also display the machine status
indicating the current task in process and the next task to be processed for each machine in
cells K13:L14.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions