You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
715 B
28 lines
715 B
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
|
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
|
# Released under the modified BSD license. See COPYING.md for more details.
|
|
|
|
import logging
|
|
|
|
from miplearn.components.component import Component
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class RelaxIntegralityStep(Component):
|
|
"""
|
|
Component that relaxes all integrality constraints before the problem is solved.
|
|
"""
|
|
|
|
def before_solve_mip(
|
|
self,
|
|
solver,
|
|
instance,
|
|
model,
|
|
stats,
|
|
features,
|
|
training_data,
|
|
):
|
|
logger.info("Relaxing integrality...")
|
|
solver.internal_solver.relax()
|