shayansm2 / metaalgolib

A python library for solving optimization problems using metaheuristic algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MetaAlgoLib

A Library For Metaheurisitc Algorithms

A python library for solving optimization problems using metaheuristic algorithms.
This document will illustrate how to use this code and how you can add new problems and algorithms to it.

For solving a pre-defined problem with a pre-writen algorithm, write the below script and change configs based on your requirements:

from src.AlgorithmFactory import AlgorithmFactory
from src.lib.Solver import Solver
from src.problems.QAP import QAPProblem

ga = AlgorithmFactory.get('genetic')

ga.set_hyper_parameter('number_of_iteration', 100)
ga.set_hyper_parameter('number_of_population', 10)
ga.set_hyper_parameter('crossover_percentage', 0.6)
ga.set_hyper_parameter('mutation_percentage', 0.1)

qap = QAPProblem()
qap.set_parameters(url='https://www.opt.math.tugraz.at/qaplib/data.d/bur26b.dat')

solver = Solver(ga, qap)
solver.with_objective_function_progress() \
    .with_convergence_report()
solver.solve()

print(solver.get_best_found_answer())
solver.show_plots()

For more examples, take a look at this link.

For defining a new problem, make a copy of customProblem.py in the problem directory and change it.
For defining a new algorithm, make a copy of customAlgorithm.py in the algorithm directory and change it.


Roadmap

core

  • initiate the project
  • SEO
  • solver plots
  • problem based plots
  • operators dictionary
  • algorithm setting
  • algorithm penalty function
  • problem feasibility metrics
  • make it a package
  • populations
  • hyper parameter optimizer

algorithms

  • genetic algorithm
  • particle swarm optimization algorithm
  • differential evolution algorithm
  • multi objective algorithm
  • NSGA-II
  • MOPSO

problems

  • quadratic assignment problem
  • nlp mathematical optimization problem
  • bin packing problem
  • location-inventory-routing problem

About

A python library for solving optimization problems using metaheuristic algorithms

License:MIT License


Languages

Language:Jupyter Notebook 85.4%Language:Python 14.6%Language:HTML 0.0%