Complex_computing_problem

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Complex computing problem

Dr SHAHEER Muhammad
May 2024

1 Problem: Optimal Resource Allocation for Cloud


Services
1.1 Problem Statement
A company provides cloud computing services and wants to optimize the alloca-
tion of its computational resources to maximize profit while meeting the service
level agreements (SLAs) for its clients. The company’s data center has a finite
number of servers, each with different processing power and energy consumption
rates.
The company receives a series of job requests, each with the following at-
tributes:
• Processing requirement: The amount of computational power needed to
complete the job.
• Profit: The profit gained from completing the job.
• Deadline: The maximum time allowed for completing the job.
Each server has the following characteristics:

• Processing power: The number of computational units it can process per


unit time.
• Energy consumption rate: The amount of energy consumed per unit time.

The goal is to determine the optimal allocation of jobs to servers such that
the total profit is maximized without exceeding the energy consumption limits
and ensuring that all jobs are completed before their deadlines.

1.2 Constraints
• Each server can handle only one job at a time.
• The total energy consumption for all servers must not exceed a given limit
Emax .

1
• Each job must be completed by its deadline.
• Jobs cannot be preempted once they start processing on a server.

1.3 Input
• An integer n representing the number of jobs.
• An integer m representing the number of servers.
• An integer Emax representing the maximum allowed energy consumption.

• A list of jobs, where each job j is represented by:


– pj : Processing requirement.
– rj : Profit.
– dj : Deadline.

• A list of servers, where each server s is represented by:


– Ps : Processing power.
– Es : Energy consumption rate.

1.4 Output
A schedule of jobs to servers that maximizes the total profit, ensuring all jobs
meet their deadlines and the total energy consumption is within the allowed
limit.

2 Example
2.1 Input
• Jobs: [(10, 100, 5), (20, 200, 10), (30, 150, 7)]
• Servers: [(5, 2), (10, 3)]
• Emax = 50

2.2 Output
• Job 1 assigned to Server 1
• Job 2 assigned to Server 2

• Job 3 not assigned (or an alternative assignment that maximizes profit


while adhering to constraints)

2
2.3 Dynamic Programming Approach
To solve this problem using dynamic programming, we can use a state repre-
sentation that includes:
• The subset of jobs considered.

• The energy consumption state.


• The server assignment state.
Define a DP table DP [i][e][k] where:

• i is the index of the current job.


• e is the remaining energy budget.
• k is a bitmask representing the server assignment state.
The state transition can be defined as:

DP [i][e][k] = max(DP [i − 1][e][k], max(DP [i − 1][e − Es · ti ][k ∪ {s}] + ri ))


s

pi
where ti is the time taken to process job i on server s, computed as ti = Ps .

2.4 Steps
• Initialize the DP table.
• Iterate through each job and each possible state.
• For each job and state, try assigning it to each server if it fits within the
deadline and does not exceed the energy budget.
• Update the DP table accordingly.
• The maximum value in the DP table at the end will give the maximum
profit.

This problem encapsulates elements of job scheduling, resource allocation,


and combinatorial optimization, making it a challenging and comprehensive
application of dynamic programming.

You might also like