SolverForge

Learn More Download

Write constraints like you write code.

Model your planning problems with an expressive, business-object oriented syntax

constraints.py
def desired_day_for_employee(constraint_factory: ConstraintFactory):
    return (
        constraint_factory.for_each(Shift)
        .join(
            Employee,
            Joiners.equal(lambda shift: shift.employee, lambda employee: employee),
        )
        .flatten_last(lambda employee: employee.desired_dates)
        .filter(lambda shift, desired_date: shift.is_overlapping_with_date(desired_date))
        .reward(
            HardSoftDecimalScore.ONE_SOFT,
            lambda shift, desired_date: shift.get_overlapping_duration_in_minutes(desired_date),
        )
        .as_constraint("Desired day for employee")
    )

Get started in seconds
bash - solverforge
git clone https://github.com/SolverForge/solverforge-quickstarts
cd solverforge-quickstarts/fast/employee-scheduling-fast
python -m venv .venv && source .venv/bin/activate
pip install -e .
run-app