Skip to main content

Package implementing some well known Reoptimization algorithms

Project description

Latest Version https://github.com/mek97/reoptimization-algorithms/workflows/Unit%20tests/badge.svg https://codecov.io/gh/mek97/reoptimization-algorithms/branch/master/graph/badge.svg https://img.shields.io/badge/License-MIT-blue.svg

Package implementing some well known Reoptimization algorithms

https://mek97.github.io/reoptimization-algorithms/_images/header.png

Perterson Graph (Made using GeoGebra)

Introduction

Currently, considerable efforts must be put to find optimal solution for NP-Hard problems. Reoptimisation deals with, If given an optimal solution to a problem instance IO, can we find a good approximated solution to instance IN, where IN is IO with some ‘local’ modifications? The goal in this repository is to expose some well known reoptimization algorithms.

Setup

Requirements

  • (Recommended) Python versions: >=3.6, <=3.8

Installation

  • Option 1

    To Install the stable latest package from pypi host

    pip install reoptimization-algorithms

  • Option 2

    To install directly from this repository execute the following in repository root directory

    python setup.py install

Documentation

Toy example

import reoptimization_algorithms as ra

old_graph = (ra.UndirectedGraph().add_vertex("4").add_edge("4", "5").add_edge("40", "50")
             .add_vertex("6").add_edge("4", "8").add_vertex("99").delete_vertex("6"))
attached_graph = ra.UndirectedGraph().add_edge("90", "95")
attach_edges = [ra.Edge("4", "90")]
old_solution = {"8"}

solution = ra.UnweightedPVCP.reoptimize_ptas(old_graph, attached_graph, attach_edges,
                                             old_solution, k = 3)
print(solution) # {"4"}

For detailed documentation and usage refer here

Implementation

Implementation basically consists of

  1. Having a graph data structure utility

  2. Implementing the graph algorithms

Algorithms

Algorithms implemented

  • PTAS for Reoptimization of unweighted k-path vertex cover under constant size graph insertion

Contribution

Want to add or improvise the repository? Check out the Contributing documentation :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reoptimization-algorithms-0.1.3.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

reoptimization_algorithms-0.1.3-py2.py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page