Introduction¶
Currently, considerable efforts must be put to find optimal solution for NP-Hard 4 problems. Reoptimisation deals with, If given an optimal solution to a problem instance \(I_O\), can we find a good approximated solution to instance \(I_N\), where \(I_N\) is \(I_O\) with some ‘local’ modifications? The goal is to expose some well known reoptimization algorithms. Some references 1 2 3.
- 1
Escoffier, B., Bonifaci, V., Ausiello, G.: Complexity and approximation in reoptimization (02 2011), <https://doi.org/10.1142/9781848162778_0004>
- 2
Vazirani, V.V.: Approximation algorithms. Springer (2001) <https://www.ics.uci.edu/~vazirani/book.pdf>
- 3
- 4
Usage¶
Implementation basically consists of
Having a graph data structure utility
Implementing the respective graph algorithm methods
Graph Data structure¶
The graph data structure implementation here is based on an adjacency list representation.
The adjacency structure is implemented as a Python dictionary of dictionaries, the outer dictionary is keyed by vertices and mapped to neighboring vertex forming an edge.
Vertices and Edges are provided with a weight property
Supports CRUD operations on vertices and edges of graph
Graph utilities
Graph
- Graph utilities class
Undirected Graph
- Undirected utilities class
Vertex
- Vertex utilities class
Edge
- Edge utilities class
Algorithms¶
Reoptimization of k Path vertex cover problems (k-PCVP)¶
The objective in k Path vertex cover problem is to compute a minimum subset \(S\) of the vertices in a graph \(G\) such that \(S\) covers all the paths of length \(k\) in the graph
Note k-PVCP will be referred as minimum k-PVCP throughout the package
PTAS for unweighted k-PVCP under constant size graph insertion 8¶
PTAS 9 algorithm when a constant size graph is inserted to the old graph. By constant graph we mean a graph having constant number of vertices.
- 8
Kumar M., Kumar A., Pandu Rangan C. (2019) Reoptimization of Path Vertex Cover Problem. In: Du DZ., Duan Z., Tian C. (eds) Computing and Combinatorics. COCOON 2019. Lecture Notes in Computer Science, vol 11653. Springer, Cham <https://link.springer.com/chapter/10.1007/978-3-030-26176-4_30>
- 9
UnweightedPVCP.reoptimize_ptas
- Method to perform the algorithm
k-PVCP utilities¶
Some utilities for k path vertex cover
PVCUtils.is_k_pvc
- Method to check if a vertex set is a valid k path vertex coverPVCUtils.is_vertex_set_path
- Method to check if a vertex set forms a path in the graphPVCUtils.is_path
- Method to check if a path exists in the graph
Package documentation¶
Package implementing some well known Reoptimization algorithms |
Contribution¶
Want to add or improvise the repository? Check out the Contributing documentation :)