Skip to content

MixedIntegerLinearProgram: Remove _variables dictionary #20656

@mkoeppe

Description

@mkoeppe

The '_variables' attribute dictionary maps a "variable" (an "element" of a MIPVariable "dictionary") to an index in the backend. This is redundant because these "variables" are elements of type LinearFunction, and as such know their index in the backend already.

sage: p = MixedIntegerLinearProgram(solver='GLPK')
sage: pv = p.new_variable(nonnegative=True)
sage: pv[0]
x_0
sage: pv[77]
x_1
sage: pv[0].dict().keys()
[0]
sage: pv[77].dict().keys()
[1]

See also: #20461, #20602

Depends on #20461
Depends on #20462

CC: @nbruin @dimpase @videlec @jdemeyer @fchapoton @yuan-zhou

Component: numerical

Author: Matthias Koeppe

Branch/Commit: u/mkoeppe/mixedintegerlinearprogram__remove__variables_dictionary @ be0e0f0

Issue created by migration from https://trac.sagemath.org/ticket/20656

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions