Geo spatial constraints in OR-Tools CP-SAT

37 Views Asked by At

I'm currently studying OR-Tools and its CP-SAT solver for a project focused on optimizing task scheduling and skillset matching.

My project aims to automate the assignment of tasks to caretakers(operators) based on various criteria, such as the parties' availability, their specific expertise, geographical proximity to the task's location.

Although I have a foundational understanding of OR-Tools and its CP-SAT solver, I'm encountering difficulties when it comes to formulating and implementing the more complex constraints and data structures.

the dataset is like:

tasks = [
    {"id": "task1", "client": "elderly lady 1", "city": "City X", "province": "Province Y", "service": "physiotherapy"},
    {"id": "task2", "client": "elderly lady 1", "city": "City X", "province": "Province Y", "service": "house cleaning"},
    {"id": "task3", "client": "elderly lady 2", "city": "City Z", "province": "Province Z", "service": "physiotherapy"},
]

operators = [
    {"id": "operator1", "address": "Address A", "province": "Province Y", "specialization": "physiotherapist", "occupied_days": ["2024-03-01", "2024-06-02"]},
    {"id": "operator2", "address": "Address B", "province": "Province Y", "specialization": "cleaner", "occupied_days": ["2024-03-05", "2024-06-06"]},
]

I was wondering if using MongoDB to calculate the distances around a task could be a viable solution. However, I'm struggling with how to declare variables and integrate them into CP-SAT constraints, since all the examples I've found focus on numerical data.

Could anyone provide insights or examples on how to approach these complex constraints, particularly geographical proximity and calendar-based constraints, using the CP-SAT solver?

0

There are 0 best solutions below