Simulated Annealing for optimization

4 vues (au cours des 30 derniers jours)
Ana Gabriela Fuentes
Ana Gabriela Fuentes le 27 Nov 2021
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.

Réponses (1)

Prateekshya
Prateekshya le 4 Oct 2024
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!

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by