Simulated Annealing for optimization

4 次查看(过去 30 天)
I have a code for a backpack optimization problem using simulating annealing. I want to use it as a base to solve this task sequencing problem but I don't know how to change the capacity variable for this other application. The code attached is the one that i made using the excel information, which is the data for the backpack problem (articles, price, and weight for optimizing the price with less weight). The other excel data is the problem i want to resolve just adapting the existing code using Simulated Annealing algorithm. The other problem stablishes 3 machines and 4 tasks and the time for each in order to find the route that minimizes the time but goes through all the machines and tasks.

回答(1 个)

Prateekshya
Prateekshya 2024-10-4
Hello Ana,
To adapt your simulated annealing code from solving a backpack optimization problem to a task sequencing problem, you may follow the below steps:
  • Backpack Problem: Typically involves items with weights and values, and a capacity constraint. The objective is to maximize value while staying within weight capacity. The constraint is the weight capacity limit.
  • Task Sequencing Problem: Involves tasks that need to be scheduled on machines to minimize the total completion time. The objective is to minimize the total time to complete all tasks. The constraint says that all tasks must be scheduled, respecting the order and machine constraints.
Steps to Adapt the Code:
  1. Define the Problem Parameters: Read the task and machine data from your Excel file. Define a matrix where rows represent tasks and columns represent machines, with each entry being the time to complete a task on a machine.
  2. Objective Function: Implement a function that calculates the total completion time for a given task sequence.
  3. Simulated Annealing Algorithm: Modify the solution representation to be a sequence of tasks. Adjust the "neighbor" generation function to swap tasks or alter the sequence.
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Simulated Annealing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by