BrunoRosendo / master-thesis

Source code for my master's thesis, in the topic "Quantum algorithms for optimizing urban transportation"
MIT License
5 stars 0 forks source link

Dwave VRP has vars that are not added to the model #63

Closed BrunoRosendo closed 5 months ago

BrunoRosendo commented 5 months ago

Since vars aren't explicitly added (only when they appear in the objective or constraint), there are sometimes errors when removing them in the simplifying step (they're not even in the model).

Possible solutions are adding all the vars explicitly, ignoring the vars that don't exist in the simplification, etc.

An example input is this one

cvrp = DWaveSolver(
        2,
        None,
        [
            (456, 320),
            (228, 0),
            (912, 0),
            (0, 80),
            # (114, 80),
            # (570, 160),
            # (798, 160),
            # (342, 240),
            # (684, 240),
            # (570, 400),
            # (912, 400),
            # (114, 480),
            # (228, 480),
            # (342, 560),
            # (684, 560),
            # (0, 640),
            # (798, 640),
        ],
        [
            (0, 3, 5),
            (2, 1, 6),
        ],
        True,
        True,
    )
BrunoRosendo commented 5 months ago

when this is fixed, test if is_result_feasible is needed in dwave

BrunoRosendo commented 5 months ago

The bug was the x_var function being wrongly calculated