SECQUOIA / gdplib

An open library of Generalized Disjunctive Programming (GDP) models
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Add toy problem README with problem details #38

Closed AlbertLee125 closed 3 months ago

AlbertLee125 commented 5 months ago

I added the toy problem from Linan's paper to the gdplib.

ZedongPeng commented 5 months ago

The black format check failed. @AlbertLee125

AlbertLee125 commented 3 months ago

The toy problem is ready to go. I changed the title to david_linan.py and changed the directory to david_linan. The spelling is failing because of the HDA_gdpopt file. Besides the hda file error, the code is ready to go.

Second thoughts: Gomez_linan is also a good name for the toy problem. They are the ones to create the given model. If you both think the title is better written as 'gomez_linan.py', please let me know.

AlbertLee125 commented 3 months ago

Change all parts where it is referred to 'Toy problem'. Does this run with the ldsda implementation?

m = build_model()
    pyo.SolverFactory('gdpopt.ldsda').solve(
        m,
        minlp_solver="gams",
        minlp_solver_args=dict(solver="baron", add_options=["option optcr=0.001;"]),
        tee=True,
        starting_point=[5, 1],
        logical_constraint_list=[m.oneY1, m.oneY2],
        direction_norm='Linf',
        time_limit=900
    )
    print("Solution: alpha=", pyo.value(m.alpha), " beta=", pyo.value(m.beta))
    print("Objective function value: ", pyo.value(m.obj))

If I set the starting point at [5,1], the code could not cross the infeasible wall of the problem. However, by setting the starting point at [1,1], the code could find the global minimum. I will mention about the infeasible wall in the documentation.

AlbertLee125 commented 3 months ago

I changed the title and name as Example 1 Problem of Liñán (2023).