Skip to content

Use precedence constraints to enrich timelag constraints and vice versa #491

Merged
g-poveda merged 3 commits into
airbus:masterfrom
nhuet:precedence-vs-timelag
Jun 15, 2026
Merged

Use precedence constraints to enrich timelag constraints and vice versa #491
g-poveda merged 3 commits into
airbus:masterfrom
nhuet:precedence-vs-timelag

Conversation

@nhuet

@nhuet nhuet commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Normalization of timelag constraints: with negative offsets it is possible to express the same constraints with time lag in min or max list. Moreover duplicates or implied constraints can exist => we normalize the constraints via get_consolidated_time_lags(). Thus we update cpsat-auto:

    • how it finds equality timelags, and avoid adding two equivalent equality constraints
    • avoid adding start_to_end timelags constraints, already encompassed by end_to_start timelags constraints
  • Precedence constraints can be seen as end to start min time lags constraints => we add them to consolidated time lags, and we stop adding precedence constraints in cpsat auto to avoid duplicate constraints. We use that normalization in rcpsp/rcpsp_ms when constructing graph

  • Conversely, time lag constraints imply precedence constraints and thus should be taken into account into the precedence graph => get_consolidated_precedence_constraints()

In the meantime

  • We fix timelag constraints implementation in rcpsp/rcpsp_ms which were
    modifying the original list of timelags given in constructor.
  • We remove relax_the_start_at_end parameter used in rcpsp(_ms) satisfy

@nhuet nhuet marked this pull request as draft June 11, 2026 14:25
@nhuet nhuet marked this pull request as ready for review June 11, 2026 14:30
@nhuet nhuet force-pushed the precedence-vs-timelag branch from 618ed13 to 7f5a562 Compare June 12, 2026 14:29
@nhuet nhuet marked this pull request as draft June 12, 2026 14:42
nhuet added 3 commits June 12, 2026 17:28
- normalization of timelag constraints: with negative offsets it is
  possible to express the same constraints with time lag in min or max
  list. Moreover duplicates or implied constraints can exist => we
  normalize the constraints via `get_consolidated_time_lags()`.
  Thus we update cpsat-auto
  - how it finds equality timelags, and avoid adding two equivalent
    equality constraints
  - avoid adding start_to_end timelags constraints, already encompassed
    by end_to_start timelags constraints

- precedence constraints can be seen as end to start min time lags
  constraints => we add them to consolidated time lags, and we stop
  adding precedence constraints in cpsat auto to avoid duplicate
  constraints.
  We use that normalization in rcpsp/rcpsp_ms when constructing graph

- conversely, time lag constraints imply precedence constraints and thus
  should be taken into account into the precedence graph =>
  `get_consolidated_precedence_constraints()`

In the meantime
- we fix timelag constraints implementation in rcpsp/rcpsp_ms which were
  modifying the original list of timelags given in constructor.
- we rename SpecialConstraintsDescription.start_at_end_plus_offset
  into start_after_end_plus_offset to emphasize that this is an
  inequality rather than an equality between end+offset and start.
@nhuet nhuet force-pushed the precedence-vs-timelag branch from 7f5a562 to da62125 Compare June 12, 2026 15:29
@nhuet nhuet marked this pull request as ready for review June 15, 2026 07:55
@g-poveda g-poveda merged commit 5ba4fb7 into airbus:master Jun 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants