Analítica prescriptiva
/ Investigación operativa
/ Optimización combinatoria
/ Programación entera
Mediante la analítica prescriptiva se consiguen recomendaciones sobre las acciones que se han de seguir para reducir costes o mejorar los beneficios.
- Greedy: Solución a mano
- Travelling Salesman Problem: At each step of the journey, visit the nearest unvisited city.
- Knapsack: Sort items in decreasing order of value per weight (V/W), then insert them into the sack in that order until there is no space.
- Global techinques: Techniques that are guaranteed to find the optimal solution if you give the enough time.
- Dynamic Programming (DP) (backtracking, branch & bound)
- Constraint Programming (CP)
- Linear Programming (LP)
- Programación lineal continua: Simplex
- Programación lineal entera (discreta): Simplex Lineal Entero
- Mixed Integer Programming (MIP)
- Continuous math, Linear algebra,...
- Local Search (LS): Scale very well with problems of large size (may not give you the best solution).
- Tabu Search: Past moves or solutions are prohibited (tabu)
- Simulated Annealing: Random at the beggining, deterministic at the end.
- Hybrids: best of Global and Local.
- Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions paper, repo
Tecnicas |
Puntos Fuertes |
|
|
- CP: How much it prunes?
- LS: What are the sequence of solutions? How fast it goes down?
- LP, MIP: What is the relaxation? how good is it?
Un problema NP-Completo cumple
- Es muy rápido de checkear si la solucion propuesta es correcta.
- Si sabes resolver un problema NP-Completo, sabes resolverlos todos.
- Existe el mito de que se resuelven con coste exponencial.
- Feasibily Problems: Any solution meeting all the criteria is acceptable.
- Optimization Problems: Find the best solution that satisfies the criteria.
DP=Dynamic Programming, CP=Constraint Programming, MIP=Mixed Integer Programming
📍 Vehicle Routing Problems
Routing problem |
Description |
OR-Tools |
Traveling Salesman Problem (TSP) |
Visit all locations once and come back to the starting location. |
link |
Vehicle Routing Problem (VRP) |
A generalisation of the TSP with multiple vehicles. |
link |
VRP with capacity constraints |
Vehicles have maximum capacities for the items they can carry. |
link |
VRP with Pickups and Deliveries |
Each vehicle picks up items at some locations and drops them off at others. |
link |
VRP with time windows |
Vehicles must visit the locations in specified time intervals. |
link |
VRP with resource constraints |
Load and unload vehicles at the depot (the starting point). |
link |
VRP with dropped visits |
When you must pay a penalty for unvisited locations. |
link |
Dijkstra shortest path |
Find the shortest path between 2 locations (ej. Google Map finding route) |
|
- Knapsack (Problema de la mochila)
- Relajación Lagrangeana (empresa eléctrica, arrancar o parar una central térmica)
- Constraint programming
- Turnos de Madrid
- problema de asignación de turnos
- Procesos de aprovisonamiento, inventario...
- Cuánto envío del almacén a la tienda
Optimization Problems approach
-
Traducir el problema de negocio a un problema de optimización
Identificar Variables de decisión.
- Hora que empieza.
- Hora que acaba.
- Tarea que hace en el minuto 3
- Tarea que hace en el minuto 4
-
Normalemete se acaban con muchas soluciones que igualan la mejor función objetivo
- Recomendable: Añadir funciones objetivo secundarias hasta que queden pocas soluciones e idelamente una unica solucion. Ejemplo de turnos
Funcion pricipal: Encajar horarios
Fucion Scundaria: Que esten más contentos con su horario
🎅🏻 Kaggle Santa Competitions
- Hash Code
- ROADEF: Bastante complicada.
Constraint Programming Solvers
Para Constraint Programming sin dudarlo Choco Solver.
Library |
Languaje |
Price |
OR-Tools (Google) |
C++ (APIs: Java, Python, & .NET) |
Open Source |
CHOCO |
Java |
Open Source |
JACOP |
Java |
Open Source |
Gecode |
C++ |
Free |
ILog |
Binary |
Free with academic license |
MiniZinc / G12 |
Binary |
Free for students |
Mixed Integer Programming Solvers
Para Mixed Integer Programming no hay nada open source y bueno. Pero CPLEX, de IBM, tiene una versión community limitada por tamaño de problema.
Library |
Languaje |
Price |
GLPK |
C |
Open Source |
LPSolve |
C |
Open Source |
BCP |
C++ |
Open Source |
CBC |
C++ |
Open Source |
CPLEX (IBM) |
Binary |
Free with academic license |
Gurobi |
Binary |
Free with academic license |
SCIP |
Binary |
Free for academic use |
Linear Programming Solvers
Library |
Languaje |
Price |
CLP |
C++ |
Open Source |
SimplexSolver |
Java |
Open Source |
Para Local Search Optaplanner.
Library |
Languaje |
Price |
OptaPlanner |
Java |
Open Source |
Local Solver |
Binary |
Free with academic license |
Library |
Languaje |
Price |
cryptominisat |
C++ |
Open Source |
Glucose |
C |
Open Source |
Lingeling |
C |
Open Source |
UBCSAT |
C |
Open Source |
MiniSat |
Binary |
Free |
Library |
Languaje |
Price |
SCIP |
Binary |
Free for academic use |
https://kristerw.github.io/2022/11/01/verifying-optimizations/