Skip to content

Inefficient backjumping/backtracking case #199

Description

@frostming

I just want to record an inefficient case for backjumping(or backtracking) process.

Given this criterion of package A, the top is pinned most recently:

A<7 (from B)
A<7 (from C)
A<7 (from D)
A>=6 (from E)

In the current round we are trying to pin F and F depends on A<6, obviously it introduces a conflict. But the resolver has to exhaust all versions of F to realize F is not able to resolve at this point, and starts to back jump(in this case backjump is similar to backtrack because all packages are relevent here).

The next step is to revert B and try to find another working version, but it fails, then it goes on with C, D... Imagine A is a common dependency of many packages and each has a lot of versions. The resolver has to exhaust all versions of B,C,D and find out they are not helpful at all, because the critical package is E. The process will look like following:

1. F@{1...N}  # REJECT
2. B@2 -> F@{1...N}  #REJECT
3. B@3 -> F@{1...N}  #REJECT
...
4. C@2 -> B@{1...M} -> F@{1...N}  #REJECT
5. C@3 -> B@{1...M} -> F@{1...N}  #REJECT
...

That is a NxMxOxP... complexity. Is it possible to immediately find E that needs to pop out from the state without adding more methods to resolver?
@notatallshaw

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions